Sub topic 4
The Einstein Trust Layer: what it does to your prompts
This chapter explains what happens to a prompt between your agent and the large language model (LLM) that answers it. It assumes you know the Salesforce data model (objects, records, fields) and have read the overview of Agentforce agents, topics, and actions. You don't need to write any code here.
Why a trust layer exists
An agent builds prompts from your instructions, the user's message, and CRM data such as account or case fields. Without controls, that data would travel to an external model provider as plain text. The Einstein Trust Layer is a set of services that sits between Salesforce and the LLM. It filters what goes out and what comes back. It runs on every generative AI request in Agentforce, so you don't switch it on per agent.
The request path
What each stage does
| Stage | What it does to your prompt or response |
|---|---|
| Secure data retrieval and grounding | Adds record data to the prompt. It respects the running user's permissions, so the agent can only ground on data that user may see. |
| Data masking | Replaces sensitive values, such as names, emails, and phone numbers, with placeholder tokens before the prompt leaves Salesforce. |
| Zero data retention | The provider agrees not to store prompts or responses and not to use them to train its models. |
| Toxicity detection | Scores the response for harmful content before the user sees it. |
| Demasking | Swaps the placeholder tokens in the response back to the real values. |
| Audit trail | Records the prompt, the response, and the scores so you can review them later. |
Masking in practice
Suppose a user asks about a contact named Maria Lopez. The text sent to the LLM contains a token in place of her name. The model reasons about the token and returns a reply that uses the token. Salesforce then restores "Maria Lopez" before showing the reply.
Masking works by pattern detection and by the field types it knows about. It is not a guarantee that every sensitive string is hidden. Free text in a long description field may hold details that the detectors miss.
What the Trust Layer does not do
- It does not fix a bad instruction. A topic with vague scope can still produce wrong answers, and the layer won't flag them as wrong.
- It does not widen access. If the agent user lacks permission to a field, grounding can't read it. You manage that through permission sets, covered in a later chapter.
- It does not guarantee factual accuracy. Toxicity detection checks harm, not truth.
Common errors and misunderstandings
- Assuming the data never leaves Salesforce. Masked prompts do go to an LLM provider. The protection is masking plus the zero-retention agreement, not isolation.
- Looking for a setting to enable it. The layer is part of the platform. What you configure is related features, such as Data Cloud and the audit trail storage, covered in the next chapter.
- Expecting masked tokens in the preview. The builder shows the demasked reply. To see what was sent, you inspect the audit data once it is available in your org.
Exercise
A user asks your agent about a customer named Maria Lopez. At which point in the request path does her name get replaced by a token, and at which point does it come back?
Show answer
Data masking replaces the name before the prompt goes to the LLM gateway and provider. Demasking restores it after the response returns and passes toxicity detection, before the user sees the reply.
Exercise
Your teammate says the Trust Layer means you can paste customer secrets into topic instructions safely. Give one reason this is wrong.
Show answer
Masking relies on pattern detection and is not guaranteed to catch every sensitive value. Instruction text is also sent as part of the prompt, so you should keep sensitive values out of it.