mask_text
Replace personally identifiable information in text with opaque tokens before sending to a cloud LLM. Retains a session ID to restore original values.
Instructions
Pseudonymize sensitive entities in text before sending to a cloud LLM.
Replaces PESEL numbers, phone numbers, IBANs, and email addresses via regex, and person names and organization names via local Ollama NER — with opaque tokens like [PESEL:1], [PERSON:2], [ORG:1].
Returns the masked text plus a session_id. Store the session_id to restore the original values later using unmask_text.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text to pseudonymize | |
| session_id | No | Optional: reuse an existing session to preserve token numbering across multiple calls | |
| wait_for_ner | No | If true, wait up to 30 s for Ollama to finish loading the model before processing (default: false) | |
| custom_literals | No | Specific strings to always redact (names, IDs, phone numbers) |