Detect and mask personal data (PII)
detect_piiScan text for personal data such as emails, phone numbers, IDs, and addresses, and get a masked copy with entities redacted. Prevent PII leaks before logging or sharing content.
Instructions
Find personally identifiable information in text — emails, phone numbers, government IDs, IBANs/card numbers, addresses, names — and optionally return a masked copy with each entity redacted. Use this before logging, storing, sending text to a third party, or including user-supplied content in a response. Returns found (boolean), the list of PII entities (type, severity, description) and, when mask is true, maskedText that is safe to pass on. Prefer the masked text over the original whenever PII is present.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mask | No | When true (default), also return `maskedText` with every detected entity redacted. | |
| text | Yes | The text to scan for personal data. |