Redact / pseudonymise text (legacy — exposes token map)
redactReplaces sensitive identifiers in text with labelled tokens and returns the token map so clients can restore original values.
Instructions
LEGACY: like protect, but returns the token_map (token -> original value) in the response, which places the reversal key in the client and potentially the model context. Kept for backward compatibility and client-managed workflows. Prefer protect, which keeps the mapping server-side.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text to redact. | |
| categories | No | Which pattern sets to apply. Defaults to clinical + general. 'clinical' = NHS/NI/DOB/MRN/postcode/SSN/ZIP/email/phone/names; 'general' = URLs, IPs, payment cards, IBANs, account numbers, vehicle regs; 'safeharbor' = strictest, HIPAA Safe Harbor — implies clinical + general and also removes ALL dates (not just DOB), ages, fax, licence, device-serial, VIN and health-plan numbers. |