Agent execution context and data access
Key Takeaway
To predict what an agent can see or do, first ask who the running user is. By default, a Service agent runs as a dedicated agent user, not as the customer, so you must limit each customer's data access yourself.
Execution context means which user an Agentforce agent runs as. When an agent runs an action, it runs as a specific Salesforce user. That user's profile, permissions, field-level security, and sharing rules decide what data the agent can read and edit, so the agent's data access is the same as that user's access. Which user it runs as depends on the agent type, the channel, and whether credential-based user verification is turned on. An app builder must get this right so the agent can do its job without exposing records to the wrong person.
Who each agent type runs as
| Works with | Channels | Runs as | |
|---|---|---|---|
| Agentforce Employee agents | Internal users | Lightning Experience, the Salesforce mobile app, Slack, or Enhanced Web Chat on an Experience Cloud site | The logged-in end user |
| Agentforce Lead Nurturing agents | Prospects, for top-of-funnel lead engagement | Outbound email | A dedicated EinsteinSDRAgent User |
| Agentforce Service agents | External customers and partners | Enhanced Messaging channels, such as Enhanced Chat v1 and v2 | By default, the agent user |
Employee agents are not for unauthenticated external customers. The logged-in end user's profile, permission sets, and sharing rules or role decide the agent's actions and responses. Because the agent already runs with the end user's own access, you don't need to explicitly scope its queries and actions to user-specific data.
You must give users access to each individual Employee agent through permission sets or profiles. You also assign the permissions the agent's actions need to individual users or user profiles.
A Lead Nurturing agent can work 24/7, sending customized emails, booking meetings, and answering prospect questions. Its EinsteinSDRAgent User gets system-level permissions during agent setup. Assignment rules, automated actions, or individual sales users assign prospects to the agent.