PII Detection

kiteguard scans for personally identifiable information (PII) across three interception points:

  • UserPromptSubmit — the user's own prompt
  • PostToolUse — content returned from files or web pages Claude reads
  • Stop — the final assistant response before delivery

Configuration

pii:
  enabled: true
  block_on_prompt: false   # redact from prompt, don't block
  block_on_response: true  # block if PII found in Claude's response
  types:
    - ssn
    - credit_card
    - email
    - phone_us
    - passport

Fields

FieldDefaultDescription
enabledtrueMaster toggle for all PII detection
block_on_promptfalseBlock (exit 2) when PII found in user prompt
block_on_responsetrueBlock response delivery when PII found in final response
typesallList of PII types to detect (omit a type to disable it)

Supported PII types

TypeExamplePattern description
ssn123-45-6789US Social Security Number (dashes or dots)
credit_card4111 1111 1111 1111Visa, Mastercard, Amex, Discover
emailalice@example.comStandard email address
phone_us(555) 867-5309US phone number (multiple formats)
passportA12345678US passport number

block_on_prompt vs block_on_response

SettingEffect
block_on_prompt: falsePII in the user's prompt is logged but not blocked. Claude processes it — useful when the user intentionally pastes data to process.
block_on_prompt: trueBlocks the request entirely. The user must remove PII before Claude sees it.
block_on_response: trueBlocks Claude's final reply if it contains PII — prevents Claude from echoing sensitive data back.

Notes

  • All regex patterns are anchored to word boundaries to reduce false positives.
  • Credit card detection uses a simplified Luhn-adjacent regex — it catches common formats but is not an authoritative validator.
  • Prompt text is never stored in the audit log, only its hash.