PII protection
Detect personal data in your prompts and choose how to handle it — mask it, swap it for reversible tokens, or block the request entirely.
PII detection tuned for Southeast Asia
Anoman runs its PII detection engine over your prompts to detect personal data before it reaches the provider. Beyond the usual global entities, the detectors are tuned for SEA national identifiers — Indonesian NIK, Singapore NRIC, Malaysian MyKad, and Thai national ID — the identifiers that matter for UU PDP and PDPA compliance.
SEA identifiers
- 🇮🇩
ID_NIK - 🇸🇬
SG_NRIC - 🇲🇾
MY_MYKAD - 🇹🇭
TH_NATIONAL_ID
Global entities (default)
EMAIL_ADDRESSCREDIT_CARD
Opt-in entities
PHONE_NUMBERIP_ADDRESSURL
How to handle detected PII
Set pii_mode per policy group to one of six modes. The default is redact. tokenize and synthetic are the modes that keep raw PII away from the provider while still giving you a correct answer.
| Mode | Behavior |
|---|---|
redact (default) | Mask detected entities with a placeholder (e.g. [REDACTED]) before sending to the provider. Irreversible. This is the default. |
tokenize | Replace each entity with a reversible token, send the tokenized prompt to the provider, then de-anonymize the model's response back to the real values before returning it to you. |
synthetic | Swap each entity for a realistic fake value (a plausible email or ID) so the model reasons over coherent data, then de-anonymize on the response. |
block | Return HTTP 403 if any PII is present in the prompt. Nothing is sent to the provider. |
mask | Legacy alias for redact (full <ENTITY_TYPE> placeholder). |
detect | Legacy alias for block — returns 403 when PII is found. |
Config
Response header
You get the real answer back
The key idea behind tokenize and synthetic: the PROVIDER never sees raw PII, but YOU still get a correct, real answer. The gateway maps entities to tokens (or fakes) on the way in, and reverses the mapping on the way out — a dedicated de-anonymization step runs on the model's response before it's returned to you.
Why de-anonymize on the response? Masking a user's own PII back at them would be terrible UX — if a user asks about their own record, they should see their own data. tokenize/synthetic protect the third-party provider, not the caller, so the response is restored to the real values.
Use redact or block when you never want the real data to leave your own boundary; use tokenize or synthetic when you need a correct answer AND provider-side privacy.
Skip PII for one key
PII is one of only two guardrails you can override per API key. An API key's guardrail_overrides JSONB can set piiEnabled: false to skip PII scanning for that key alone, independent of its policy group. (Injection detection is mandatory and can never be disabled per key — see policy groups for the full priority order.)
Per-key override
Whatever mode is active, the completion reports the outcome in the X-Anoman-Guardrail-Pii response header, including the masked entity count.
Where to set the mode
Set the PII mode per policy group in the dashboard PII menu at /dashboard/guardrails. Per-key overrides live on the API key toggles at /dashboard/keys.
Related: output DLP scans the response side, and the guardrails overview shows where PII sits in the full pipeline.
Protect personal data
Pick a PII mode per policy group and keep raw data away from providers.