Agentforce Data Leakage: 7 Permission and Grounding Gaps to Close Before Go-Live

An AI agent behind a secure data access gate, with only selected records passing through

A go-live checklist often covers functional testing, tone, and whether the agent completes its tasks. It can miss the harder question: what data can the agent reach, and what can it do with that data?

That’s not a minor oversight. Gartner’s 2027 CIO Agenda survey, published in October 2026, reports that only 21% of enterprises have an AI agent governance framework. Close the permission and grounding gaps below before your Agentforce launch, not after an agent has access to customer records.

1. Running user: permissions that are too broad

What teams do: They assign an administrator as the running user to avoid permission troubleshooting during development, or give an agent a broad service identity.

Why it leaks: Every agent runs as a running user. That user’s permissions determine what the agent can query, change, and do across the platform. An administrator running user can give the agent effective access across the org. New agents start with no permissions, so access should be granted deliberately, not overcorrected.

The fix: Give each agent a dedicated integration user and minimum permission sets. After launch, use Event Monitoring to review which granted permissions the agent actually exercised, then remove unused ones; Setup Audit Trail records configuration changes, not runtime permission use. See Salesforce’s running-user guidance.

2. PII masking: assuming the Trust Layer filters agent data

What teams do: They assume the Einstein Trust Layer will mask sensitive fields before an agent sends context to a model.

Why it leaks: Salesforce disables pattern-based and field-based PII masking for agents because masked context can make responses inaccurate or irrelevant. Masking is available for embedded generative AI features, such as prompt templates used directly, but that does not mean agent prompts are masked. Fields stay out of an agent’s prompt only when the running user’s field-level security and permission sets keep them out.

The fix: Send only the fields and data the agent needs. Verify field-level security and permissions on the agent user, and review the agent’s grounding context, not just its prompt. Salesforce explains the limitation in its Trust and Agentforce guidance.

A least-privilege identity key allowing an agent to access only selected record cards

3. Actions: Apex and Flow running beyond the user’s access

What teams do: They add an Apex action or Flow and assume it automatically enforces the running user’s record and field permissions.

Why it leaks: Custom actions can have a different security context. Apex declared without sharing bypasses record-level sharing; code running in system mode bypasses field-level security. Flows can also run in system mode. And when Flow A calls Flow B, which calls an external API, the external system sees the identity on the named credential, not necessarily the end user. That creates both an elevation-of-privilege and traceability risk.

The fix: Verify every Apex action uses with sharing or inherited sharing unless system context is deliberate and documented. Map Flow chains and external callouts end to end, including the identity each downstream system receives.

4. Channels and identities: external access through a shared account

What teams do: They embed an agent in a custom web or mobile app, Slack, or a partner kiosk, then rely on Salesforce to carry the end user’s identity automatically.

Why it leaks: On an external surface, the host application must establish and pass identity explicitly. Salesforce documents an elevated service account invoked by a guest user as an anti-pattern: it can turn anonymous access into a backdoor to a privileged identity. Client credentials exposed in a browser also represent one shared service identity, not a verified individual user.

The fix: Authenticate the host, pass the end user’s identity through, and keep client credentials server-side. For external customer agents, use a dedicated, least-privilege Agent User. Review the complete identity path against Salesforce’s Agentforce trust architecture.

5. Authorization surface: vague scope and unverified private actions

What teams do: They use broad Classification Description or Scope fields, or make customer-specific actions available before confirming who the customer is.

Why it leaks: Classification Description and Scope shape which requests a subagent handles and what it can do. Editing either can change agent behavior without a code deployment. A description such as “answer any question about customer data” invites requests the designer may not have anticipated. Separately, a private action, one taken for a specific customer, can expose that customer’s information if a caller can simply claim to be them.

The fix: Write narrow descriptions and scopes that state what the agent may handle and what it must not do. Put a customer-verification step, such as a verification subagent, in front of every private action.

An agent filtering untrusted document content before it reaches its reasoning

6. Grounding and injection: treating CRM text as trusted instructions

What teams do: They ground an agent in customer-submitted text, conversation history, Knowledge, or indexed documents without treating that content as untrusted input.

Why it leaks: Permissions control which records an agent can read, not what those records contain. Fields such as Case Description, Email Body, chat and messaging transcripts, and Survey Response can carry adversarial instructions through Email-to-Case, Web-to-Case, inbound email, live chat, or survey submissions. Knowledge articles, Data 360 indexed documents, and external retrieval sources can remain injection surfaces for as long as they are indexed. Conversation history is untrusted too, and records one agent writes can become a second-order injection surface for another agent.

The fix: Separate instructions from data architecturally; don’t concatenate record content into instructions. Vet retrieval sources and test adversarial inputs, including requests for another user’s records. Treat Salesforce CRM data as a managed security surface with Salesforce data management solutions that support trusted, governed access.

7. MCP and tool surfaces: exposing more than the agent needs

What teams do: They activate broad MCP tools, use unrestricted queries, grant an app a wide API scope, or let a shared external identity stand in for every caller.

Why it leaks: Salesforce Hosted MCP calls run as the authenticated user, so CRUD permissions, field-level security, and sharing apply, but only if the exposed surface is appropriately scoped. An overbroad tool set increases the potential impact of compromise or injection. With outbound MCP to a non-Salesforce system, a shared system identity gives every caller the same privileges, and the external audit trail shows the integration user unless real-user identity is also logged.

The fix: Activate only intended hosted MCP servers; prefer a use-case-scoped server or Named Query over an all-objects server and unrestricted SOQL. Create a dedicated External Client App per MCP client using the mcp_api scope rather than the full api scope, and restrict access to pre-authorized users through a permission set. Shorten the refresh-token lifetime from its one-year default and revoke tokens through OAuth Usage when needed. Annotate tools with readOnlyHint or destructiveHint where appropriate, while remembering client support is optional. For sensitive outbound operations such as deletes and updates, require step-up re-authentication; log the real user when a shared identity is used.

Check the monitoring settings too: Find hosted MCP traffic in Setup → Event Log File Browser → API Total Usage, filtering API_CLIENT_CATEGORY for SALESFORCE_HOSTED_MCP. Event Monitoring retention is one day without the Event Monitoring add-on or Shield, and up to 365 days with Shield. Turn Enrich event logs with conversation data on in development and off in production; when enabled, it stores full transcripts. When off, logs show “Sensitive data not available.” Agentforce Session Tracing logs turn-by-turn reasoning and is off by default.

A narrow gateway exposing only selected tools to an authenticated AI agent

Before you go live

  • Confirm each agent has a dedicated, least-privilege running user.
  • Verify that sensitive fields never enter prompts or grounding context.
  • Review Apex, Flow, named credentials, and identity transitions end to end.
  • Narrow agent scopes, verify customers before private actions, and test adversarial content.
  • Expose only required MCP tools; confirm logging and production transcript settings.

Close the gaps before launch. NextEd Consulting provides CRM strategy consulting and Salesforce consulting services for teams preparing to deploy and scale Salesforce. Get in touch to schedule a permission and grounding review before your Agentforce go-live.