> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trymonte.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Anonymization

> Remove personal details from training data

Rows from real work, such as support tickets and chat logs, can hold names, addresses, and account numbers. `monte dataset add --anonymize` replaces those details before the rows are stored, so only anonymized rows reach artifact storage. Anonymization removes personal details. It does not grant the right to train on the rows.

## Anonymize Rows

```bash theme={null}
monte dataset add support-replies --from-file demos.jsonl --kind sft --anonymize --preview 20
```

`--preview` prints rows before and after, and stores nothing. Run the command again without `--preview` to add the dataset.

Two detectors find the details. A named entity recognition (NER) model finds names in context, and pattern rules find structured identifiers. The NER model runs where `monte dataset add` runs, so no row goes to a third-party model.

| Type | Detection | Placeholder |
| - | - | - |
| `person`, `org`, `location`, `address` | NER | `[PERSON_1]`, `[ORG_1]`, `[LOCATION_1]`, `[ADDRESS_1]` |
| `email`, `phone`, `ip` | Pattern | `[EMAIL_1]`, `[PHONE_1]`, `[IP_1]` |
| `account`, `card` | Pattern | `[ACCOUNT_1]`, `[CARD_1]` |
| `id` | Pattern | `[ID_1]`, for national ID, passport, and tax numbers |

`--entities` limits the types, and `--threshold` (default `0.5`) sets the lowest NER confidence that counts as a find. A lower threshold finds more names and also replaces more words that are not personal.

## Choose a Replacement

| `--replace` | Output for `Hi, this is Dana Ortiz` |
| - | - |
| `placeholder` (default) | `Hi, this is [PERSON_1]` |
| `pseudonym` | `Hi, this is Priya Shah` |
| `redact` | `Hi, this is [PERSON]` |

A placeholder or a pseudonym maps the same value to the same replacement in every turn of a row, so a ticket that names the customer twice still reads as one person:

```json theme={null}
{"messages": [{"role": "user", "content": "Hi, this is [PERSON_1] from [ORG_1]. I cannot sign in to account [ACCOUNT_1]."}, {"role": "assistant", "content": "Hi [PERSON_1], on the login page, click Forgot Password and enter [EMAIL_1]. The reset link expires in 1 hour."}]}
```

## Keep Terms and Add Patterns

A keep file lists names that must stay, such as the company's own product names. A pattern file adds identifier types that the built-in rules do not know. Each key becomes a type with its own placeholder.

```text keep.txt theme={null}
Acme Support
Acme Cloud
```

```yaml patterns.yaml theme={null}
case: 'CASE-\d{6}'
ticket: 'TKT-[A-Z]{2}\d{5}'
```

```bash theme={null}
monte dataset add support-replies --from-file demos.jsonl --kind sft \
  --anonymize --keep keep.txt --patterns patterns.yaml
```

With these files, `CASE-104233` becomes `[CASE_1]`, and `Acme Cloud` stays as it is.

## Check What Remains

`monte dataset show support-replies` prints how many values of each type the add replaced.

> [!WARNING]
>
> Detection misses some details, and a model can learn and repeat a detail that stayed in its rows. Read a sample of the rows before a run trains on them. A fix is a new version of the dataset.

## Storage

With BYOC, the rows stay in the team's artifact storage, and generation and training run on GPU instances in BYOC, so no row passes through Monte. With Monte Cloud, Monte stores the rows and its GPU instances read them. [Security and Privacy](https://docs.trymonte.ai/security.md) lists what Monte can see in each option.

## Delete a Dataset

> [!WARNING]
>
> Deleting a dataset does not remove what a model learned from it. To remove that influence, delete the checkpoints trained on it and their deployments, then train again without the dataset.

```bash theme={null}
monte dataset delete support-replies
```

The command removes every version from artifact storage. Run history keeps the record that a run trained on the dataset, but not the rows.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.