Insights

Data Foundations for AI Agents

How Do You Govern and Mask Customer Data Used to Ground AI Agents?

Akshit KandiDecember 6, 2026 5 min read

Short answer

Govern and mask grounding data by giving the agent a dedicated least-privilege user, removing fields it never needs, enabling masking for personal data in prompts, excluding restricted content from search indexes, separating data with Data 360 data spaces where required, and logging prompts, retrieved content and actions for audit.

  • →Least privilege first: data the agent cannot read can never leak.
  • →Masking protects prompts, but over-masking breaks tasks; design it per field.
  • →Search indexes need governance too: internal and personal content must be excluded.
  • →Log what the agent could see and did, so you can answer auditors and customers.

The question security teams ask about AI agents is simple: what customer data can it see, and where does that data go? Answering it well is not one control. It is a stack of them, from permissions to masking to audit, each covering a different way data could be exposed. Designed in from the start, the stack adds little friction. Bolted on after an incident, it is painful.

This article focuses on the data the agent is given to answer questions, which is where most customer data exposure happens. Action controls, such as what records an agent may update, follow the same least-privilege logic and are covered in our broader governance work.

Where can grounding data leak?

Grounding is the data an agent retrieves and gives to the model at answer time: profile fields, records, knowledge passages. There are four main exposure points.

Exposure pointExamplePrimary control
Over-broad accessAgent can read tax IDs it never needsLeast-privilege permission set
Sensitive values in promptsFull card or health details sent to a modelMasking, field exclusion
Wrong person’s dataMerged profiles reveal another customer’s orderIdentity rules, verification
Restricted content in indexesInternal commercial notes or past case emails retrievedIndex scoping, metadata filters

Data masking (for AI)

Replacing sensitive values such as names, emails, phone numbers or account numbers with placeholders before a prompt is sent to a model, and restoring them in the response where needed.

Illustrative example
Prompt log · What the model receives after masking
prompt 1# Grounding block as sent to the model 2Customer: <PERSON_1> 3Email: <EMAIL_1> 4Phone (last 4 for verification): 0198 5Order: #48213, delivered 2026-11-28 6Loyalty tier: Gold 7Policy passage: Returns Policy v3, section 2.1 8  9# Removed entirely by field permissions10# card number, tax ID, internal case notes11 12Task: confirm return eligibility and next step.
Illustrative. Identifiers become placeholders; the action layer restores them, so the model never needs the raw values.

What controls does Salesforce provide?

On Salesforce, the layers typically include object and field permissions for the agent’s running user; sharing rules for record access; data spaces and access policies in Data 360 (formerly Data Cloud) to separate brands, regions or business units; and the Einstein Trust Layer, which can mask personal data in prompts, applies zero data retention commitments with supported model providers, and keeps an audit trail. Which features are included, and which data types masking recognizes, vary by edition and release, so check your contract and current documentation. When you connect Claude or other models outside Agentforce, through APIs or MCP, you need to build equivalent controls into that integration yourself.

Control stack for agent grounding

Audit and logging

Prompts, retrieved content and actions recorded and reviewable.

Masking

Sensitive values replaced before reaching the model.

Index scoping

Only approved, customer-safe content is retrievable.

Data spaces and policies

Partitions by brand, region or unit in Data 360.

Least-privilege access

The agent user reads only fields its tasks need.

How do you design masking that does not break the agent?

Masking has a cost: an agent cannot reason about a value it cannot see. If the agent must confirm the last four digits of a phone number, masking the whole number breaks verification. If it must compare two addresses, masking both makes comparison impossible. Design per field and per task:

Test masking with real conversation samples, not synthetic ones. Real messages contain personal data in unexpected places: a customer pastes their address into a question, mentions a medical condition, or includes a card number in a complaint. Check that masking catches these in free text as well as in structured fields, and decide what the agent should do when a customer volunteers sensitive data it should not store.

  • Never needed: remove access entirely. Card numbers, government IDs and health notes usually belong here.
  • Needed for an action, not for reasoning: pass the value to the action directly (for example a flow that updates a record) instead of through the prompt.
  • Needed for reasoning: allow it, or pass a derived value such as the last four digits or a yes or no match result.
  • Personal but low risk: first names and order numbers often help the conversation; mask by policy if your compliance team requires it, and test the agent still works.

