Detect and redact personally identifiable information (PII) — emails, phone numbers, names, addresses, card and account numbers, and more. Returns each detected span plus a fully redacted copy of the text. Optionally restrict to a caller-supplied set of PII types.
Detect and redact personally identifiable information in free text. Returns a decision flag, every detected span (typed, with a placeholder), and a fully redacted copy of the text — ready to log, store, or forward safely.
| Entrypoint | Renders | Inputs |
|---|---|---|
systemPrompt | Instructions, the PII taxonomy, optional type filter + embedded schema | optional piiTypes |
userPrompt | The delimited text to scan | text |
text (string, required) — the text to scan for PII.piiTypes (array of string, optional) — restrict detection to these types only, e.g. ["email","phone"]. Omit to detect every type.{
"contains_pii": true,
"entities": [
{ "text": "[email protected]", "occurrence": 1, "type": "email", "redacted_as": "[EMAIL]" },
{ "text": "(415) 555-0132", "occurrence": 1, "type": "phone", "redacted_as": "[PHONE]" }
],
"redacted_text": "Contact me at [EMAIL] or [PHONE]."
}
contains_pii comes first — a cheap boolean gate for routing or blocking before you read the details.redacted_text is the input with every span swapped for its placeholder ([EMAIL], [PHONE], numbered when repeated). Non-PII text is left byte-for-byte unchanged; it equals the input when nothing is found.occurrence convention as entity-extraction (no character offsets).This is an LLM-based detector — excellent recall on natural-language PII, but it is not a compliance guarantee. Don't treat contains_pii: false as proof a document is clean for GDPR/HIPAA purposes. For regulated pipelines, pair it with deterministic detectors (regex for card/SSN formats) and human review. redacted_text is a convenience, not a certified anonymization.
text so the scanned content is never HTML-escaped.redacted_text equals input when none found.enum on type, additionalProperties: false.Verified by local render with and without a piiTypes filter. Suggested default claude-sonnet-4-6 at temperature: 0.