Skip to content

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.

FieldTypeDefaultDescription
pii_types`arraynull`None
# Example 1
type: pii_filter
config:
pii_types:
- email
- phone
# Example 2
type: pii_filter
config:
{}