Chatbot PII Masking: How It Works
The chatbot finds personal data with fixed text patterns (regex) and replaces it with ****** before saving. It is on by default for every bot. The chatbot still reads the customer's real message so it can answer, but what is saved is masked.
What gets masked
- Conversation history: the customer's messages and the chatbot's replies, on every channel (web, app, WhatsApp, voice).
- API logs: the request and response of any API the chatbot calls during a flow.
- Chat window: the customer's own message is shown with X characters in place of the personal data. The chatbot still receives the original text.
- Answers collected in a flow (for example a policy number) are encrypted, not pattern-masked. They are cleared after 20 minutes of inactivity by default (you can set 1–20 minutes).

How it finds personal data
Detection is regex only, with no AI and no name or address detection. The nine rules run in this order on every message:
# | Finds | Pattern (regex) | Example |
|---|---|---|---|
1 | PAN | [a-zA-Z]{3}[pP][a-zA-Z][1-9][0-9]{3}[a-zA-Z] | ABCPE1234F |
2 | [\w.+-]+@[\w-]+\.[\w.-]+ | ||
3 | Date dd/mm/yyyy | \d{1,2}/\d{1,2}/\d{2,4} | 12/05/1990 |
4 | Date dd-mm-yy | \d{1,2}-\d{1,2}-\d{2} | 12-05-90 |
5 | Date dd Month yyyy | \d{1,2} [ADFJMNOS]\w* \d{2,4} | 12 May 1990 |
6 | Date Month dd yyyy | [ADFJMNOS]\w* \d{1,2} \d{2,4} | May 12 1990 |
7 | Mobile, account, Aadhaar (10–12 digits) | \b[0-9]{10,12}\b | 9876543210 |
8 | Short numbers such as age or house number | \b[0-9]{1,3}\b | 34 |
9 | Any word containing a digit (IDs, policy and order numbers) | \b[A-Za-z0-9]*\d[A-Za-z0-9]*\b | POL5521, 1234 |
Rules 1-6 first replace the value with a one-way SHA-256 hash, and rule 9 then turns that hash into ****** too. So every match is saved as ******, and the original cannot be recovered. The chat window uses the same rules but shows X for each character.
Example: "My PAN is ABCPE1234F, DOB 12/05/1990, phone 9876543210" is saved as "My PAN is ******, DOB ******, phone ******".
Masking with AI (LLM) features
Masking protects what is saved. What is sent to the AI model differs by feature:
AI feature | Sent to the AI model | Masked before sending? | Saved in history |
|---|---|---|---|
Bot Mandate (AI-built bots) | Customer's message | No | Masked: message and AI reply |
ExoMind (answers from your documents) | Customer's question | No | Masked: question and AI answer |
Smart Flow Assist (checks answers in a flow) | Current answer + earlier chat | Earlier chat: always masked, even with masking off. Current answer: no | Masked |
GenAI Orchestrator (AI intent routing) | Customer's message + recent chat | No | Not masked, in a temporary session cache |
AI chat summary (handoff to a live agent) | Chatbot chat + live agent chat | Chatbot part: yes. Live agent part: no | Masked |
AI intent descriptions (bot builder) | Intent names and training text you wrote | No customer data is sent | Not Applicable |
"Masked" in the last column applies when masking is on for the bot, which is the default.
Good to know
- Names and addresses are not detected. Only the nine patterns above are masked.
- Some harmless numbers are masked too, such as "2 items" or an order quantity.
- New messages only. Turning masking on does not mask chats saved earlier.
- Turning masking on and off needs approval: a one-time code is emailed to designated approvers or can be done by requesting it from the Chatbot support team.