What should you check before launch?

Grounding governance checklist
  • The agent runs as a dedicated user with a minimal, documented permission set
  • A field-by-field list shows what the agent can read and why
  • Masking is enabled and tested with real conversation samples
  • Search indexes exclude internal-only content and personal data from past cases
  • Data spaces separate data that must not mix, such as brands or regions
  • Identity verification is required before account-specific disclosure
  • Prompts, retrieved content and actions are logged with retention aligned to policy
  • A named approver signs off any new data source or field for the agent

SkySync practice

We keep a data access register for every agent we run: which fields and indexes it can read, why, who approved it and when. Any change goes through the same review as a prompt or action change, and masking is retested after each release. That register is what we hand clients when auditors ask. The broader model is in the AI agent governance whitepaper.

What about Claude agents connected through MCP?

Many teams now connect Claude to Salesforce data through APIs or the Model Context Protocol (MCP), for internal analysts as well as customer-facing use. The same principles apply, but more of the controls are yours to build, because the agent is not running inside the Agentforce trust boundary.

  • Scope the integration user. The connected app or integration user should have the same least-privilege permission set you would give an Agentforce agent.
  • Limit the tools. Expose specific, named tools (look up an order, create a case) rather than open query access to every object.
  • Filter before sending. Strip or mask sensitive fields in the tool response, before it reaches the model, not in the prompt instructions.
  • Log tool calls. Record which tool was called, with what inputs and what data came back.
  • Check the commercial terms. Confirm data retention and training terms for the model plan you use.

Our Claude and Salesforce integration playbook covers the architecture in more depth.

How do you keep governance current after launch?

Most exposure creeps in after launch, not at it. Someone adds a field “to help the agent,” a new document set is indexed, or a data stream brings in a new source. Treat every data change to an agent as a release, with a reviewer and a record. Review the access register quarterly, sample logs monthly for sensitive values that slipped through masking, and recheck index contents whenever a new content source is added. For the data layer this governance sits on, see the data foundation whitepaper and grounding agents in knowledge articles and PDFs.

Frequently asked questions

Does the Einstein Trust Layer mean I do not need other controls?

No. The Trust Layer protects data on the way to and from the model, including masking and zero data retention with supported providers. It does not decide what the agent can read in the first place. Least-privilege permissions, index scoping and identity verification are still your responsibility.

Do model providers keep our grounding data?

Under Salesforce’s Trust Layer arrangements with supported providers, and under enterprise API terms from providers such as Anthropic and OpenAI, customer data is generally not used to train models and retention is limited. Confirm the specific terms in your contracts, because they differ by product and plan.

How do we prove to an auditor what the agent saw?

Keep three records: the agent’s permission set and data access register over time, logs of prompts with retrieved content and actions, and evidence of masking tests. Together they show what the agent could see, what it actually used, and that sensitive values were protected.

Should internal knowledge be in the same index as customer content?

Generally no for customer-facing agents. Keep a separate index or use reliable metadata filters so internal notes, escalation guides and commercial terms cannot be retrieved in a customer conversation. Internal agents for employees can use a broader index with appropriate permissions.

Go deeper

The Data Foundation AI Agents Need: Data 360, Snowflake and Identity

What to connect, unify, clean and lock down before a customer-facing agent goes live

  • ✓The 5C Data Foundation: Connected, Clean, Consolidated, Contextual and Controlled
  • ✓Who does what between your CRM, Data 360 and Snowflake, in one layered picture
  • ✓A decision matrix for when to federate Snowflake data with zero-copy and when to ingest it
  • ✓Identity resolution rules that let an agent recognize a returning customer on any channel
Free whitepaper

Download the whitepaper

By continuing you agree to be contacted by SkySync about this material.

More on Data Foundations for AI Agents