Sub topic 17
Limits of the layer and shared responsibility
This chapter assumes you know Salesforce objects, fields, and profile and permission set basics. It also assumes you have followed the request flow from earlier chapters: retrieval, grounding, masking, prompt defense, the LLM gateway, zero data retention, toxicity detection, demasking, and audit. Here the question changes. Instead of asking what the Einstein Trust Layer does, we ask what it does not do, and who must cover the gaps.
Why limits matter
The Trust Layer reduces specific risks. It does not make an agent safe by itself. Each control has a defined job, and each job has edges. If you treat the layer as a general guarantee, you will skip work that only your organization can do.
A useful model has two sides:
- Salesforce operates the layer. This includes the gateway, the masking and demasking logic, the toxicity scoring, the audit mechanism, and the zero data retention agreements with model providers.
- The customer controls the inputs and the design. This includes who can see which data, how clean the data is, what the agent is allowed to do, and which protections are switched on.
The exact feature set and defaults vary by release and by configuration, so check current Salesforce documentation for your org.
What each control does not do
Each protection has a boundary. The table lists common misreadings.
| Control | What it does | What it does not do |
|---|---|---|
| Secure data retrieval | Limits grounding data to what the running user can access | Fix permissions that are too broad |
| Data masking | Replaces detected sensitive values with placeholders | Find every sensitive value, or hide data it was not configured to detect |
| Prompt defense | Adds instructions that guard against misuse | Guarantee the model will obey them |
| Zero data retention | Stops the provider from storing prompts and responses | Control what happens inside Salesforce, or in a third-party system |
| Toxicity detection | Scores responses for harmful content | Check whether a response is true |
| Audit trail | Records the interaction for review | Review itself, or prevent a bad response |
Permissions are inherited, not repaired
Retrieval respects the running user's access. That is a strength when your permissions are well designed. It is a weakness when they are not. If a service user can read every Contact field because a profile is too generous, the agent can ground a prompt in those fields for that user. The layer reproduces your access model faithfully, including its mistakes.
One more point: the "running user" depends on how the agent is built. Some agents run as the person chatting. Others run as a designated service identity. In the second case, the agent's data access is that identity's access, which may be wider than the end user's. Review which identity each agent uses.
Masking depends on detection
Masking works on values the system detects, using patterns and configured field settings. Detection of structured values such as emails or phone numbers is more dependable than detection of free-form text. Look again at the earlier example: the name and email were replaced, but the order number 55501 was sent as is, because it was not in the detected set.
Free text is the harder case. A case description might contain a diagnosis, a home address, or a partial account number written in an unusual way. Pattern-based detection may miss it. Two practical consequences follow:
- Do not store sensitive data in free-text fields if you can use a structured field that you can configure and protect.
- Do not assume that masked means anonymous. Context in the rest of the prompt can still point to a person.
Also remember what masking does to quality. A placeholder such as PERSON_0 carries no meaning for the model. If a task depends on the real value, such as comparing two names, the result can be worse.
Prompt defense is a mitigation
Prompt defense reduces the chance that an instruction hidden in data, such as a customer email saying "ignore previous rules", changes the agent's behavior. It is a mitigation, not a proof. Language models follow text, and no instruction set is guaranteed to hold against every attack. Treat any text from outside your org (emails, web forms, chat messages) as untrusted input, and limit what the agent can do, so that a successful injection has little to damage.
Toxicity detection is not fact checking
Toxicity scoring looks for harmful language. A polite, confident, wrong answer scores as safe. An agent can state an incorrect refund policy or invent an order status in a calm tone. Grounding in accurate data lowers this risk, but it does not remove it.
Zero data retention has a scope
Zero data retention is an agreement about how the model provider handles data sent through the gateway. It does not cover:
- Data stored in your Salesforce org, such as the audit records.
- Data the agent sends to other systems through actions, such as an API callout or an email.
- Content a user copies out of the response.
What stays with the customer
Permissions and sharing
Audit field-level security, object permissions, and sharing rules for the data that agents can reach. Use least privilege. Test with a user who has only the access the agent will use, not with an administrator.
Data quality
An agent grounded in stale or duplicate records produces confident answers from bad facts. Clean data, clear field definitions, and current knowledge articles are part of the security and accuracy story. Sensitive data in the wrong field is also a data quality problem, because it escapes field-based masking.
Agent and action design
Every action you give an agent is a capability. An action that updates records or sends messages carries more risk than one that reads data. Design with these habits:
- Give each topic a narrow scope and clear instructions.
- Prefer read-only actions until the agent has earned wider access.
- Require human confirmation for actions that are hard to reverse.
- Keep an escalation path to a person.
Configuration and review
The protections that are configurable only help if they are configured. Someone must own the settings, check the audit data, and act on what it shows. Audit records that nobody reads do not improve safety.
A review checklist as code
You can turn part of the review into a repeatable query. The following Python script uses only the standard library. It reads a CSV export of agent definitions, which you create yourself with the columns agent, runs_as, has_write_actions, and human_confirmation. It flags agents that need a closer look.
import csv
import io
SAMPLE = """agent,runs_as,has_write_actions,human_confirmation
Support Helper,end_user,false,n/a
Refund Agent,service_user,true,no
Order Status,service_user,false,n/a
"""
def review(rows):
findings = []
for row in rows:
writes = row["has_write_actions"].strip().lower() == "true"
confirmed = row["human_confirmation"].strip().lower() == "yes"
service = row["runs_as"].strip().lower() == "service_user"
if writes and not confirmed:
findings.append((row["agent"], "write actions without human confirmation"))
if service:
findings.append((row["agent"], "runs as a service user: check its access"))
return findings
if __name__ == "__main__":
reader = csv.DictReader(io.StringIO(SAMPLE))
for agent, issue in review(reader):
print(f"{agent}: {issue}")Running it prints:
Refund Agent: write actions without human confirmation
Refund Agent: runs as a service user: check its access
Order Status: runs as a service user: check its accessThe script does not query Salesforce. It shows the shape of a review: list agents, identify the access identity, and flag capabilities that change data.
Common errors
- Assuming masking covers all personal data, then putting sensitive details in free-text fields.
- Testing an agent as an admin and shipping it to users with different access.
- Reading "zero data retention" as "nothing is stored anywhere".
- Treating a low toxicity score as a sign that the answer is correct.
- Giving an agent write actions before its read behavior has been tested.
- Turning protections on once and never reviewing the audit data.
Exercises
Exercise
A support agent runs as a service user with read access to every Contact field. A customer-facing chat user only has access to their own records. Which party is responsible for noticing that the agent could ground a prompt in data the chat user should not see, and why does the Trust Layer not prevent it?
Show answer
The customer's admin or agent owner is responsible. Secure data retrieval applies the running user's access, which here is the service user's broad access. The layer reproduces that access faithfully and does not judge whether it is too wide. The fix is to reduce the service user's permissions or run the agent as the end user.
Exercise
A case comment contains "My daughter's medication is Zorvex 20mg" in free text. After masking, the prompt still contains the medication name. Give two reasons this can happen and two steps you can take.
Show answer
Reasons: pattern-based detection is weaker on free text, and the value may not be in a configured detection set. Steps: move sensitive details to structured fields that you can configure and protect, and limit which free-text fields are used for grounding. Reviewing audit data to find similar cases is also valid.
Exercise
An agent says, in a polite tone, that a customer is eligible for a refund they are not eligible for. Toxicity detection did not flag it. Is this a failure of the Trust Layer? What would you check?
Show answer
No. Toxicity detection scores harmful language, not accuracy. Check the grounding data and knowledge articles for errors, review the topic instructions for the refund policy, and consider requiring human confirmation before refund actions.