Implementation: This guardrail is powered by Azure AI Language PII Detection and runs on TrueFoundry-managed infrastructure — no third-party API keys or setup required. For vendor-hosted PII services using your own credentials (Azure PII, Google Model Armor, and others) or self-hosted redaction (for example via Custom Guardrails), see Supported Guardrails and Guardrails Overview.PII/PHI Detection can be applied to all four guardrail hooks: LLM Input, LLM Output, MCP Pre Tool, and MCP Post Tool—providing comprehensive PII/PHI protection across your entire AI workflow.
What is PII Detection?
PII Detection is a built-in TrueFoundry guardrail that identifies and redacts personally identifiable information or protected health information from text content. It is powered by Azure AI Language PII Detection under the hood and understands context to detect PII/PHI with high accuracy even when the data doesn’t follow a strict format. The guardrail is fully managed by TrueFoundry — no external credentials or setup required.Key Features
- Context-Aware Detection: Detects PII/PHI with contextual understanding, providing higher accuracy and fewer false positives than simple pattern matching.
- Configurable Entity Categories: Select which types of PII/PHI to detect from a comprehensive set of entity categories from basic identifiers like names and emails to financial and identity document numbers.
- Automatic Redaction: Operates in mutate mode, detected PII/PHI is automatically redacted in the content, allowing the request to continue with sensitive data removed.
Adding PII/PHI Detection Guardrail
1
Navigate to Guardrails
Go to the AI Gateway dashboard and navigate to the Guardrails section.
2
Create or Select a Guardrails Group
Create a new guardrails group or select an existing one where you want to add the PII/PHI Detection guardrail.
3
Add PII Detection Integration
Click on Add Guardrail and select PII/PHI Detection from the TrueFoundry Guardrails section.

4
Configure the Guardrail
Fill in the configuration form:
- Name: Enter a unique name for this guardrail configuration (e.g.,
pii-detection) - PII Categories: Select the entity categories you want to detect or select all categories(Default).
- Enforcing Strategy: Choose how violations are handled

5
Save the Configuration
Click Save to add the guardrail to your group.
Configuration Options
PII Detection only supports mutate mode — it always redacts detected entities. See Guardrails Overview for details on Operation Modes and Enforcing Strategy.