---
schema_version: "1"
id: b452c94176801277845049279e5af891c9daa4696d0b873f7aa8cedc4cd049a7
title: LLM Data Masking Considerations and Limitations
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ai/264-0-0/generative_ai_trust_data_mask_considerations.md
canonical_url: https://help.salesforce.com/s/articleView?id=ai.generative_ai_trust_data_mask_considerations.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 54800be5de40af4742601b097c3df9d62690a50c24f23d36b1a804900261c663
description: Make sure you review these considerations and limitations before configuring large language model (LLM) data masking,
products:
  - Agentforce
  - Cross Cloud
release: "264"
---
# LLM Data Masking Considerations and Limitations

Make sure you review these considerations and limitations before configuring large language model (LLM) data masking,

### 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;">Available in: <strong>Enterprise</strong>, <strong>Performance</strong>, and <strong>Unlimited</strong> Editions with an Einstein for Sales, Einstein for Platform, Einstein for Service, Einstein 1 Service, or Einstein GPT Service add-on. To purchase add-ons, contact your Salesforce account executive.</td></tr></tbody></table>

## Limitations

- LLM Data Masking isn’t always available in all features. Refer to the feature documentation for more information.
- Data masking for LLMs is disabled for agents. See [Data Masking and Agents](https://help.salesforce.com/s/articleView?id=ai.agent_trust_data_masking.htm&release=264.0.0&type=5 "In Einstein Trust Layer, pattern-based and field-based data masking for large language models (LLMs) is disabled for agents."). For embedded generative AI features, such as [Einstein Service Replies](https://help.salesforce.com/s/articleView?id=service.reply_recs_generative_ai_service_replies.htm&type=5&language=en_US), [Einstein Work Summaries](https://help.salesforce.com/s/articleView?id=service.cc_generative_ai_work_summaries.htm&type=5&language=en_US) data masking is available, and you can configure it in Einstein Trust Layer setup.
- Pattern-Based Masking: Although our detection models have shown to be effective during internal testing, it's important to note that no model can guarantee 100% accuracy. In addition, cross-region and multi-country use cases can affect the ability to detect specific data patterns. With trust as our priority, we're dedicated to the ongoing evaluation and refinement of our models.
- Field-Based Masking: Field-based masking is supported in Prompt Builder and AI features that use prompt templates. Field-based masking can only be used only for merge fields in prompts that reference record fields and related lists.

## Considerations

Data masking can affect LLM prompt grounding. We recommend that you test any masking configurations to ensure high quality LLM responses. Use the audit trail to [verify masking behavior](https://help.salesforce.com/s/articleView?id=ai.generative_ai_audit_data_mask.htm&release=264.0.0&type=5 "After you have configured data masking to in the Einstein Trust Layer Setup, you'll want to verify that sensitive data is masked and also monitor it over time.").

Consider these differences when configuing pattern-based and field-based masking:

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d58620e116">pattern-based</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d58620e119">field-based</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="pattern-based" class="slds-cell-wrap" style="vertical-align:top;" headers="d58620e116 ">Automatic detection by Einstein Trust Layer based on pattern matching, context,
              or machine learning models.</td>

            <td data-label="field-based" class="slds-cell-wrap" style="vertical-align:top;" headers="d58620e119 ">Detection is based on Data Classification tags in Salesforce fields configured
              by you.</td>

          </tr>
          <tr class="">
            <td data-label="pattern-based" class="slds-cell-wrap" style="vertical-align:top;" headers="d58620e116 ">Applied to all text in the prompt, including unstructured inputs like freeform
              text, as well as merged information from Salesforce fields.</td>

            <td data-label="field-based" class="slds-cell-wrap" style="vertical-align:top;" headers="d58620e119 ">
              <p>Applied to only merge fields in prompt templates.</p>
              <p style="margin-bottom:0;">Supported data sources:
                Record fields and related lists.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="pattern-based" class="slds-cell-wrap" style="vertical-align:top;" headers="d58620e116 ">Supports only a discrete list of data types and languages.</td>

            <td data-label="field-based" class="slds-cell-wrap" style="vertical-align:top;" headers="d58620e119 ">Any field in Salesforce org can be classified and used for field
              masking.</td>

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

To make sure your data masking configuration is more comprehensive, apply data classification to Salesforce fields and turn on data masking in Einstein Trust Layer setup for the relevant classification types. Enabling pattern-based masking can be an additional layer of protection because it evaluates the entire text in the prompt for sensitive data.

Pattern-based masking relies on model inference and carries inherent accuracy trade-offs. Unusual names or names in non-English formats aren't always detected reliably and require additional validation or a different masking strategy. When masking fails to detect a value, the unmasked data is included in the prompt sent to the large language model (LLM). Before deploying masking in production, test with representative sample data that includes edge-case names relevant to your users. For high masking accuracy, use field-based masking instead. Field-based masking operates on structured data fields directly and is more reliable than pattern-based detection.