Skip to main content

What is PII Policy?

PII policies detect and protect personal identifiable information including emails, phone numbers, SSN, addresses, credit cards, driver’s licenses, passports, IP addresses, and other sensitive personal data.

Why its Important?

PII policies are critical for protecting personal identifiable information and ensuring compliance with privacy regulations. These policies prevent sensitive personal data from being sent to LLMs, which helps maintain user privacy, prevent identity theft, and comply with data protection laws.
  • Prevents sending PII to LLM: Blocks emails, addresses, SSN, and other personal data from being processed by language models
  • Protects against identity theft: Prevents sensitive personal information from being exposed or used maliciously
  • Ensures privacy compliance: Helps maintain compliance with GDPR, CCPA, and other data protection regulations

Anonymize (Unique Random Placeholders)

PIIAnonymizePolicy replaces detected PII with unique random placeholders. The original values are restored in the agent’s response — the LLM never sees real data, but you get fully functional results:

Streaming with Anonymize

Anonymized content is de-anonymized token-by-token in real-time during streaming:

Async with Anonymize

Replace (Fixed Placeholder)

PIIReplacePolicy replaces detected PII with a fixed [PII_REDACTED] placeholder. Unlike anonymize, all detected values share the same placeholder — but original values are still restored in the final response:

Policy Scope

Control which parts of the input are sanitized:

With Tools

PII policies also protect sensitive data in tool interactions:

Available Variants

  • PIIBlockPolicy: Blocks any content with PII
  • PIIBlockPolicy_LLM: LLM-powered block messages
  • PIIBlockPolicy_LLM_Finder: LLM detection for better accuracy
  • PIIAnonymizePolicy: Anonymizes PII with unique random replacements
  • PIIReplacePolicy: Replaces PII with [PII_REDACTED] (fixed placeholder)
  • PIIRaiseExceptionPolicy: Raises DisallowedOperation exception
  • PIIRaiseExceptionPolicy_LLM: LLM-generated exception messages