Sub topic 4
Following one request through the layer
This chapter walks one prompt through the Einstein Trust Layer from start to finish. It assumes you know basic Salesforce objects, fields, and user permissions. It also assumes you know what a large language model (LLM) and a prompt are. Later chapters cover each step in detail. Here the goal is the order and the purpose of each step.
The pipeline at a glance
The order below is simplified. The 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 userBefore the prompt leaves Salesforce
Steps 2 to 4 happen inside Salesforce.
- Retrieval and grounding. Grounding means adding real CRM data to the prompt so the answer is specific. Retrieval runs as the user, so the prompt only contains records and fields that user may access.
- Masking. Detected sensitive values, such as names and email addresses, are swapped for placeholders.
- Prompt defense. Extra instructions are added to the prompt to reduce misuse, such as attempts to make the model ignore its rules.
Crossing to the model
The LLM gateway sends the prompt to the model provider. Salesforce arranges zero data retention with its provider partners, so the provider does not store the prompt or response. The model sees placeholders, not the original values.
Coming back
Steps 6 to 10 run on the response.
- Toxicity detection scores the response for harmful content.
- Demasking replaces placeholders with the original values, so the user reads a normal answer.
- The audit trail records the interaction for later review.
A worked example
This example shows masking and demasking around the model call. 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 only covers what the configuration detects. Plain order numbers may pass through, so do not assume every sensitive value is hidden.
Common mistakes
- Assuming masking comes first. Retrieval and grounding come before masking. Masking can only protect data that is already in the prompt.
- Treating the layer as one switch. Each step has its own purpose and its own limits.
- Expecting permissions to be fixed by the layer. If a user can access a field, grounding can include it. Permission design stays with you.
Exercise
In the pipeline, why must demasking happen after the model returns its response, and why does toxicity detection run before demasking?
Show answer
Demasking restores real values, so it can only run once the response exists and contains the placeholders. The model must work only with placeholders, so the real values can't be restored earlier. In the simplified order used here, toxicity detection scores the response before demasking, so the check runs on the model's output while the sensitive values are still hidden. Exact ordering can vary by feature and release.
Exercise
A user lacks access to a field on a Contact record. At which step does the Trust Layer keep that field out of the prompt?
Show answer
At secure data retrieval and grounding (step 2). Retrieval runs with the user's permissions, so the field is never added to the prompt, and later steps such as masking never have to handle it.