> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.nvidia.com/nemo-helix/v0.7.0/documentation/anonymize-data/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo-helix/_mcp/server. # Anonymizer Service The Anonymizer service detects personally identifiable information (PII) in text data on the NeMo Helix and replaces or rewrites it. ## Overview The service wraps the open-source [NVIDIA NeMo Anonymizer library](https://github.com/NVIDIA-NeMo/Anonymizer) and exposes it through the NeMo Helix's Python SDK and CLI. The library still owns PII detection, replacement, rewrite, and config validation. The platform adds inference routing through the Inference Gateway, fileset-backed inputs, SDK/service execution for streaming preview, and a Jobs-worker path for full anonymization runs. ## How It Works: Library + Platform The library defines **what** to anonymize and **how**. The platform decides **where the work runs** and **how models are reached**. > **Note** > > The code snippets below are for conceptual demonstration purposes only. For runnable examples, see the [tutorials](/documentation/anonymize-data/tutorials). ### 1. Build a config with the library Use `anonymizer.config` (installed automatically with the `nemo-anonymizer-plugin`) to define the replacement strategy: ```python from anonymizer.config.anonymizer_config import AnonymizerConfig from anonymizer.config.replace_strategies import Redact config = AnonymizerConfig( replace=Redact(format_template="[REDACTED_{label}]"), ) ``` **The library handles:** PII detection, the four replacement strategies (`Substitute`, `Redact`, `Annotate`, `Hash`), the `Rewrite` mode, and config validation. **Learn more:** See the [open-source library documentation](https://github.com/NVIDIA-NeMo/Anonymizer/tree/main/docs) for detailed coverage of detection, replacement strategies, and rewrite mode. ### 2. Execute on the platform Submit the config to the Anonymizer service with the NeMo Helix SDK: ```python from nemo_anonymizer_plugin.app.task_config import PreviewRequest from nemo_helix import NeMoHelix sdk = NeMoHelix(base_url="...", workspace="default") anonymizer = sdk.anonymizer preview_result = anonymizer.preview(PreviewRequest( config=config, data={"source": "my-fileset#data/input.csv", "text_column": "biography"}, model_configs=[...], num_records=10, )) preview_result.dataset # pandas DataFrame of anonymized records preview_result.trace_dataset # detection trace preview_result.display_record(0) # render a record with entity highlights ``` The basic CLI equivalent streams NDJSON frames: ```bash nemo anonymizer preview --spec-file /path/to/preview-spec.yaml ``` For a full anonymization run, submit the job to the Jobs worker: ```bash nemo anonymizer run --spec-file /path/to/run-spec.yaml ``` The SDK equivalent is `sdk.anonymizer.run(request)`, which returns an `AnonymizerJobResource` you can poll with `wait_until_done()` and pull artifacts from with `download_artifacts()`. **The platform handles:** Inference routing through the Inference Gateway, fileset-backed inputs, and authentication. ## Key Differences from Standalone Library When using Anonymizer as a NeMo Helix service: | Feature | Standalone Library | NeMo Helix Service | | ------------------ | ------------------------------------- | ------------------------------------------------------------------------------------ | | **Inference** | Direct calls to NVIDIA Build defaults | Routes through the Inference Gateway via `model_configs` | | **Execution** | Local Python process | Streaming preview runs through the SDK/service; full runs execute on the Jobs worker | | **Input sources** | Local file, `http(s)` URL | `http(s)` URL or NeMo Helix Fileset | | **Artifacts** | Local filesystem | NeMo Helix job artifact storage for `run` | | **Authentication** | Direct API keys | NeMo Helix Secrets service | ## Replacement Strategies The library supports four replacement strategies plus a full-passage rewrite mode. The plugin exposes all of them unchanged. | Strategy | Behavior | | ------------ | -------------------------------------------------------------------------------------------------------------- | | `Substitute` | LLM-generated, contextually realistic replacements (for example, swap a real name for another plausible name). | | `Redact` | Replace detected entities with a fixed redaction token (for example, `[REDACTED_FIRST_NAME]`). | | `Annotate` | Wrap detected entities with span-style labels. | | `Hash` | Replace detected entities with deterministic hashes. | | `Rewrite` | Rewrite the entire passage to protect both explicit and implicit identifiers. | See the [library documentation](https://github.com/NVIDIA-NeMo/Anonymizer/tree/main/docs) for the configuration shape of each strategy. ## What the Plugin Adds This package is a thin wrapper around the [NVIDIA NeMo Anonymizer library](https://github.com/NVIDIA-NeMo/Anonymizer). It does **not** re-document detection, replacement, or rewrite semantics. It adds: * A `nemo anonymizer` CLI with `validate`, `preview`, and `run` commands. * An `sdk.anonymizer` SDK accessor (`AnonymizerResource`, `AsyncAnonymizerResource`). * A streaming `anonymizer.preview` function that emits `preview_dataset`, `trace_dataset`, and `failed_records` frames from the plugin service. * An `anonymizer.run` job that writes `dataset.parquet`, `trace.parquet`, `metadata.json`, and optional `failed_records.json`. The job executes on the NeMo Helix Jobs worker (`nemo anonymizer run` / `sdk.anonymizer.run`). * Fileset input handling (`fileset:///#`). * Inference Gateway routing for model providers referenced from `model_configs`. ## Next Steps #### [Tutorials](/documentation/anonymize-data/tutorials) Walk through preview (`anonymizer.preview`) and job execution (`anonymizer.run`) end to end. #### [SDK Resources](/documentation/anonymize-data/sdk-resources) Reference for the `anonymizer` SDK accessor, preview result, and job result objects. #### [CLI Reference](/documentation/anonymize-data/cli-reference) Reference for `nemo anonymizer` commands and their spec files. #### [Studio UI](/documentation/studio/anonymizer) Configure a job, preview it on a few records, and track results from **Datasets > Anonymizer** in NeMo Studio. #### [Library Documentation](https://github.com/NVIDIA-NeMo/Anonymizer/tree/main/docs) Detection, replacement strategies, rewrite mode, and other library internals. ## Docs - [Tutorials](https://docs.nvidia.com/nemo-helix/v0.7.0/documentation/anonymize-data/tutorials.md): - [Preview a Config](https://docs.nvidia.com/nemo-helix/v0.7.0/documentation/anonymize-data/tutorials/preview-a-config.md): - [Run an Anonymizer Job](https://docs.nvidia.com/nemo-helix/v0.7.0/documentation/anonymize-data/tutorials/run-an-anonymizer-job.md): - [Anonymizer NeMo Helix SDK Resources](https://docs.nvidia.com/nemo-helix/v0.7.0/documentation/anonymize-data/sdk-resources.md): - [CLI Reference](https://docs.nvidia.com/nemo-helix/v0.7.0/documentation/anonymize-data/cli-reference.md):