Detect personal data
Find personal data in text (emails, phone, card and ID numbers, IBANs, IP addresses; with a model also names and addresses) and give a masked copy. Patterns work without a model; numbers with a check digit must pass it.
Command in the Generative AI toolkit · id ooa.genai/detect_pii · 13 inputs (1 required), 5 outputs
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Text | String | Yes | Text to check, e.g. an email body or a document's text. | |
| Kinds | List | No | Only these kinds: email, phone, credit_card, iban, ip_address, us_ssn, in_pan, in_aadhaar, person_name, address (the last two need use_ai). Every kind when empty (names and addresses only with use_ai). | |
| Use AI | Boolean | No | false | Also ask the model for people's names and postal addresses; the patterns still find the rest without it. |
| Mask char | String | No | * | The one character that replaces masked characters. |
| Mask style | String | No | partial | partial keeps a little so values can be told apart (j***@acme.com, last 4 digits of numbers); full masks every character. |
| Provider | String | No | openai | Who runs the model: OpenAI, Azure OpenAI, Anthropic, OpenAI-compatible (LiteLLM, vLLM, Ollama), Hugging Face (its router or your own TGI server), AWS SageMaker (a model on an Amazon SageMaker endpoint), AWS Bedrock or Google Vertex AI (Gemini). |
| Connection | String | No | Name of a Model Connection (provider, model and key managed in one place). Leave empty to set them on this action. | |
| Model | String | No | Model name; the deployment name for Azure OpenAI; the endpoint name for AWS SageMaker; the model or inference profile id for AWS Bedrock. | |
| API key | Credential | No | API key or access token from the vault (not needed for some self-hosted endpoints). For AWS Bedrock and AWS SageMaker: the AWS secret access key (or ACCESS_KEY_ID:SECRET). For Google Vertex AI: a service-account JSON key or an access token. | |
| Endpoint address | String | No | Endpoint; required for Azure OpenAI, Vertex AI (https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/REGION) and self-hosted models (for a TGI server, e.g. http://tgi-host:8080/v1). | |
| Hide personal data | Boolean | No | true | Replace emails, phone and card numbers, IBANs and similar before sending; restored in the answer. Only used with use_ai; the model then sees the patterns' finds as placeholders. |
| AWS access key ID | Credential | No | AWS Bedrock and AWS SageMaker only: AWS access key id from the vault (api_key then holds the secret access key). | |
| AWS region | String | No | AWS Bedrock and AWS SageMaker only: AWS region, e.g. eu-west-1. |
Outputs
| Output | Type | What it is |
|---|---|---|
| found | Boolean | True when any personal data was found. |
| count | Number | How many pieces were found. |
| items | List | Each piece as {kind, text, start, end}, in text order and never overlapping; start counts from 0 and end is just past the last character. |
| masked_text | String | The text with every piece found masked. |
| kinds_found | List | Each kind found, once, e.g. ["email", "phone"]. |