---
schema_version: "1"
id: 88bdc8164fc72d1268652b42cd6c5888792b1dde4a38491312510be6d1d42d17
title: Block Sensitive Data in Chats
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/live_agent_block_sensitive_data.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.live_agent_block_sensitive_data.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: e5de8d2e1dd04829d2c51c6c5beea54bae005be27df4ece68d7704ebf1c64cda
description: 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.
products:
  - Service Cloud
release: "264"
---
# 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

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=service.legacy_editions.htm&amp;language=en_US" target="_blank">View supported editions</a>.</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d31193e56">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d31193e56 ">To create sensitive data rules:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d31193e56 ">Customize Application</td>

          </tr>
        </tbody>
      </table>

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_legacy-264-0-0-production-enus/081af4ec-6c06-4d4b-9443-cb3516bbc46d/images/icon_important.png)

Important

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](https://help.salesforce.com/s/articleView?id=service.miaw_replacing_chat_considerations.htm&language=en_US) plus asynchronous conversations that can be picked back up at any time. Learn about migrating in [Help](https://help.salesforce.com/s/articleView?id=service.miaw_replacing_chat_considerations.htm&type=5&language=en_US) and [Trailhead](https://trailhead.salesforce.com/content/learn/modules/migrating-from-legacy-chat-to-enhanced-chat).

1. In Setup, enter Sensitive Data in the Quick Find box, then select **Sensitive Data Rules**.
2. Click **New** or **New Sensitive Data Rule**.
3. Write each pattern as a JavaScript regular expression (regex), and choose your preferred settings. The regex is case-sensitive.
4. Optionally, test your pattern.
    1. Enter some text in the format of the data you want to block, such as 123-45-6789 for a Social Security number.
    2. Preview your results to ensure that the rule is working correctly.
5. Select the roles for which you want to enforce this rule.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_legacy-264-0-0-production-enus/081af4ec-6c06-4d4b-9443-cb3516bbc46d/images/icon_note.png)
    
    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.
6. Set a priority for the rule. Lower numbers are executed first.
7. 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)

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_legacy-264-0-0-production-enus/081af4ec-6c06-4d4b-9443-cb3516bbc46d/images/icon_note.png)

Note Sensitive data is visible while someone’s typing, but it is masked when the person sends it. So if you want to mask customer information from agents, we recommend disabling Agent Sneak Peek (under **Setup** | **Customize** | **Chat** | **Chat Configurations**).

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.