You are here:
Block Sensitive Data in Chats
Sensitive data rules let you block specific patterns, such as credit card, Social Security, phone and account numbers, or even profanity. You can choose to remove the text or replace it with your preferred characters.
Required Editions
| View supported editions. |
| User Permissions Needed | |
|---|---|
| To create sensitive data rules: | Customize Application |
Legacy Chat will be retired on February 14, 2026. To avoid service interruptions to your end users, switch to enhanced Chat (formerly Messaging for In-App and Web). Enhanced Chat offers many of the legacy Chat features that you love plus asynchronous conversations that can be picked back up at any time. Learn about migrating in Help and Trailhead.
- In Setup, enter Sensitive Data in the Quick Find box, then select Sensitive Data Rules.
- Click New or New Sensitive Data Rule.
- Write each pattern as a JavaScript regular expression (regex), and choose your preferred settings. The regex is case-sensitive.
-
Optionally, test your pattern.
- Enter some text in the format of the data you want to block, such as 123-45-6789 for a Social Security number.
- Preview your results to ensure that the rule is working correctly.
-
Select the roles for which you want to enforce this rule.
Note Rules are enforced on the author. Therefore, if a "don’t show phone number" rule is enforced on the visitor, when visitors enter their phone numbers, agents and supervisors can’t see it. - Set a priority for the rule. Lower numbers are executed first.
- Click Save.
You can block the text from agents, supervisors, customers, or all of these. When a rule is triggered, it logs one or more of these chat transcript events:
- Sensitive data blocked (Agent)
- Sensitive data blocked (Supervisor)
- Sensitive data blocked (Visitor)
Sensitive data rules apply to the auto-greeting and any quick text that you have enabled. They don’t apply to the agent name or other standard text in the chat window.

