Sub topic 1
How Agentforce limits what an agent can do
An Agentforce agent can read records, call Apex, and answer customers. Each of those abilities has to be limited on purpose. This chapter gives you the working model for those limits. Later chapters cover each layer in detail.
Prerequisites
This chapter assumes you already know:
- Basic Salesforce administration: users, profiles, and permission sets.
- How objects, fields, and record sharing work.
- What an Agentforce agent is, and what topics and actions are.
- How to read simple Flow or Apex. This is helpful for the action sections, but not required here.
The core idea: an agent has no powers of its own
An agent does not get special access to your org. It acts through a Salesforce user, and that user's permissions decide what data the agent can see and change. If the user cannot read an object, the agent cannot read it either.
Permissions only set the outer boundary, though. Inside that boundary, you also control what the agent is willing to do. So Agentforce limits an agent in two kinds of ways:
- Data access controls decide what the agent's user is allowed to touch. These are permission sets, sharing, and field-level security.
- Behavior controls decide what the agent tries to do. These are topics, instructions, and actions.
Two more pieces support both kinds. The Einstein Trust Layer protects data sent to and from the language model. Escalation and testing catch the cases the other layers miss.
The layers
| Layer | What it limits | Where you configure it |
|---|---|---|
| Run-as user | Whose permissions apply | Agent setup |
| Permission sets | Objects, fields, and system access | Setup, permission sets |
| Sharing and field-level security | Which records and fields are visible | Sharing settings, field settings |
| Topics | Which kinds of requests the agent handles | Agent builder |
| Instructions | How the agent behaves inside a topic | Topic and agent instructions |
| Actions | What the agent can actually do | Agent builder, Flow, Apex |
| Einstein Trust Layer | What data reaches the model and what comes back | Platform feature |
| Escalation and testing | What happens when limits are reached | Agent design, test tools |
Why layers matter
No single layer is enough. Instructions are written in natural language, and a language model can misread or be talked around them. A permission set is enforced by the platform, so the model cannot ignore it. Use permissions for anything that must never happen, and use instructions to shape what the agent does within those permissions.
Here is an example. A service agent should only report order status. A topic limits it to order questions. An instruction tells it to refuse refunds. The permission set gives its user read-only access to Order. If a customer persuades the agent to attempt a refund, the permission set still blocks the write.
Who the agent runs as
Agent types differ in whose permissions apply. Some agents run as a dedicated agent user that you create and control. Others run as the logged-in person who is using the agent. This choice decides how you design everything else, so the next chapter covers it. For now, remember the rule: the agent never exceeds the permissions of the user it runs as.
What to check at each step
When you review an agent, ask these questions in order:
- Which user does the agent run as?
- What can that user read and edit?
- Which topics and actions can the agent reach?
- Do custom actions respect the user's permissions?
- What happens when a request falls outside the agent's scope?
Exercise
A service agent has a topic that only allows order status questions, and its instructions say never to change orders. Its user has a permission set with edit access to Order. Is the agent safely limited? Explain.
Show answer
No. The topic and instructions are behavior controls that the model can misread or be talked around. Because the user can edit orders, an unexpected request could still lead to a change. Remove edit access from the permission set so the platform blocks the change regardless of what the agent attempts.
Exercise
Name the two kinds of controls that limit an agent, and give one example of each.
Show answer
Data access controls decide what the agent's user can touch, for example a permission set or field-level security. Behavior controls decide what the agent tries to do, for example a topic, an instruction, or a limited set of actions.