Presidio — PII detection & masking
Detect and mask personal data in prompts, tool results and model output
Presidio — PII detection & masking
The Presidio provider connects to Microsoft Presidio's analyzer and anonymizer services. It detects personal data (emails, phone numbers, SSNs, credit cards, names, locations, …) and either masks the matched text in place or flags the finding for blocking, per entity type. Excerpts in the events log never contain matched text — entity types and counts only.
Presidio is two services; point the row at both:
| Field | Meaning | Example |
|---|---|---|
presidio_analyzer_api_base | Analyzer base URL. Empty = provider inactive. | http://presidio-analyzer:3000 |
presidio_anonymizer_api_base | Anonymizer base URL. Required for mask/redact; block-only rows work without it. | http://presidio-anonymizer:3000 |
presidio_language | Analyzer language. | en |
presidio_filter_scope | Roles scanned at pre_call. | ["user", "tool"] |
output_parse_pii | Also scan assistant output at post_call. | true |
score_threshold | Minimum analyzer confidence for an entity to count. | 0.5 |
entities | Entity types to detect. Empty = every Presidio recognizer. | ["EMAIL_ADDRESS", "US_SSN", "CREDIT_CARD"] |
default_action | Action for entities without an explicit mapping. | mask |
entity_actions | Per-entity override: mask, redact, ignore, block. | {"US_SSN": "block"} |
| Hook | Notes |
|---|---|
pre_call | Scans the roles in presidio_filter_scope (add tool to also scan tool messages). |
post_call | Scans assistant output only when output_parse_pii is on. |
post_mcp_call | Scans tool results (with tool in scope). |
What each action does
- mask — replaces the entity with
<ENTITY_TYPE>. An explicitmaskmapping replaces with the entity's own name instead, e.g.<EMAIL_ADDRESS>. - redact — deletes the matched text entirely.
- ignore — leaves the text untouched (useful for noisy entity types).
- block — makes the finding block-capable; the row's Enforce switch still gates the actual block.
{
"presidio_analyzer_api_base": "http://presidio-analyzer:3000",
"presidio_anonymizer_api_base": "http://presidio-anonymizer:3000",
"output_parse_pii": true,
"entity_actions": {"CREDIT_CARD": "block", "PHONE_NUMBER": "redact"}
}Expect benign findings in log mode. Presidio's NER recognizes dates,
times and locations in ordinary prose — "let's meet yesterday's notes" can
produce a DATE_TIME finding. Review the events log for a few days and map
noisy entity types to ignore before enforcing. Also note the analyzer skips
known-invalid SSNs (including the famous 078-05-1120 example), so use a
valid-format SSN when testing.