Skip to main content

Blog

Does Agentforce Mask PII Out of the Box? What Einstein Trust Layer Does and Doesn't Cover

No. Salesforce documents that Einstein Trust Layer data masking is disabled for agents. Here is what the Trust Layer masks, for which features and languages, what protects agent prompts instead, and why a Full Copy sandbox used for agent testing still holds real customer data.

Data MaskingSalesforce SecuritySalesforceSandboxData Privacy
Saurabh Gupta, Cloud Compliance10 min read

No: Salesforce's current documentation states that "In Einstein Trust Layer, pattern-based and field-based data masking for large language models (LLMs) is disabled for agents", so Agentforce agent prompts rely on zero data retention, permission-based grounding and audit logging instead. Masking, which is on by default and detects names, company names, emails, phone numbers, credit cards, IBANs, passport numbers and three US identifiers, applies only to embedded generative AI features such as Einstein Service Replies and to prompt templates used outside an agent; even there it changes only the prompt sent to the model, not the personal data stored in your org or copied into Full and Partial Copy sandboxes.

This post answers that one question precisely: what the Einstein Trust Layer masks, where, and where it stops. Each section is labelled what Salesforce documents, what we recommend or what our product does.

On names: as of 17 November 2026, Salesforce Help still calls it the Einstein Trust Layer, and the feature Large Language Model Data Masking. Most pages now say Data 360 where they said Data Cloud, though some pages and permission sets keep the old name ("Data Cloud Architect (formerly the Data Cloud Admin)"). Einstein Studio is now AI Models.

The short answer

Trust Layer controlWhat it doesApplies to Agentforce agents?DefaultSource
Pattern-based data maskingDetects names, company names, emails, phone numbers, credit cards, IBANs, passport numbers and three US identifiers in prompt text and replaces them with placeholdersNo: "disabled for agents"On for embedded features; "the most commonly used entries are turned on"Large Language Model Data Masking; Select What Data To Mask
Field-based data maskingMasks merge fields tagged with Shield Platform Encryption, compliance categories or data sensitivity levelsNo: "disabled for agents"You turn it on and classify the fieldsSelect What Data To Mask
Zero data retentionThird-party LLM providers do not retain your data or train on itYesContractualEinstein Trust Layer; Select Agentforce Model Option
Secure data retrievalGrounds prompts only with data the executing user can accessYes: agents respect permissions, field-level security and sharingAlwaysEinstein Trust Layer: Designed for Trust; Trust and Agentforce
Prompt Defense and toxicity detectionSystem policies, prompt injection detection, toxicity scoresYesVaries by featureContent Safety and Security; Trust and Agentforce
Audit trailLogs prompts, responses and trust signals in Data 360Yes, once data collection is onOff until you turn on collectionAbout Generative AI Audit and Feedback Data
Records stored in your org and sandbox copiesNot coveredn/an/aDesigned for Trust: capabilities "apply only to generative AI and Agentforce features"

What Salesforce documents: masking is off for agents

The same sentence appears on the masking, setup, architecture, response journey and considerations pages: "Data masking for LLMs is disabled for agents." The explanation is on Data Masking Limitations in Agentforce, which some pages link to as "Data Masking and Agents".

The reason given on Trust and Agentforce is that "Data masking through the Einstein Trust Layer is disabled to improve the performance and accuracy of agents." The limitations page's example: if an agent is asked for accounts similar to a reference account, and the reference account is masked, the model "doesn't have the contextual information needed to identify accounts with similar characteristics."

Three details matter for architects:

  • A prompt template behaves differently depending on what calls it. "When a prompt template is called through an agent action, data masking is disabled. When a prompt template is used directly, for example, in service replies, data masking is applied based on the configuration in the Einstein Trust Layer."
  • A Salesforce-hosted model does not switch masking back on. With an LLM inside the Salesforce trust boundary, such as Anthropic Claude, "the data doesn't leave the Salesforce trust boundary", but "Data masking remains disabled for agents in this case".
  • Masking is not universal outside agents either. "LLM Data Masking isn't always available in all features. Refer to the feature documentation for more information."

What Salesforce documents: what masking detects where it runs

Pattern-based masking uses regex, context words and machine learning models across all text in the prompt, including free text. Field-based masking uses field metadata: merge fields tagged with Shield Platform Encryption, compliance categories or data sensitivity levels.

