Sub topic 2
Where Agentforce Agents Send Prompts
This chapter assumes you know Salesforce objects, fields, and user permissions. It also assumes you know what a large language model (LLM) and a prompt are. The goal is to locate the points where an Agentforce agent builds a prompt and sends it out. Those points are where the Trust Layer applies.
The pieces of an agent
An Agentforce agent has three building blocks that matter for data flow.
- Agent: the assistant that receives a user's request and decides what to do. It runs as a specific user or in a specific context, and that identity affects which data it can read.
- Topic: a category of work the agent can handle, such as order support. A topic holds instructions and a list of actions.
- Action: a unit of work the agent can run. Examples are a Flow, an Apex method, a prompt template, or a query for knowledge articles.
When a prompt is created
An agent does not send the user's text straight to a model. At several steps it builds a prompt, which is text that combines instructions with data.
- Choosing a topic: the agent sends the user's message and the topic descriptions to the model, so the model can pick the best match.
- Choosing an action: the agent sends the topic instructions, the action descriptions, and the conversation so far, so the model can pick what to run.
- Running an action: some actions call a prompt template. The template merges CRM field values into the text, which is grounding.
- Writing the reply: the agent sends the action results back to the model, which writes the answer for the user.
A single user question can therefore produce several model calls. Each call can carry CRM data, so each one needs protection.
Why this matters for trust
Because the agent works across several steps, protection cannot be a one-time check on the first message. It has to apply to every prompt that leaves Salesforce. Data enters prompts in three common ways:
| Source | Example | Risk |
|---|---|---|
| User message | The user types a customer's email address | The user may include sensitive values |
| Action output | A Flow returns a case record | Fields may contain personal data |
| Prompt template | A merge field inserts an account's notes | Free text may hold unexpected content |
Common errors
- Assuming only the typed message is sent. Action results and grounded fields are also part of the prompt.
- Assuming one question means one model call. Multi-step agents make several calls, which matters when you review logs.
- Giving the agent broad actions. An action that returns many fields puts more data into prompts than the task needs.
The next chapters describe the Trust Layer that handles each of these prompts.
Exercise
A user asks an agent about a damaged order. The agent picks a topic, runs a Flow that returns the case record, and writes a reply. Name two points where CRM data can enter a prompt, and explain why one question can cause more than one model call.
Show answer
CRM data can enter a prompt when an action such as the Flow returns the case record, and when a prompt template merges field values into its text. It can also appear if the user types it in the message. One question can cause several model calls because the agent uses the model separately to choose a topic, choose an action, and write the final reply. Each call is a prompt that must be protected.