PII Redaction
Irreversibly mask Personally Identifiable Information in requests and LLM responses using the Infralo gateway.
PII Redaction detects Personally Identifiable Information (PII) in request messages and/or LLM responses and replaces each detected value with a [REDACTED:<TYPE>] placeholder. Masking is irreversible — the original values are never stored or recoverable.
Use this module when you need to ensure that sensitive data never reaches the LLM provider, or that LLM responses are sanitized before they are returned to your users.
Irreversible operation
Once masked, the original PII values cannot be recovered. If you need to restore PII in the LLM response (e.g., for downstream processing), use PII Tokenization + PII Restoration instead.
Stages
| Stage | Behavior |
|---|---|
| PRE | Redacts PII from user messages before the request is forwarded to the LLM |
| POST | Redacts PII from the LLM response before it is returned to the client |
| PRE + POST | Redacts in both directions |
Configuration
PII Entities to Detect
Select which PII entity types to scan for. If left empty, all supported entity types are detected.
Leave empty for maximum coverage
An empty selection activates detection for all available entity types. You only need to specify a list if you want to limit detection to specific types.
Global Entities
| Entity | Description |
|---|---|
PERSON | Full names and personal identifiers |
EMAIL_ADDRESS | Email addresses |
PHONE_NUMBER | Phone numbers (international formats) |
CREDIT_CARD | Credit card numbers |
CRYPTO | Bitcoin wallet addresses |
DATE_TIME | Date and time expressions |
IBAN_CODE | International Bank Account Numbers |
IP_ADDRESS | IPv4 and IPv6 addresses |
MAC_ADDRESS | Network hardware addresses |
NRP | Nationality, religion, political group references |
LOCATION | Physical addresses and location names |
MEDICAL_LICENSE | Medical license numbers |
URL | Web URLs |
ORGANIZATION | Company and organization names |
CREDENTIAL | Secrets, API keys, passwords |
Regional Entities
| Entity | Description |
|---|---|
ID_NIK | National Identity Card number |
ID_NPWP | Tax Identification Number |
ID_PASSPORT | Indonesian passport number |
ID_SIM | Driver's license number |
ID_PHONE | Indonesian phone number |
ID_PLATE | Vehicle license plate |
ID_BPJS | National health insurance number |
ID_KK | Family card number |
ID_ACCOUNT_NO | Bank account number |
ID_POSTAL_CODE | Indonesian postal code |
ID_ADDRESS | Indonesian street address |
| Entity | Description |
|---|---|
US_SSN | Social Security Number |
US_BANK_NUMBER | Bank account number |
US_PASSPORT | US passport number |
US_DRIVER_LICENSE | Driver's license number |
US_ITIN | Individual Taxpayer Identification Number |
US_MBI | Medicare Beneficiary Identifier |
US_NPI | National Provider Identifier |
| Entity | Description |
|---|---|
UK_NHS | NHS health service number |
UK_NINO | National Insurance Number |
UK_PASSPORT | UK passport number |
UK_POSTCODE | UK postcode |
UK_VEHICLE_REGISTRATION | Vehicle registration number |
| Entity | Description |
|---|---|
SG_NRIC_FIN | National Registration Identity Card / Foreign Identification Number |
SG_UEN | Unique Entity Number |
| Entity | Description |
|---|---|
AU_ABN | Australian Business Number |
AU_ACN | Australian Company Number |
AU_TFN | Tax File Number |
AU_MEDICARE | Medicare card number |
Detection Confidence Threshold
The minimum confidence score (0.0–1.0) required to treat a detected entity as PII.
| Value | Effect |
|---|---|
0.0 | All detections flagged, very high false-positive rate |
0.5 | Balanced sensitivity (default) |
1.0 | Only highest-confidence detections flagged |
Lower the threshold to be more aggressive; raise it to reduce false positives on ambiguous text.
Output Format
Detected PII is replaced with structured placeholders:
Original: "My name is John Smith and my email is john@example.com"
Redacted: "My name is [REDACTED:PERSON] and my email is [REDACTED:EMAIL_ADDRESS]"Example Use Cases
- Compliance: Ensure user-submitted PII never reaches an external LLM provider (GDPR, HIPAA).
- Output sanitization: Strip PII from LLM responses before displaying them in a UI or logging them.
- Audit trail: Redact both input and output so stored logs contain no personal data.