Sub topic 12
Model Choices and What Changes for Trust
This chapter covers the model options available behind the LLM gateway and how each choice changes the trust boundary around your data. It assumes you have read the chapters on the LLM gateway and zero data retention. You should also know what a prompt is and how masking works.
Why the model choice matters for trust
The Trust Layer wraps every prompt in the same sequence of steps: grounding, masking, prompt defense, gateway, toxicity detection, demasking, and audit. The model that answers the prompt is a separate decision. Choosing a different model can change three things:
- Where the prompt is processed, and by whom.
- Which contractual terms cover the data, such as zero data retention.
- How much of the Trust Layer's behavior you can rely on without extra checking.
The model does not change what grounding retrieves or what the running user is allowed to see. Those steps happen before the prompt leaves Salesforce.
The main categories of model
Salesforce describes several ways to reach a model. Names, availability, and terms change between releases, so treat the table as a way to think about the choice and check current Salesforce documentation for the exact list.
| Category | Where the model runs | Typical trust questions |
|---|---|---|
| Salesforce-managed models | Hosted and operated within Salesforce's own infrastructure | Which Salesforce terms and regions apply? |
| Third-party models through the gateway | Run by an external provider, reached through the LLM gateway | Does the provider's zero data retention agreement cover this model and feature? |
| Bring your own model (BYOM) | A model you host or license, connected to Salesforce | Your own contract and hosting decide retention, residency, and logging |
The first two categories pass through the Trust Layer's gateway. With a bring-your-own model, you should confirm which Trust Layer steps still apply to the connection, because the provider relationship is yours and the guarantees are only as strong as your agreement.
The trust boundary
A trust boundary is the line where data leaves a system you control and enters one you do not fully control. For Agentforce, the main boundary sits at the gateway.
- Inside Salesforce: retrieval, permission checks, grounding, masking, and prompt defense run here.
- Crossing the boundary: the masked, defended prompt travels to the model.
- Outside Salesforce: the provider processes the prompt and returns a response.
- Back inside: toxicity detection, demasking, and audit run on your side again.
A model you host yourself moves the far side of that boundary into your own environment. This can help with strict residency rules, but it also means your team owns the controls that the managed path provides.
What does not change with the model
Some protections belong to Salesforce's side of the boundary and apply whichever model you pick.
- Retrieval uses the running user's permissions, so the prompt only contains data that user may access.
- Masking replaces detected sensitive values with placeholders before the prompt is sent.
- Demasking restores values only after the response comes back.
- The audit trail records the interaction.
Masking is detection-based. It only protects values the configuration detects. A model with a stronger contract does not fix a field that was never masked.
What can change with the model
Retention and provider terms
Zero data retention is an agreement with the model provider. It says the provider does not store prompts and responses after processing them. Whether it applies depends on the provider, the model, and the feature. Do not assume it carries over when you switch models.
Data residency
Different models may be served from different regions. If your policy limits where data may be processed, check where the selected model runs, not only where your org is hosted.
Output behavior
Models differ in how they follow instructions, how often they produce unsafe or inaccurate text, and how they handle placeholders. Toxicity detection scores responses, but it is a safety net and not a substitute for testing the model on your use case.
Quality and cost
A larger model may answer complex requests better and cost more per request. A smaller model may be enough for a short summary. This is a design choice, but it interacts with trust. For example, a model that mangles placeholders can break demasking.
Placeholders and model behavior
Masking relies on the model returning placeholders unchanged. Consider the example from earlier chapters:
Prompt sent to the LLM:
Summarize the case for PERSON_0 (EMAIL_0).
Response:
PERSON_0 reported a damaged order. Contact EMAIL_0.Demasking can replace PERSON_0 and EMAIL_0 because they appear exactly as sent. If a model rewrote PERSON_0 as "Person 0" or dropped it, the original value could not be restored in that spot. When you evaluate a new model, test prompts that contain masked values and check that the final text is complete and correct.
A decision checklist
Before enabling or switching a model for an agent, work through these questions.
- Which route does the model use: Salesforce-managed, third-party through the gateway, or bring your own?
- Does zero data retention cover this model and this feature?
- Where is the model processed, and does that meet your residency policy?
- Which Trust Layer steps apply to this route?
- Have you tested prompts containing masked values and checked demasked output?
- Have you reviewed audit records from test runs?
Common mistakes
- Assuming that all models carry the same retention terms.
- Treating a bring-your-own model as if it automatically inherits every Trust Layer guarantee.
- Ignoring residency because the Salesforce org is in the right region.
- Switching models without retesting masking and demasking.
- Expecting a safer model to compensate for excessive user permissions. Permissions control what reaches the prompt, and the model cannot undo that.
Summary
The model is the part of the pipeline that lives outside Salesforce, so choosing it is choosing where the trust boundary sits. Retrieval, masking, and audit stay on your side of the line. Retention terms, processing location, and output behavior depend on the model and its provider. Verify those each time you change models.
Exercise
Your team switches an agent from a Salesforce-managed model to a bring-your-own model hosted in your own cloud account. Name two things that stay the same and two things you must now verify yourself.
Show answer
Stay the same: retrieval and grounding still use the running user's permissions, and masking of detected values still happens before the prompt leaves Salesforce's processing steps. Verify yourself: the retention and logging behavior of the hosted model (your own agreement replaces the provider's zero data retention terms), and which other Trust Layer steps, such as toxicity detection and audit, apply to this connection. You should also confirm where the model processes data for residency and retest that placeholders survive and demask correctly.
Exercise
A new model sometimes writes "Person 0" instead of "PERSON_0". What breaks, and how would you catch it before release?
Show answer
Demasking cannot match the altered text to the stored value, so the user sees the wrong or incomplete name. Catch it by testing prompts that contain masked values against the new model and comparing the demasked output with the expected text.