---
title: Chatbot PII Masking: How It Works
slug: intelligent-chat-agent/chatbot-pii-masking-how-it-works
createdAt: 2026-12-02T07:24:16.589Z
---

#

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).





![](https://api.archbee.com/api/optimize/SK2urIgCC2ml99YyqWOSl/KZQ5vaV5v8q7AF1JqbylM_upload.png)

![]()

## 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]&#x7B;3}\[pP]\[a-zA-Z]\[1-9]\[0-9]&#x7B;3}\[a-zA-Z] | ABCPE1234F        |
| 2     | Email                                                       | \[\w.+-]+@\[\w-]+\\.\[\w\.-]+                                | ravi.k\@gmail.com |
| 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&#x7B;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.



