Built-in patterns
| Pattern | Example | Redacted to |
|---|---|---|
| Email address | alice@example.com | [EMAIL] |
| Phone number | +1 (555) 867-5309 | [PHONE] |
| US Social Security Number | 123-45-6789 | [SSN] |
| Credit card number | 4111 1111 1111 1111 | [CREDIT_CARD] |
| IPv4 address | 192.168.1.1 | [IP_ADDRESS] |
Custom patterns
Add your own regex patterns in the policy config:Audit logging
Every redaction event is logged to ClickHouse:Scope
PII redaction runs on:- The
contentfield of all user and assistant messages systemprompt content- Tool results
- Response bodies from the provider (your own model output)
- Metadata fields (model, max_tokens, etc.)
Enabling redaction
Attach apii_redaction policy to a key or to the tenant (for org-wide enforcement):