Documentation Index
Fetch the complete documentation index at: https://docs.xhipai.com/llms.txt
Use this file to discover all available pages before exploring further.
PII Anonymization
ThePiiGuard scrubs personally identifiable information from messages before they reach the LLM, preventing accidental PII exposure in model interactions.
Configuration
Built-in PII Types
| Type | Pattern |
|---|---|
email | Standard email addresses |
phone | US phone numbers (with optional country code) |
ssn | Social Security Numbers (XXX-XX-XXXX) |
creditCard | Credit card numbers (XXXX-XXXX-XXXX-XXXX) |
ipAddress | IPv4 addresses |
name | Two-word proper names (Capitalized) |
Actions
| Action | Example Input | Example Output |
|---|---|---|
placeholder | john@example.com | [EMAIL_1] |
redact | john@example.com | [REDACTED] |
hash | john@example.com | [HASH_a1b2c3d4] |
Integration
As a beforeLLMCall hook (scrubs every roundtrip)
As an Input Guardrail
Custom Patterns
Rehydration
Whenrehydrate: true, the guard maintains a mapping of placeholders to original values. Call guard.rehydrate(text) on the final output to restore PII before returning to the user.