anonymize_text
Scrub personally identifiable information such as IDs, emails, and phone numbers from text. Returns anonymized content and a replacement map.
Instructions
Scrub PII from text and return anonymized version + replacement map.
Replaces:
- Patient/case IDs → [PARTICIPANT_001]
- GPS coordinates → [GPS_001]
- Belgian national IDs → [NID_001]
- Email addresses → [EMAIL_001]
- Phone numbers → [PHONE_001]
- Name-like tokens (opt.) → [NAME_001]
Args:
content: Text to anonymize.
mode: 'full' — replace; 'preview' — mark without replacing.
replace_names: Also replace CAPITALIZED name-like tokens (heuristic).
Returns JSON with keys 'anonymized' (str) and 'replacements' (dict).Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | ||
| mode | No | full | |
| replace_names | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |