Supported PII Types
| PII Type | Pattern | Redacted As |
|---|---|---|
email | Email addresses | [EMAIL_REDACTED] |
phone | Phone numbers (international formats) | [PHONE_REDACTED] |
ssn | US Social Security Numbers | [SSN_REDACTED] |
credit_card | Credit/debit card numbers (Luhn-validated) | [CREDIT_CARD_REDACTED] |
ip_address | IPv4 and IPv6 addresses | [IP_REDACTED] |
passport | Passport numbers (common formats) | [PASSPORT_REDACTED] |
iban | International Bank Account Numbers | [IBAN_REDACTED] |
date_of_birth | Date of birth patterns | [DOB_REDACTED] |
Three Modes
| Mode | Behavior | HTTP Status |
|---|---|---|
block | Reject the entire response if any PII is found | 403 |
redact | Replace PII with placeholder tokens and return the modified response | 200 |
allow | Pass the response through unchanged, but log PII occurrences | 200 |
Configure via Policy
Create apii_filter policy to enable PII detection:
Mode Examples
Block Mode
Block any response containing PII. The agent receives a403:
Redact Mode
PII is replaced inline before the response reaches the agent: Original LLM response:Please contact John at john.doe@example.com or call 555-123-4567.After redaction:
Please contact John at [EMAIL_REDACTED] or call [PHONE_REDACTED].
Allow Mode
The response passes through unchanged. PII occurrences are logged in the audit trail for review:Selective PII Types
You control exactly which PII types to scan for. Only the types listed inpii_types are checked — unlisted types are ignored:
Audit Trail
Every PII detection event is logged:| Event Type | Description |
|---|---|
pii.detected | PII found in response (includes types found, mode, and action taken) |
policy.violated | Response blocked due to PII (block mode only) |
Enforcement Architecture
- Scan path: Proxy scans LLM response body after receiving it from the provider, before returning to the agent.
- Latency: PII scanning adds < 5ms overhead per response.
- Streaming: For streaming responses, PII detection runs on buffered chunks.
- Fail-open: If the scanner errors, the response proceeds unchanged (logged as a warning).

