Skip to content

AI: Anonymize text (GDPR)

This service task detects and replaces personally identifiable information (PII) in a text with consistent placeholders. The mapping between original values and placeholders is returned as a replacement list and can be used for later de-anonymization.

Technical name: prio_aiAnonymize


Input

Field Type Required Description
text String Yes The text to anonymize.
entitiesToMask String[] No Restrict to specific entity types. If omitted, all supported types are masked.

Supported entity types

Type Description
name Person names
email Email addresses
phone Phone numbers
address Physical addresses
iban IBANs / bank accounts
date Dates of birth etc.
company Company names
id_number Tax IDs, passport numbers

Input example

{
  "text": "Mr. Max Müller, residing at Musterstr. 12, 80331 Munich, reachable at max.mueller@gmail.com and +49 171 1234567.",
  "entitiesToMask": ["name", "email", "phone", "address"]
}

Output

Field Type Description
anonymizedText String The full text with PII replaced by placeholders.
replacements Object[] List of replacements with original, replacement, and type.

Output example

{
  "anonymizedText": "[NAME_1], residing at [ADDRESS_1], reachable at [EMAIL_1] and [PHONE_1].",
  "replacements": [
    { "original": "Mr. Max Müller", "replacement": "[NAME_1]", "type": "name" },
    { "original": "Musterstr. 12, 80331 Munich", "replacement": "[ADDRESS_1]", "type": "address" },
    { "original": "max.mueller@gmail.com", "replacement": "[EMAIL_1]", "type": "email" },
    { "original": "+49 171 1234567", "replacement": "[PHONE_1]", "type": "phone" }
  ]
}

Notes

  • If the same entity appears multiple times in the text, the same placeholder is used consistently.
  • The replacement list enables later de-anonymization, e.g. when sending to authorized recipients.
  • If entitiesToMask is not specified, all supported PII types are masked.
  • The service makes up to three attempts to produce a valid anonymization.