Sub topic 10
The Einstein Trust Layer and model selection
This chapter assumes you know how a prompt template is built and how merge fields ground it in record data. It covers what happens to a prompt after you click Preview or after a user runs the template, and how you choose the model that answers it.
Why the Trust Layer matters for templates
A prompt template turns record data into text and sends that text to a large language model (LLM). Customer data therefore leaves the Salesforce record and travels to a model. The Einstein Trust Layer is the set of controls that sits between your template and the model. Every template type uses it: Sales Email, Field Generation, Record Summary and Flex.
You do not add the Trust Layer to a template. It applies automatically to prompts that run through Prompt Builder.
What happens to a prompt
The request passes through these stages in order:
- Grounding. Salesforce resolves your merge fields and resources into real values. It reads data as the running user, so field-level security and sharing rules decide what can enter the prompt.
- Masking. Salesforce detects sensitive values, such as names, email addresses and phone numbers, and replaces them with placeholders before the prompt leaves.
- Prompt defense. Salesforce adds instructions that reduce the chance of the model being steered off task.
- Model call. The masked prompt goes to the selected model. For models hosted by external providers, Salesforce has zero data retention agreements. The provider does not store the prompt or the response, and does not use them for training.
- Unmasking and checks. Salesforce puts the original values back into the response and scores it for toxicity.
- Audit. Salesforce records the interaction for auditing, subject to your org's setup.
The diagram shows this flow.
Permissions still apply
Grounding uses the running user's access. Two people can run the same template on the same record and get different prompts. If a user cannot see AnnualRevenue, that value is empty in their prompt. This is why the Field Generation example tells the model to leave out empty values instead of guessing. Write every template so it behaves sensibly when a field is blank.
Model selection
Each template has a model setting. Prompt Builder offers several choices:
- A Salesforce default model. This is the simplest option and works for most templates.
- Other models Salesforce makes available. These include models from external providers. They run through the Trust Layer.
- A model you connect yourself. You register it through Einstein Studio. Check what protections apply to a connected model, because your own contract with the provider governs its data handling.
The list you see depends on your org, your edition and what an admin has enabled. Treat any specific model name you read in a tutorial as a snapshot and look at your own org's list.
Choosing a model
Judge a model by the output of your real template, not by reputation. Weigh these factors:
| Factor | What to check |
|---|---|
| Quality | Does the Preview follow your length and tone limits? |
| Speed | Is the wait acceptable where users will run it, such as a record page? |
| Cost | Do larger models use more of your org's allowance per call? |
| Data handling | Does the provider fall under zero data retention? |
A short email or a one-sentence description rarely needs the largest model. A long case summary with many related records may benefit from one that handles longer input.
Model choice belongs to the template version. You can keep one version on the current model and another on a candidate, preview both on the same record, and compare. The next chapter on previewing and versioning covers that workflow.
Limits to remember
- The Trust Layer reduces risk but does not make a bad prompt safe. Do not put secrets in the prompt text.
- Masking depends on detection. Unusual formats may not be recognized, so avoid sending fields you do not need.
- Toxicity scoring flags harmful output but does not check facts. Review generated text before it reaches a customer.
Exercise
Two users run the same Field Generation template on one account. One user's output omits the revenue. Give a likely cause, and name the Trust Layer stage involved.
Show answer
The first user lacks field-level security access to AnnualRevenue. During grounding, Salesforce resolves merge fields with the running user's permissions, so that value is empty in their prompt. The template's "leave it out if empty" instruction then tells the model to skip it.