Section 4 · AI Agents · 35% of exam
4.10 Agent Security Context and Action Execution
Exam objective
Explain how an agent’s security context affects data access and action execution, and identify controls that must be reviewed for a use case.
Identify who the agent acts as
An agent’s security context determines the user identity and permissions that apply when it accesses Salesforce data or performs an action. Employee agents are designed for internal employees and run in the logged-in user context. They respect that user’s applicable licenses and Salesforce access framework, and administrators can assign access to specific profiles or users. Service agents use an Agent User context for customer interactions. The Agent User is a Salesforce integration user with the permissions needed by the agent. These contexts are not interchangeable. In a scenario, first identify the agent type and the actual runtime user before deciding whether a record or action should be available.
Least privilege for service agents
A service agent should receive only the permissions required for its approved tasks. Salesforce’s guided setup can create an Agent User with minimal access, after which an administrator grants the additional access the agent needs. Review object permissions, field-level security, sharing, licenses, and access to the underlying Flow, Apex class, prompt template, or external service. An action that is available in the agent configuration may still fail if its running user lacks access. Conversely, an overly privileged Agent User can expose data or allow unintended updates. Design permissions around the action’s true business need and recheck them when the agent’s responsibilities change.
Context and action execution
The same action can behave differently depending on the identity, permissions, and execution settings involved. For employee agents, the logged-in user context helps keep access aligned with each employee’s existing rights. For service agents, the Agent User must be configured so it can perform customer-service tasks without broad administrative authority. Also inspect how the underlying Flow or Apex executes, what records it queries, and which values it accepts from the model. A correct topic selection does not bypass platform security. Filters can limit when an action is offered, but permissions and data access controls still need to enforce what the execution identity may do.
Protect sensitive journeys
For actions that disclose personal details or change an account, use an appropriate identity-verification step and make sensitive actions available only after verification. Salesforce recommends filters for requiring authentication before subagents or actions that perform user tasks in customer channels. The verification value should come from a reliable process and be mapped consistently, rather than inferred from a casual user statement. Limit exposed actions, validate inputs, avoid returning unnecessary fields, and test unauthenticated, unauthorized, and cross-customer requests. Review logs and traces without exposing sensitive content unnecessarily. Security must be built into the agent, channel, permissions, and action implementation together.
TIP: If the question asks why an action can or cannot access a record, identify the runtime context first: logged-in employee or configured Agent User, then check the permissions and underlying action.
A filter can restrict agent behavior, but it does not replace Salesforce object, field, record, license, or action-level access controls.
Extra concept: The Service Agent’s setup and runtime Agent User context should be tested with the same permission profile expected in production.
Official references:
- Create an Agent from an Agentforce Employee Agent Template https://help.salesforce.com/s/articleView?id=ai.agent_employee_agent_setup.htm&language=en_US&type=5
- Create an Agent from an Agentforce Service Agent Template https://help.salesforce.com/s/articleView?id=sf.service_agent_setup.htm&language=en_US&type=5
- Trust and Agentforce https://help.salesforce.com/s/articleView?id=copilot_trust.htm&language=en_US&type=5
Key takeaways
- Employee agents run in the logged-in user context; Service agents use an Agent User context.
- Least privilege and underlying Flow or Apex permissions affect whether actions can execute.
- Use identity verification, filters, and platform security together for sensitive customer actions.
