Automatically detects and redacts personally identifiable information (PII) from text in AI requests using configurable anonymization methods.Documentation Index
Fetch the complete documentation index at: https://docs.datawizz.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Text Redaction Plugin scans incoming AI requests for PII entities and redacts them before the request reaches the AI model. Unlike the Detection Plugin which blocks requests, this plugin allows requests to proceed with PII safely anonymized. It supports multiple redaction strategies and can apply different methods to different entity types.Supported PII Types
The plugin can redact 30+ entity types across multiple regions:Personal Information
PERSON- Person namesEMAIL_ADDRESS- Email addressesPHONE_NUMBER- Phone numbersDATE_TIME- Dates and timesLOCATION- Geographic locationsURL- Web addressesIP_ADDRESS- IP addresses
Financial
CREDIT_CARD- Credit card numbersCRYPTO- Cryptocurrency wallet addressesIBAN_CODE- International bank account numbers
United States
US_SSN- Social Security NumbersUS_DRIVER_LICENSE- Driver’s license numbersUS_PASSPORT- Passport numbersUS_BANK_NUMBER- Bank account numbersUS_ITIN- Individual Taxpayer Identification Numbers
International
UK_NHS- UK National Health Service numbersSG_NRIC_FIN- Singapore NRIC/FIN numbersAU_ABN,AU_ACN,AU_TFN,AU_MEDICARE- Australian identifiersIN_PAN,IN_AADHAAR,IN_VEHICLE_REGISTRATION- Indian identifiersES_NIF- Spanish tax identificationIT_FISCAL_CODE,IT_DRIVER_LICENSE,IT_VAT_CODE,IT_PASSPORT,IT_IDENTITY_CARD- Italian identifiers
Healthcare
MEDICAL_LICENSE- Medical license numbersNRP- Medical prescriber numbers
Anonymization Methods
The plugin supports five redaction strategies:replace
Substitutes PII with a fixed value.
- Parameters:
new_value(string) - Replacement text - Example:
[email protected]→<REDACTED>
redact
Completely removes PII from the text.
- Parameters: None
- Example:
My email is [email protected]→My email is
mask
Partially obscures PII by replacing characters.
- Parameters:
masking_char(string, default:"*") - Character to use for maskingchars_to_mask(number, default: 100) - Number of characters to maskfrom_end(boolean, default: false) - Mask from end instead of beginning
- Example:
555-123-4567→XXX-XXX-4567(masking first 7 chars with “X”)
hash
Applies one-way hashing (SHA-256) to PII.
- Parameters: None
- Example:
[email protected]→a3c7f1...(irreversible)
encrypt
Applies reversible encryption to PII.
- Parameters: Encryption key (configured in Presidio)
- Example:
[email protected]→bHj9K2...(reversible with key)
Configuration
Basic Settings
entities (optional, array of strings)
List of PII entity types to redact. If not specified, all detected entities are redacted.
language (string, default: "en")
Language code for text analysis (e.g., "en", "es", "de").
score_threshold (number, default: 0.5)
Minimum confidence score (0-1) required to redact an entity. Lower values catch more PII but may increase false positives.
Anonymization Configuration
default_anonymizer (object, default: { type: "replace", new_value: "<REDACTED>" })
Default anonymization method applied to all detected entities unless overridden.
Structure:
entity_anonymizers (optional, object)
Entity-specific anonymization methods that override the default. Keys are entity types.
Example:
Advanced Detection
allow_list (optional, array of strings)
Terms/patterns that should NOT be redacted, even if they match detection patterns.
deny_list (optional, array of strings)
Terms/patterns that should ALWAYS be redacted, regardless of detection confidence.
context (optional, array of strings)
Additional context words to improve detection accuracy.
Example Configurations
Basic Redaction
"Contact me at [email protected] or 555-123-4567"
Output: "Contact me at [REMOVED] or [REMOVED]"
Partial Masking
"Card: 4532-1234-5678-9010, Phone: 555-123-4567"
Output: "Card: ****-****-****-9010, Phone: XXX-XXX-4567"
Mixed Strategies
"John Smith's SSN is 123-45-6789, email: [email protected]"
Output: "<REDACTED>'s SSN is ***-**-6789, email: a3c7f1b2..."
Whitelisting
"Contact [email protected] or [email protected]"
Output: "Contact [email protected] or <EMAIL>"
Behavior
- Fail-open: If the plugin encounters an error, the original messages are returned unmodified
- Multi-message support: Processes all messages in the request independently
- Preserves structure: Maintains message format (text, arrays, multimodal content)
- Debug output: Returns detailed redaction information when enabled in Gateway UI
- No blocking: Always allows requests to proceed (unlike Detection Plugin)
Use Cases
- Privacy compliance: Ensure AI requests don’t expose customer PII to third-party models
- Audit logs: Redact sensitive data before logging requests for compliance
- Multi-tenant systems: Prevent cross-tenant data leakage in shared AI infrastructure
- Development/testing: Sanitize production data for use in development environments
- Selective visibility: Show last 4 digits of credit cards while masking the rest
Configuration Schema
Supported Phases
- Request Phase: Supports processing during the REQUEST phase
- Response Phase: Supports processing during the RESPONSE phase
- Log Phase: Supports processing during the LOG phase