Sub topic 3
What the Einstein Trust Layer Is
Prerequisites
This chapter assumes you know the following:
- Salesforce objects, fields, and user permissions.
- What a large language model (LLM) and a prompt are.
- Common privacy terms such as PII (personally identifiable information) and data residency.
The previous chapters covered why LLMs create new data risks and where Agentforce agents send prompts. This chapter defines the Trust Layer itself. Later chapters take each control in turn.
The short definition
The Einstein Trust Layer is a set of controls between Salesforce data, Agentforce agents, and the LLMs that generate text. It is not one feature you switch on. It is a pipeline of protective steps that a prompt passes through on the way to a model and that the response passes through on the way back.
Its job is to let an agent use CRM data to give useful answers while limiting what leaves Salesforce, who sees it, and what the model provider can keep.
The problem it addresses
An agent that answers "Summarize this case" needs real customer data in the prompt. That creates several risks:
- Data exposure: Sensitive values such as names, emails, and card numbers could reach an external model provider.
- Over-access: A prompt could include records the person asking is not allowed to see.
- Retention and training: A provider could store prompts or use them to train its models.
- Misuse: A user, or text hidden in a record, could try to steer the model into ignoring its instructions.
- Harmful output: A response could contain toxic or inappropriate content.
- No record: Without logging, nobody could review what was sent and what came back.
The Trust Layer maps one control to each risk.
| Risk | Control | What it protects |
|---|---|---|
| Over-access | Secure data retrieval and grounding | Only data the running user may access enters the prompt |
| Data exposure | Data masking | Sensitive values are replaced before the prompt leaves Salesforce |
| Misuse | Prompt defense | Added instructions guard against misuse of the prompt |
| Retention and training | LLM gateway and zero data retention | The provider does not keep or train on the data |
| Harmful output | Toxicity detection | Responses are scored for harmful content |
| Readability | Demasking | Users see real values, not placeholders |
| No record | Audit trail | Interactions can be reviewed later |
The pipeline at a glance
The chapters follow this simplified order. Exact internal ordering and behavior can vary by feature and release.
1. User asks the agent a question
2. Secure data retrieval and grounding add CRM data the user may access
3. Data masking replaces sensitive values with placeholders
4. Prompt defense adds instructions that guard against misuse
5. LLM gateway sends the prompt to the model provider (zero data retention)
6. Model returns a response
7. Toxicity detection scores the response
8. Demasking restores the original values
9. Audit trail records the interaction
10. Response is shown to the userThe diagram shows a useful split. Steps 1 to 5 act on the outbound prompt, and steps 6 to 10 act on the inbound response. The model sits in the middle, outside the Salesforce trust boundary.
The two halves of the layer
Before the model: shrink and shape the prompt
The outbound controls decide what the model is allowed to see.
- Retrieval and grounding build the prompt from CRM data. They use the running user's permissions, so the prompt contains only data that user could already access.
- Data masking replaces detected sensitive values with placeholders. The model can still reason about "PERSON_0" without learning the real name.
- Prompt defense adds instructions that make the model less likely to follow harmful or off-topic requests.
- The LLM gateway is the single route to the model provider. Salesforce arranges zero data retention with its provider partners, so the provider does not store the prompt or response.
After the model: check and restore
The inbound controls decide what the user and the organization receive.
- Toxicity detection scores the response.
- Demasking swaps placeholders back for real values.
- The audit trail records the interaction, and feedback data can be stored with it.
A masking example
Masking is the easiest control to see. The placeholder names and the set of detected values depend on configuration.
Original grounded prompt (inside Salesforce):
Summarize the case for Maria Lopez ([email protected]).
Her order 55501 arrived damaged.
Prompt after masking (sent to the LLM):
Summarize the case for PERSON_0 (EMAIL_0).
Her order 55501 arrived damaged.
Response from the LLM:
PERSON_0 reported that her order arrived damaged. Please contact her at EMAIL_0.
Response after demasking (shown to the user):
Maria Lopez reported that her order arrived damaged. Please contact her at [email protected].Notice that the order number 55501 was not masked. Masking applies only to the value types it detects and is configured to cover. Anything outside that set goes to the model as written. Do not assume every sensitive value is caught.
What the layer does not do
The Trust Layer limits risk. It does not remove the need for sound Salesforce design. Keep these points in mind:
- It does not fix permissions. If a user has access to too much data, grounding will faithfully include it. The layer enforces your access model, and it cannot correct a poor one.
- It does not improve data quality. Wrong or stale CRM data gives wrong grounded answers.
- It does not make output always correct. Toxicity detection scores harmful content. It does not check facts.
- It does not replace agent design. The topics and actions you give an agent still decide what it can do.
- Behavior varies. Which controls apply, and how they are configured, can depend on the feature and the release.
The final chapter returns to this as shared responsibility between Salesforce and the customer.
Common misunderstandings
- "The Trust Layer is a setting." It is a set of controls, and some are configurable by admins while others are built into the platform.
- "Masking means the model never sees any customer data." The model still sees unmasked values, such as the order number above, and the surrounding context.
- "Zero data retention means nothing is logged." Zero data retention concerns the model provider. Salesforce can still record an audit trail.
- "Permissions are checked only at the end." Permissions apply during retrieval, before the prompt is built.
How to use this chapter
When you read the following chapters, place each control on the pipeline and ask three questions:
- What risk does it address?
- What does it act on, the prompt or the response?
- What does it leave to the customer?
Exercise
A prompt contains a customer's email address and an order number. After masking, the email is replaced with EMAIL_0 but the order number is unchanged. Which steps of the pipeline restore the email for the user, and why might the order number have been left alone?
Show answer
Demasking restores the email after the model returns its response and after toxicity detection. The order number was probably not in the set of value types that masking detects or is configured to cover. Masking only replaces the values it recognizes, so other values reach the model as written.
Exercise
Sort these controls into those that act on the outbound prompt and those that act on the inbound response: data masking, toxicity detection, prompt defense, demasking, secure data retrieval.
Show answer
Outbound (before the model): secure data retrieval, data masking, prompt defense. Inbound (after the model): toxicity detection, demasking.
Exercise
A user with overly broad record access asks an agent for a summary and the prompt includes records they should not have seen. Is this a Trust Layer failure? Explain.
Show answer
No. Grounding uses the running user's existing permissions, so the layer correctly included data that user could access. The fix is to correct the permissions and sharing model, which is the customer's responsibility.