The Region and Language Support page lists the pattern-based types supported in English, French, German, Italian, Japanese and Spanish: company name, credit card, email address, IBAN code, name, passport and phone number. Passport and phone formats are country-specific (English covers US and UK passport formats). Three more are "supported in English (United States) only": US driver's licence, US Individual Taxpayer Identification Number and US Social Security number. Field-based masking "supports all Salesforce languages."

That is the whole list. It contains no postal addresses, dates of birth, health identifiers or non-US national identifiers; for embedded features, those are caught only if they sit in fields you have classified.

Salesforce is plain about accuracy: "no model can guarantee 100% accuracy", "Unusual names or names in non-English formats aren't always detected reliably", and "When masking fails to detect a value, the unmasked data is included in the prompt sent to the large language model (LLM)." Its advice: "For high masking accuracy, use field-based masking instead." Field-based masking applies only to merge fields that reference record fields and related lists.

Defaults. "Data Masking is enabled by default", but not every entity: "At initial setup, the most commonly used entries are turned on, and less frequently used entries are off." Field-based masking depends on your classification; Salesforce says to "Confirm that the sensitive fields that must be masked are tagged with the correct compliance categories and data sensitivity levels in Object Manager."

Demasking. After the model responds, "the Einstein Trust Layer demasks the data that was originally masked. The response you see contains the actual data." Masking protects the trip to the model, not what the user sees.

What Salesforce documents: what protects an agent's prompts instead

With masking off, personal data in an agent's prompt reaches the model as is. Salesforce relies on other controls:

  • Zero data retention. "All data accessed by agents, including personally identifiable information (PII), is protected in transit and isn't stored or used for training purposes by external LLM providers". The Agentforce model page names "OpenAI, Anthropic, and Google" as partners under the policy.
  • Model choice. Salesforce Default uses GPT-4.1 (new Agentforce Builder) or GPT-4o (legacy builder). AWS-Hosted runs Anthropic Claude Haiku 4.5 on Salesforce's Amazon Bedrock instance, where "All LLM traffic remains within the Salesforce virtual private cloud (VPC)". Google Gemini uses Gemini 3.5 Flash on Vertex AI.
  • Region. Geo-aware routing applies to AI agents, but by default a failed in-region request is re-routed "to another region to avoid returning an error". "Enable In-Region Model Requests Only" stops that for Anthropic and GPT models.

Zero data retention covers the model provider, not everything. Trust and Agentforce adds: "Customers' use of other features including agents may result in data storage." Once collection is on, the audit trail stores "Hydrated prompt text" and "Final PII-unmasked response text" in Data 360, and "audit and feedback data are stored by Salesforce for 30 days for compliance purposes." Redacting PII in Agentforce session logs uses Data 360 Dynamic Data Masking, which needs its own licence, is "off by default", is "a beta service" for this use, and only masks at query time: "The stored value doesn't change."

What Salesforce documents: access is the control doing the work

Without masking, what an agent can put in a prompt is whatever it can read. The prompt is grounded "only with data that the executing user has access to", and agents "respect standard Salesforce access controls such as licenses, permissions, field-level security, and sharing settings".

The executing user is not always a person. A Service agent talking to an unidentified, or verified but not logged-in, customer runs as a dedicated agent user (EinsteinServiceAgent User). Salesforce warns that "if the agent has access to data it doesn't need, the agent can expose proprietary information to customers." Custom actions inherit their components' access: "Access to a custom action depends on the Apex class, flow, or prompt template the action references." For agents, field-level security and sharing are not a backstop behind the Trust Layer. They are the main control.

What the Trust Layer doesn't touch: your org and your sandboxes

Salesforce says "Einstein Trust Layer capabilities apply only to generative AI and Agentforce features." Its controls act on prompts, responses and logs. Our reading: no Trust Layer setting changes the records stored in your org, or the copies of them in a sandbox.

Salesforce documents what each sandbox copies. A Full sandbox is "a replica of your production org, including all data, such as object records and attachments, and metadata." A Partial Copy sandbox includes "a sample of your production org's data as defined by a sandbox template." Developer and Developer Pro sandboxes copy "Metadata only".

Salesforce expects AI to be tested in sandboxes: "Be sure to test and verify AI-enabled functionality in a sandbox org before you deploy it into production", with Agentforce Agents and the Agentforce Testing Center among the components listed. Agentforce Data Library "is supported in all the sandbox types", and Salesforce's sandbox steps end in Agent Builder, where "you can query the agent and test how data from your libraries appears in large language model (LLM) responses." Agentforce DX moves agent metadata "between your DX project and your scratch orgs, sandboxes, and production orgs."

