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

StageBehavior
PRERedacts PII from user messages before the request is forwarded to the LLM
POSTRedacts PII from the LLM response before it is returned to the client
PRE + POSTRedacts 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

EntityDescription
PERSONFull names and personal identifiers
EMAIL_ADDRESSEmail addresses
PHONE_NUMBERPhone numbers (international formats)
CREDIT_CARDCredit card numbers
CRYPTOBitcoin wallet addresses
DATE_TIMEDate and time expressions
IBAN_CODEInternational Bank Account Numbers
IP_ADDRESSIPv4 and IPv6 addresses
MAC_ADDRESSNetwork hardware addresses
NRPNationality, religion, political group references
LOCATIONPhysical addresses and location names
MEDICAL_LICENSEMedical license numbers
URLWeb URLs
ORGANIZATIONCompany and organization names
CREDENTIALSecrets, API keys, passwords

Regional Entities

EntityDescription
ID_NIKNational Identity Card number
ID_NPWPTax Identification Number
ID_PASSPORTIndonesian passport number
ID_SIMDriver's license number
ID_PHONEIndonesian phone number
ID_PLATEVehicle license plate
ID_BPJSNational health insurance number
ID_KKFamily card number
ID_ACCOUNT_NOBank account number
ID_POSTAL_CODEIndonesian postal code
ID_ADDRESSIndonesian street address
EntityDescription
US_SSNSocial Security Number
US_BANK_NUMBERBank account number
US_PASSPORTUS passport number
US_DRIVER_LICENSEDriver's license number
US_ITINIndividual Taxpayer Identification Number
US_MBIMedicare Beneficiary Identifier
US_NPINational Provider Identifier
EntityDescription
UK_NHSNHS health service number
UK_NINONational Insurance Number
UK_PASSPORTUK passport number
UK_POSTCODEUK postcode
UK_VEHICLE_REGISTRATIONVehicle registration number
EntityDescription
SG_NRIC_FINNational Registration Identity Card / Foreign Identification Number
SG_UENUnique Entity Number
EntityDescription
AU_ABNAustralian Business Number
AU_ACNAustralian Company Number
AU_TFNTax File Number
AU_MEDICAREMedicare card number

Detection Confidence Threshold

The minimum confidence score (0.0–1.0) required to treat a detected entity as PII.

ValueEffect
0.0All detections flagged, very high false-positive rate
0.5Balanced sensitivity (default)
1.0Only 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.

On this page