This is the Data 360 half of Agentforce Agent User Least Privilege. That post covers the agent user's permission sets and the action layer. This one covers what happens when the agent retrieves from Data 360, where a different access model applies.
TL;DR
- For retrievers, CRM sharing stops at the Data 360 boundary. Retrievers follow Data 360 governance policies, not your sharing rules. Knowledge retrieval and "Controlled by Parent" related lists are the documented exceptions.
- Many orgs run an Allow All policy. While it is active, any internal user with access to a data space, an agent user included, can query everything in it. Salesforce's own pages disagree on whether new orgs still start with it.
- Record-level policies may filter only the users they target. One Salesforce page says users outside a record-level policy still see all records under Allow All; another says the opposite. Test it in your org.
- The Einstein Trust Layer does not narrow access, and its masking is off for agents. Whatever the running user can reach, the agent can put in front of the model.
- The audit trail is a copy of what the agent retrieved. Retrieved data and full prompts land in Data 360, where Allow All also applies.
What You'll Learn
- Which user an agent runs as on each channel, and why that decides retrieval
- How data spaces, permission sets and governance policies combine in Data 360
- Which retrieval paths enforce record-level access, and which do not
- What the Einstein Trust Layer does and does not do for agent data access
- A scoping sequence for an agent grounded on Data 360
The Problem
You build an agent that answers questions from a data library. In Agentforce Builder it finds the right answers. In production on a web chat channel it either returns nothing, or, worse, it returns too much.
Both symptoms come from the same place. Data 360, renamed from Data Cloud in October 2025, has its own access model: data spaces, permission sets and a governance policy engine with object-, field- and record-level policies. For most Data 360 data, that engine decides access, not CRM sharing. Most Agentforce security advice stops at the agent user's permission sets, and the top search results for agent data permissions do not mention the Data 360 defaults at all.
Common Questions This Article Answers:
- Does an Agentforce agent respect sharing rules when it retrieves from Data 360?
- Why does retrieval work in the builder but fail for the agent at runtime?
- Does the Einstein Trust Layer stop an agent seeing data it should not?
Quick Answer
Start with identity. On logged-in channels the agent runs as the logged-in user; on Messaging and other channels not restricted to logged-in users, it runs as the agent user. Then look at Data 360. A user reaches Data 360 data only through a data space linked to one of their permission sets, and then through governance policies. Where the Allow All policy is active, that data space access is effectively total for internal users. Retrievers "adhere to the data governance policies set up for your data", so with Allow All in place, the agent user retrieves everything in the spaces it can reach. Knowledge libraries are the exception: the Answer Questions with Knowledge action only uses articles the requesting user can access. To scope an agent, link only the data spaces it needs. Then check whether Allow All is active, replace it with object-, field- and record-level policies, target the agent user explicitly, and protect the audit and session tracing data as carefully as the source.
Who the Agent Is Decides What It Retrieves
The same agent can run as different users depending on the channel. Salesforce's agent user page and its permissions reference for agent actions set it out:
| Channel | Runs as |
|---|---|
| Lightning, mobile, Slack, and Enhanced Chat on an Experience site with credential-based user verification | The logged-in user, with that user's access |
| Messaging and other channels not restricted to logged-in users, including unidentified visitors | The agent user, EinsteinServiceAgent User by default |
For unidentified Enhanced Chat visitors, Salesforce also creates an Agentforce Guest User record to identify the session. It has no permission sets, but the agent still runs as the agent user, so an anonymous visitor reaches everything the agent user can.
A logged-in Experience Cloud user is an external user as far as Data 360 is concerned. External users are denied Data 360 data by default unless objects are tagged for portal or public visibility and a policy allows them, so Allow All does not reach them.
Verifying a customer does not change this. Salesforce's agent user page says it plainly: "Context variables tell the agent who the user is but don't control data access." A verified customer on Messaging still retrieves as the agent user.
Salesforce's agent user page now lists the AgentforceServiceAgentUserPsg permission set group as part of service agent provisioning. It contains Agentforce Service Agent User, Data Cloud User and Prompt Template User. The earlier post covers both setup paths. The Agentforce DX path assigns three permission sets without Data Cloud User, so check which your agent user actually has. Data Cloud User is the one that matters here: standard Data 360 permission sets are linked to the default data space, so with Allow All active, an agent user holding it can retrieve from the default space from day one. The permission set names still say Data Cloud after the rename.
Three Layers: Data Spaces, Permission Sets, Policies
Data 360 access is layered, and each layer answers a different question.
Data spaces set the scope. A data space is a logical partition of Data 360 data, and every org has a default one. Users reach a space through a permission set linked to it, under Data Cloud Data Space Management. Standard Data 360 permission sets are linked to the default data space, with one exception: Data Cloud Architect. System administrators hold Manage All Data Space, which reaches every space. Search indexes are defined in a data space, so a retriever built on an index in a non-default space is invisible to users whose permission sets do not link that space.
Permission sets grant features. Data Cloud User is view access across Data 360 features. Data Cloud Architect carries full access, including governance and search index configuration. Salesforce's guidance is explicit that permissions for creating or managing agents should not go to end users or the agent user.
Policies decide the data. Object-, field- and record-level policies, plus masking, live in Data 360's governance engine. Salesforce's own getting-started page notes that data spaces do not support fine-grained or row-level control; that is the policies' job. It also says that assigning a data space through a permission set does not automatically give access to the data. In a fresh org, though, that sentence rarely bites, because of the next section.
The Allow All Policy Is On
Salesforce's governance considerations page says Data 360 provides an Allow All policy, also called the day zero policy, "out of the box for both existing and new orgs." It grants internal users access to everything they can reach through their data spaces, and the same page says admins need to delete it to enable granular access control.
Salesforce's own pages disagree about new orgs. The Data 360 security architecture guide says new organisations now begin in a Deny All state and describes Allow All as the posture of older orgs. Either way, check Data Governance in your org before assuming which one you have.
Two consequences matter for agents.
An agent user with a data space can retrieve all of it. If Allow All is active, the agent user holds Data Cloud User and the space is linked, every object in that space is available to the retriever.
Record-level security may have a gap. The record-level security page says: "Currently, the RLS policy filters records only for users who meet the policy criteria. Other users see all records because the default Day 0 Allow All object-level security (OLS) policy remains in effect." It lists a fix as an upcoming change, with no date. The governance considerations page states the opposite, that row-level allow policies limit access to only the users they cover. If the first page describes your org, an RLS policy written for your human users does nothing for an agent user it does not target. Test it: query the object as a user the policy does not target. Then write the policy so the agent user meets its criteria, or remove Allow All first.
Policies also take two to three minutes to apply after a change, so test after the delay, not straight away.
Retrieval Paths: What Enforces Access
Different grounding paths are enforced by different layers. This table is built from Salesforce's documentation, path by path.
| Retrieval path | What enforces access | Record-level check on retrieved content |
|---|---|---|
| Answer Questions with Knowledge on a Knowledge library | Knowledge access and data category visibility of the requesting user (the agent user on Messaging, by inference) | Yes. The action "only uses knowledge articles the requesting user can access" |
| Answer Questions with Knowledge on a file upload library | Not documented; presumably Data 360 permission sets, data space and policies | Not documented per file. Treat every uploaded file as visible to anyone who can reach the library |
| Retrievers in prompt templates (custom, ensemble or library-backed) | Data 360 permission sets and governance policies | Yes, under Data 360 policies, not CRM sharing. With Allow All, the check passes for anyone with space access |
| Retriever actions used directly in a subagent | The retriever's Data 360 controls | No action-specific statement found. Beta, rolling out from November 2026 |
| Prompt template merge fields and related lists | The permissions of the user executing the prompt | Yes for CRM data. Salesforce's Trust Layer pages disagree on whether this extends to Data 360 data |
| Data graphs | Data 360 policies | Since August 2026, restricted fields are pruned and masked instead of blocking the whole graph |
| Anonymous-facing agents on an Agent Service Account with internal org-wide default access | Internal user policies, not external user policies | Depends on the internal policy you scope to that account |
| Agents set to Digital Agent External User (since Summer '26) | Unidentified external user policies | Denied unless the object is tagged for public visibility and a policy allows it |
Three rows deserve attention.
File libraries have no documented per-file access. Upload a document to a data library and the documentation says nothing about restricting it to particular users. If a file should not reach every user of the agent, it does not belong in a shared library.
Data libraries used with the Answer Questions with Knowledge template cannot filter per user at runtime. Dynamic pre-filters are not supported with a data library and the Answer Questions with Knowledge template; only static pre-filters are. Salesforce's suggested workarounds are separate libraries or a custom Apex action that passes filter values.
Some anonymous-facing agents use internal policies. The Data 360 external access page says agents on an Agent Service Account with internal org-wide default access run in the context of an internal integration user and get internal user policies, and recommends a policy scoped by a custom permission assigned only to that integration user. The documentation does not say whether this Agent Service Account is the same identity as the Agentforce agent user, so check which user your agent's queries actually run as. Since Summer '26 you can instead choose Digital Agent External User, which Data 360 treats as an unidentified external user and denies by default.
What the Einstein Trust Layer Does Not Do
The Trust Layer is often cited as the answer to agent data risk. It does real work: zero data retention with external model providers, prompt defence, toxicity scoring and audit logging. But it does not decide what the agent can reach. It grounds prompts using the permissions of the user running them; it never narrows them.
Its data masking does not apply here either. Salesforce's agent masking page states: "In Einstein Trust Layer, pattern-based and field-based data masking for large language models (LLMs) is disabled for agents." The same page says masking is disabled when a prompt template is called through an agent action.
Do not confuse that with Data 360 Dynamic Data Masking, which is generally available, needs an add-on licence, and applies at query time to Data 360 objects whatever the access method. Masking for unstructured files reached general availability in late October 2026. If an agent must not see a field's value, a Data 360 masking or field-level policy is the control, not the Trust Layer.
The Audit Trail Holds What the Agent Retrieved
To see what an agent retrieved, use Data 360 itself. In orgs with a single data space, turning on Agentforce also turns on Einstein Audit and Feedback data, which stores fields including the hydrated prompt, the retrieved data and the model's response, in a Data 360 data space and flagged as containing user data. Agentforce Session Tracing records turn-by-turn interactions, actions and gateway inputs and outputs, and is on by default for single data space orgs. Since Winter '27, if Agent Optimization and Agent Analytics are on, session details also show which Knowledge articles and external sources an agent used.
That makes the audit data a second copy of everything sensitive the agent touched. Salesforce's own setup page warns that if Allow All is active, users with the System Administrator profile can query all Data 360 data model objects, and recommends deleting it or editing its scope. Masking personal data in session logs at query time is in beta from November 2026 and needs the Dynamic Data Masking licence.
Event Monitoring does not cover this gap. The UiAgentInteractionEventLog event type tracks client-side interactions with the Agentforce panel in Lightning Experience, the mobile app and Conversation Preview in Agentforce Builder; I found no event type that records Data 360 retrieval by an agent.
Why It Works in the Builder and Fails at Runtime
Salesforce does not document this end to end, so treat the following as the likely mechanism rather than a stated one. It assumes Builder preview runs as you, which the preview docs do not state. The person building the agent is usually a system administrator, who holds Manage All Data Space and, under Allow All, can query every Data 360 object. On Messaging the agent runs as the agent user, whose Data Cloud User permission set is linked to the default data space by default. If the library's search index lives in another space, the builder sees results and the agent user gets nothing back, or an access error. Knowledge libraries add a second requirement: the agent user needs Knowledge object access and data category visibility.
The fix is the same as the security fix. Link the space deliberately to a permission set the agent user holds, and test as the agent user, not as yourself.
A Scoping Sequence
- List the channels and the user each one runs as. An internal-only agent runs as your users; a Messaging agent runs as the agent user.
- Give the agent its own data space, or link only the spaces it needs to a permission set assigned to that agent user. Do not reuse an agent user across agents.
- Replace Allow All. Write object- and field-level policies for the agent user, then record-level policies whose criteria the agent user meets. Watch the two to three minute propagation delay when testing.
- Keep restricted files out of shared libraries, and use separate libraries where different audiences need different documents.
- Use Data 360 masking or field policies for fields the model should never see. Do not rely on the Trust Layer.
- Scope access to the audit and session tracing data as tightly as the source data.
- Retest after every policy change, as the agent user, on the real channel.
Frequently Asked Questions
Q: Does an Agentforce agent respect sharing rules when retrieving from Data 360?
A: Only on some paths. Knowledge-based retrieval checks the requesting user's access to each article, and prompt merge fields use the executing user's permissions for CRM data. Retrievers over Data 360 data follow Data 360 governance policies instead, and where the Allow All policy is active those let everything through for internal users.
Q: Is the Allow All policy really on in production orgs?
A: Salesforce's pages disagree. The governance considerations page says it is provided out of the box for both existing and new orgs. The Data 360 security architecture guide says new orgs now start in a Deny All state. Check the Data Governance policies in your own org.
Q: Do View All Records or Modify All Records bypass Data 360 policies?
A: Salesforce's pages disagree. One says users with View All Records or Modify All Records can bypass deny policies; another says those permissions don't apply when querying Data 360 data. Do not rely on either behaviour; keep View All and Modify All off agent users.
Q: Can I see exactly what an agent retrieved?
A: Yes, through Einstein Audit and Feedback data and Session Tracing in Data 360. Protect that data, because it contains the retrieved content and full prompts.
Key Takeaways
- Identity first: the channel decides whether the agent runs as your user or as the agent user.
- Data 360 has its own access model. Data spaces scope, permission sets grant features, policies decide the data.
- Check for Allow All. If it is active, replace it before you ground an agent on Data 360.
- Test record-level policies as a user they do not target. Salesforce's pages disagree on what that user sees.
- The Trust Layer is not access control. Mask and restrict in Data 360.
- Audit data is sensitive data. It holds what the agent retrieved.
What's Next?
Recommended Reading:
- Agentforce Agent User Least Privilege: What the Wizard Grants, What Your Agent Actually Needs, and How to Audit the Gap
- Audit Your Agentforce Footprint: Every Agent, Agent User, and Permission in One Pass
- Post-ForcedLeak: Hardening Agentforce Against Prompt Injection
Action Items:
- Open Data Governance in your org and check whether the Allow All policy is active.
- List the data spaces linked to each agent user's permission sets.
- Test one retrieval as the agent user on its real channel, and compare it with what the builder showed you.
Resources & References
- Salesforce Help: Agent user and run-as behaviour
- Salesforce Help: Permissions for agent actions
- Salesforce Help: Data Governance Considerations
- Salesforce Help: Get started with Data 360 data governance
- Salesforce Help: Associate data spaces with permission sets
- Salesforce Help: Create a Record-Level Policy in Data 360
- Salesforce Help: Retrievers
- Salesforce Help: Data masking for agents
- Salesforce Help: Control external user access in Data 360
- Salesforce Help: Session tracing setup
- Salesforce Architects: Data 360 security architecture
Responses
Checking your session.
Loading responses.