The Trust Layer "is included in the sandbox staging environments", and its masking is still "disabled for agents" there. (Data 360 sandboxes "contain only metadata", even in Full and Partial Copy sandboxes.)

Put those documented facts together: an agent tested in a Full or Partial Copy sandbox grounds its prompts on real production records, nothing in the Trust Layer masks them for agents, and anyone with access to that sandbox can read the same records directly.

What we recommend

Our recommendations, not Salesforce's:

  1. Do not plan around Trust Layer masking for agents. Record in your DPIA or risk register that agent prompts are unmasked, and what protects them instead: zero data retention, model and region settings, and access controls.
  2. Shrink agent access first. Give the agent user, and the running users of custom actions, only the objects and fields each job needs. Test with the agent's real permissions, not an admin's.
  3. Decide where audit data goes. If you turn on audit and feedback collection, prompts containing personal data are stored in Data 360. Set access and retention before go-live.
  4. Classify fields anyway. Field-based masking still protects embedded features, and the same classification work drives sandbox masking. Personal Data Discovery can build the inventory.
  5. Mask sandboxes before agent testing starts. If agents are built, tested or demonstrated in a Full or Partial Copy sandbox, mask it after every refresh. If you relied on Salesforce's Data Mask package, read our note on its end of service.

What our product does

Sandbox DataMasker masks personal data in non-production Salesforce environments. It is "designed for non-production environments only" and does not mask production. Our product page states:

  • "A sandbox create, refresh, or CI/CD post-deployment hook triggers DataMasker automatically."
  • "Sensitive data (names, SSNs, emails, financials) is replaced with realistic substitute values", with "realistic name generation, email substitution, phone masking, address masking, date offset, numeric range masking, picklist substitution, and regex pattern masking."
  • Custom objects are covered ("all custom objects and fields are available in profile configuration"), and grouping and sequencing ensure "consistent propagation of changes across related records."
  • It "mutes Salesforce automations during masking", and "External system callouts are also suppressed."
  • It runs as Apex in your org: "No outbound calls. No external data storage."
  • It "Supports all sandbox types (Developer, Developer Pro, Partial Copy, Full Copy) and scratch orgs."

DataMasker does not change Trust Layer behaviour or mask production prompts. It makes sure the records an agent reads in a test sandbox are not real people's data.

See Sandbox DataMasker for how it works, or book a demo to watch a masking run in a sandbox.

Sources

  • Salesforce Help, Einstein Trust Layer (read 17 November 2026)
  • Salesforce Help, Einstein Trust Layer: Designed for Trust (read 17 November 2026)
  • Salesforce Help, Einstein Trust Layer: Response Journey (read 17 November 2026)
  • Salesforce Help, Data Masking Limitations in Agentforce (read 17 November 2026)
  • Salesforce Help, Trust and Agentforce (read 17 November 2026)
  • Salesforce Help, Large Language Model Data Masking (read 17 November 2026)
  • Salesforce Help, Select What Data To Mask (read 17 November 2026)
  • Salesforce Help, LLM Data Masking Considerations and Limitations (read 17 November 2026)
  • Salesforce Help, Set up Einstein Trust Layer (read 17 November 2026)
  • Salesforce Help, Einstein Trust Layer Region and Language Support (read 17 November 2026)
  • Salesforce Help, Einstein Trust Layer Limits (read 17 November 2026)
  • Salesforce Help, Content Safety and Security (read 17 November 2026)
  • Salesforce Help, Select Agentforce Model Option (read 17 November 2026)
  • Salesforce Help, Geo-Aware LLM Request Routing on the Einstein Generative AI Platform (read 17 November 2026)
  • Salesforce Help, About Generative AI Audit and Feedback Data (read 17 November 2026)
  • Salesforce Help, Mask Protected Data in Agentforce Session Logs (Beta) (read 17 November 2026)
  • Salesforce Help, Configure Service Agent Access (read 17 November 2026)
  • Salesforce Help, Manage Model Provider Access (read 17 November 2026)
  • Salesforce Help, Sandbox Types and Templates (read 17 November 2026)
  • Salesforce Help, Sandbox Licenses and Storage Limits by Type (read 17 November 2026)
  • Salesforce Help, Test Data Libraries in a Sandbox (read 17 November 2026)
  • Salesforce Developers, Agentforce Developer Guide: Build Agents with Agentforce DX (read 17 November 2026)
  • Cloud Compliance, Sandbox DataMasker product page (read 17 November 2026)

Frequently Asked Questions

Learn More About Cloud Compliance

Explore our native Salesforce data privacy products.