PII Filter
Detect and redact personally identifiable information in LLM message content.
Detect and redact personally identifiable information in LLM message content.
The pii_filter guard scans the chat context for Personally Identifiable
Information (PII) such as email addresses, phone numbers, SSNs, and credit card
numbers.
When PII is found, it is replaced with a masked value like <protected:email>
before being sent to the LLM.
You can configure which types of PII to filter by passing an optional pii_types
list containing values like "email", "phone", "ssn", or "creditcard".
If pii_types is omitted, all available PII detectors will run.
Configuration
Section titled “Configuration”| Field | Type | Default | Description |
|---|---|---|---|
pii_types | `array | null` | None |
Examples
Section titled “Examples”# Example 1type: pii_filterconfig: pii_types: - email - phone# Example 2type: pii_filterconfig: {}