User access for standard agent actions
Key Takeaway
Standard agent actions always run with some user's permissions. Assign the action permissions to that user: the logged-in user for an Employee agent, or the agent user for a Service agent on Enhanced Chat or another Messaging channel.
When an agent runs a standard agent action, the action uses some user's permissions. That user must have access to the prompt templates, flows, Apex classes, and Knowledge or Data 360 features the action uses. Which user that is depends on the agent type and the channel: Employee agents run as the logged-in user, while Service agents on Messaging channels usually run as a dedicated agent user. You need to know which user it is before you can assign the right permissions.
Which user an agent's actions run as
An agent's actions run under one of two identities. On channels restricted to logged-in users, such as Lightning Experience, the agent runs as the logged-in user, so that user's access controls apply. On channels not restricted to logged-in users, such as Messaging channels, the agent runs as an agent user.
The agent type and the channel together tell you where to assign action permissions:
| Agentforce Employee agents | Agentforce Service agents on Enhanced Chat or another Messaging channel | |
|---|---|---|
| Who they serve | Internal users | Customers |
| Run as | The logged-in user | Usually the agent user |
| Where you assign action permissions | Individual users or user profiles | The agent user |
A Service agent doesn't always run as the agent user:
If a customer is logged in to an Experience Cloud site that uses Enhanced Chat with credential-based user verification turned on...
The Service agent runs as the logged-in site user. That user's profile, permissions, field-level security and sharing rules apply.
If a verified customer has a contact record but no user record, for example after entering an OTP...
The Service agent still runs as the agent user.
Before you grant anything, decide whether permissions belong on end users, on the agent user, or on both.