Concept
- This is the single most useful fact in Agentforce, and the most commonly got wrong.
- Employee Agent: Runs as the logged-in user.
- Service Agent: Runs as its own dedicated user (
default_agent_user). - Field-level security (FLS) is enforced normally. Sharing rules are enforced normally.
- Apex actions inherit this through
with sharingandWITH USER_MODEqueries. - The failure mode is silent. There is no error, no exception, and no error banner.
- The agent simply says it cannot help, in a perfectly polite sentence.
- That silence is why people debug the prompt for hours before checking permissions.
- It also means an Employee Agent is genuinely safe to give broad instructions to, because the ceiling is the human's own access.
Rule: When an agent cannot find something, check permissions before you touch anything else.
Gain: You solve in minutes what most people spend a day on.
Price: Testing properly means creating restricted users and logging in as them. That is real effort.
Limits: No override exists. There is no "run as system" mode for an agent.
Mirror — assuming a service account: You will look for a user that does not exist on an employee agent.
Later: This is also your security demo. Log in as a restricted user, ask for a forbidden record, and screenshot the refusal.
At volume: Permission creep across a build is real. Audit and remove extra grants at the end, and keep a record of every grant and why.
Core Q&A
A: Describe the layers, then demonstrate them.
- The agent runs within a user's permissions, so field-level security and sharing apply exactly as they do everywhere else.
- For an employee agent, that user is the person chatting, which means the test is the real execution path, not a stand-in.
- I create a user without access to a given record, log in as them, and ask the agent about it.
- Then I do the same for a field, by removing read access and watching the answer degrade gracefully.
- I keep the screenshots, because a demonstration beats a description every time.
- I also keep a log of every permission I added during the build and why, then remove anything speculative at the end.
Follow-ups (Scenario-Based)
A1: Field-level security (FLS) on that field, for the user the agent is running as.
- A missing field due to FLS does not throw an exception. The merge field simply resolves to blank.
- The model then writes fluently around the gap, so the answer looks complete to the end user.
- This is the most under-tested behaviour in the whole product.
- The fix is to test explicitly as a restricted user during the build, not after go-live.
A2: Refuse, and explain the blast radius rather than quoting policy.
- A Service Agent is reachable by external customers or the public. Its user's access is effectively public reach.
Modify All Datameans any conversation is one prompt injection away from reading or modifying any record in the org.- The correct path is a focused permission set granting access to exactly the objects and fields the actions touch.
- If that feels slow, the real problem is that nobody documented what the actions actually need to execute.