- Home
- AI agents
- Security threats to agents
- Data protection for agents
Govern and secure · Security threats to agents
Data protection for AI agents: DLP, labels, residency and retention
Data protection for AI agents means controlling what data an agent can read, what it may send to a model or a tool, where that processing happens, and how long prompts, outputs and logs are kept. The agent inherits every permission mistake the company already has, so most of the work starts with permissions and labels.
In this guide: 83 pages
Key takeaways
- An agent that searches for a user surfaces whatever that user can reach, and finds it fast. Fix oversharing first; Microsoft's Restricted Content Discovery hides chosen SharePoint sites from Copilot and org-wide search without changing permissions while you clean up.
- Masking often stops at the model. Bedrock Guardrails PII masking does not apply to model invocation logs, tool-call arguments, tool results or tool definitions, and tool calls are where agent data moves.
- Residency depends on the endpoint you call. Global inference profiles and global endpoints can process anywhere, and Microsoft states that Anthropic models in Microsoft 365 Copilot sit outside the EU Data Boundary.
- Vendor retention changed in 2026. Amazon Bedrock now has explicit data retention modes, and some newer models require a mode in which AWS may keep prompts and completions for up to 30 days for human review.
Why do agents make oversharing worse?
Because an agent that retrieves on behalf of its user reads with that user's permissions and searches faster and wider than the user ever would, so content that was overshared but never found now turns up in answers. The permission model is the boundary, and the model provider cannot see it.
Microsoft's guidance is to run data risk assessments before switching agents on. The Purview assessment scans the top 100 SharePoint sites every week by default, with custom item-level scans for the rest, and the fixes are links, labels and permissions. Restricted Content Discovery hides chosen sites from org-wide search and Copilot without touching their permissions; it needs a Copilot licence and SharePoint Advanced Management, and propagation for sites with more than 500,000 items can take over a week.
Labels travel with content when they carry encryption. Copilot and agents return encrypted, labelled content only when the user holds both the EXTRACT and VIEW usage rights; new content Copilot creates inherits the highest-priority label among its sources; Double Key Encryption content is never accessible to Copilot. Mind the gaps: items do not inherit container labels set on Teams, sites or groups, and Copilot does not recognize Teams meeting and chat labels.
Custom agents need the same boundary built in. For retrieval agents, Azure AI Search can enforce Purview labels at query time, and Foundry IQ runs queries under the caller's Entra identity; the permission-aware retrieval page of this guide covers the design.
Where should DLP sit for an agent?
At the AI boundary in both directions, on the prompt and on the response, and at every tool call that carries data out. Most products cover the first two well and the tool call poorly, so the tool call is where you add your own check.
Data loss prevention control points for an agent, with what each cloud offers on 2 Nov 2026 and the gap the vendor documents.
| Control point | Microsoft | AWS | Google Cloud | Documented gap |
|---|---|---|---|---|
| Prompt | Purview DLP for Microsoft 365 Copilot blocks prompts with sensitive information types (preview, rolling out) | Bedrock Guardrails sensitive information filters block, mask or detect, set separately for input and output | Model Armor with Sensitive Data Protection templates | Copilot DLP cannot scan files uploaded straight into a prompt |
| Grounding | Exclude labelled files and emails from Copilot; block web search grounding for sensitive prompts; exclude external email (preview) | Find sensitive data in S3 knowledge sources with Amazon Macie | Not covered by a DLP feature on the pages we read | Excluded items can still appear in citations |
| Response | Generated content inherits the highest-priority source label | Guardrails output filters | Model Armor response screening | Copilot DLP policy changes take up to four hours to apply |
| Tool call | Defender real-time protection blocks secret exfiltration on tool calls (Foundry and Copilot Studio agents in preview) | AgentCore Policy can apply Guardrails at the gateway (July 2026) | Model Armor on Agent Gateway (GA 24 Jun 2026) | Bedrock Guardrails masking does not evaluate tool arguments, results or definitions |
| Custom apps | Purview policies for Foundry apply only to calls carrying user context; app-only calls get audit only | The ApplyGuardrail API, callable from any app | Model Armor called by your app | Foundry apps without user context get Purview audit only |
For custom agents, pass the user's context so Microsoft's data security policies apply, and add your own check on tool arguments for the data classes that must never leave. Bedrock Guardrails masking stops short of the tool call, and the tool-call checks in the table work only where you configure them.
Where does an agent's data get processed and stored?
Wherever the endpoint you call sends it, which can differ from the region you deployed in. Pick regional or geographic endpoints on purpose, block the global ones by policy where residency matters, and check each third-party model you add.
On Amazon Bedrock, geographic cross-Region inference profiles (us, eu, apac, in) keep processing within a geography while data at rest stays in the source Region, and CloudTrail logs each request in the source Region with additionalEventData.inferenceRegion showing where it ran. A global profile is about 10% cheaper and can route to any commercial Region; block it with a service control policy on the bedrock:InferenceProfileArn condition where residency matters.
On Google Cloud, regional or jurisdictional endpoints (us, eu) keep machine learning processing in that jurisdiction; the eu multi-region excludes the UK and Switzerland, and the global endpoint carries no residency guarantee. Gemini caches data for up to 24 hours by default, which can be disabled, and Grounding with Google Search stores queries for up to three days with no opt-out.
Microsoft 365 Copilot is an EU Data Boundary service for EU customers, with two exceptions to plan around: models provided by Anthropic as a subprocessor are excluded from the boundary, and Multi-Geo tenants fall outside its scope. Copilot Cowork has its own at-rest commitment for 15 countries and regions.
What do vendors keep, and what must you be able to delete?
It depends on the store. Model vendors publish retention modes, Microsoft keeps Copilot prompts in user mailboxes under Purview retention, and your own logs, traces and memory stores keep whatever you configure. Set a retention period for each store, make one person's records findable, and write both into the data protection impact assessment.
Amazon Bedrock now has explicit data retention modes (none, default, aws_review and the legacy provider_data_share) that a service control policy can enforce. In aws_review, AWS may keep prompts and completions for up to 30 days and have people review them without sharing content with the model provider; some newer models require that mode, and with cross-Region inference the retained data sits in the destination Region. Model providers have no access to the accounts where Bedrock runs their models, or to its logs, prompts or completions.
Microsoft stores Copilot and AI app prompts and responses in hidden folders in each user's Exchange mailbox, under Purview retention locations for Microsoft Copilot experiences, enterprise AI apps and other AI apps. eDiscovery can search and purge them, ten items per mailbox per run and only after holds are removed, and a delete-after-one-day policy can take about 16 days to purge fully. Deleting a Copilot conversation does not delete the Copilot memory tied to it; the memory privacy and retention page of this guide covers agent memory in depth.
Your own stores need the same treatment. The EU AI Act asks providers and deployers of high-risk systems to keep automatically generated logs for at least six months unless Union or national law, in particular data protection law, says otherwise; the Commission's AI Act page puts those duties at 2 Dec 2027 for Annex III uses. Pseudonymize identities in traces where you can: AWS recommends pairwise subject identifiers to keep personal data out of AgentCore Gateway entries in CloudTrail.
How do Microsoft, AWS and Google implement it?
Residency, vendor retention and risky-use detection on each cloud, as the vendor pages showed on 2 Nov 2026.
Capability, Microsoft, AWS, Google
| Capability | Microsoft | AWS | |
|---|---|---|---|
| Keep processing in a region | EU Data Boundary for Microsoft 365 Copilot, excluding Anthropic models and Multi-Geo tenants | Geographic cross-Region inference profiles; SCP on bedrock:InferenceProfileArn | Regional or jurisdictional endpoints instead of global |
| What the vendor keeps | Prompts, responses and Graph data not used to train foundation models; Copilot opted out of Azure OpenAI abuse-monitoring human review | Retention modes none, default and aws_review (up to 30 days) | Cache of up to 24 hours by default; Search grounding queries kept up to three days |
| Detect risky use | Insider Risk Management Risky AI usage template; Risky Agents template (preview) | Amazon Macie for sensitive data in S3 knowledge sources | Model Armor with Sensitive Data Protection inspection |
In-country processing commitments for Microsoft 365 Copilot could not be confirmed on Microsoft pages for this review, so this page states only the at-rest and EU Data Boundary positions.
Frequently asked questions
Do Microsoft, AWS and Google train models on our agent prompts?
Their documentation for these enterprise services says no. Microsoft says prompts, responses and data accessed through Microsoft Graph are excluded from training its foundation models; AWS says model providers have no access to Bedrock prompts or completions; Google says it does not train on customer data without permission. Retention for abuse monitoring or review is a separate question, covered above.
Is a DPIA required for an AI agent?
Often, under GDPR Article 35, when the agent processes personal data at scale or helps make decisions about people, and for high-risk systems the EU AI Act links the deployer's information duties to that assessment in Article 26(9). The EDPB consulted on a DPIA template from 14 Apr to 9 Jun 2026. Include the agent's memory, logs and traces alongside its prompts.
Are embeddings and memory summaries anonymous data?
Usually not, and treating them as anonymous without testing leaves GDPR fully in scope. The EDPB's draft anonymisation guidelines of 8 Jul 2026 set three criteria: no singling out of records, no linkage and no inference. Its Opinion 28/2024 says identifying people from a model, or extracting their data, must be very unlikely before a model counts as anonymous.
Which data protection check should come first before an agent goes live?
An oversharing check on the sources the agent will search, with the worst sites fixed first. An agent that searches for a user returns what that user can already reach, so a stale link shared with everyone on a finance site becomes an answer in a chat. Restricted Content Discovery can hide a site from Copilot while its permissions are cleaned up.
More in Security threats to agents
Sources
Each source was read on 2 November 2026. The date shown is the date on the page, or the page’s ms.date for Microsoft Learn; an undated page shows the date it was read.
- Data Security Posture Management for AI (classic)
- Restricted Content Discovery
- Microsoft Purview considerations for Microsoft 365 Copilot
- Learn about the Microsoft 365 Copilot DLP policy location
- Microsoft Purview for Microsoft Foundry
- Retention policies for Copilot and AI apps
- Search and delete Copilot and AI app data with eDiscovery
- Insider Risk Management policy templates
- Data, privacy and security for Microsoft 365 Copilot
- Data residency for Microsoft 365 Copilot
- What is the EU Data Boundary?
- Real-time protection for AI agents
- Data protection in Amazon Bedrock
- Data retention in Amazon Bedrock
- Cross-Region inference
- Sensitive information filters (Bedrock Guardrails)
- AgentCore release notes
- AgentCore Gateway inbound authorization
- Data residency for generative AI
- Data governance for generative AI
- Model Armor overview
- Model Armor release notes
- Regulatory framework for AI (AI Act)
- Article 19: Automatically generated logs
- Guidelines, recommendations and best practices (consultations)
- EDPB sheds light on anonymisation and web scraping for generative AI
- EDPB opinion on AI models: GDPR principles support responsible AI
Planning an AI program?
Talk to the team that builds it and runs it after launch.
- Built to SOC 2, HIPAA and GDPR standards
- EU AI Act-aligned delivery
- Microsoft Solutions Partner