
In Part 1, we saw how Microsoft Entra can be leveraged to control which agent identities can reach resources. Custom security attributes describe an agent’s approval status, and a Conditional Access policy blocks every agent that isn’t approved. But identity only answers who the agent is and under what conditions it can reach a resource. It doesn’t answer what the agent processes once it’s in, or what it does while it runs. Runtime governance needs more layers. In this part I add three, using the finance-focused Wealth Advisor Copilot:
· Microsoft Purview for information protection and DLP
· Microsoft Agent 365 for agent inventory and observability
· Microsoft Defender for threat detection, investigation and runtime protection
The article is mostly hands-on where we build sensitivity labels, publish them, see what Copilot does with labelled content, close the gap with a DLP policy, and enable Defender’s AI agent inventory. It also covers monitoring, hunting and real-time protection, and where the Agent 365 SDK fits for a code-based agent like Portfolio Risk Monitor.
Table of Contents
· Before you start
· Protect the data separately from the identity
· Use DLP to decide what Copilot may process
· Observe the agent with Agent 365 and Defender
· Hunt across agent activity
· Runtime protection is more useful than post-incident visibility
· Complete implementation walkthrough
- Purview Information Protection and the Confidential label
- Financial-data detection and auto-labelling
- Publishing the sensitivity labels
- Applying labels and testing Copilot access
- Blocking Copilot with a DLP policy
- Defender at a glance: hunting and real-time protection
- Microsoft Defender preview features and AI agent inventory
· Conclusion
· References and further reading
Before you start
You’ll need:
· Purview: an account that can create sensitivity labels, label policies and DLP policies.
· Licensing: label-based DLP for Copilot and auto-labelling need Microsoft 365 E5-level compliance licensing. You also need a Microsoft Defender license: I used the Microsoft Defender Suite and Agent 365. Real-time protection is part of Defender for Cloud Apps.
· A Copilot Studio agent with a SharePoint knowledge source, and a SharePoint library holding a sample client document.
Plan for delays. Published label policies can take up to 24 hours to reach apps, and DLP policy changes can take up to four hours to reach Copilot.
Protect the data separately from the identity
Identity determines who or what may attempt access. It doesn’t determine whether every piece of accessible information should become part of an AI response. That’s where Microsoft Purview comes in.
For Wealth Advisor Copilot, we begin by creating sensitivity labels around investment policies and sensitive client financial information.
Sensitivity labels provide the classification
I enable sensitivity-label support for SharePoint and OneDrive, then create a label group and two labels for the Wealth Advisory scenario: Confidential, and Financial Data Detection, which automatically labels content containing credit card numbers. I published both. For the tests I also used Highly Confidential — Client Data, a label that I had created previously in my tenant.
The labels give the financial information a machine-readable classification that downstream controls such as DLP can evaluate. The full build is in the walkthrough later in this article.
Use DLP to decide what Copilot may process
A finance professional may legitimately have permission to open a client document in SharePoint. That doesn’t automatically mean the organization wants Copilot to process the same information. Purview DLP has a dedicated policy location process for this which we explore in the later sections.
Observe the agent with Agent 365 and Defender
Runtime controls are much less useful if administrators can’t see what their agents are doing. This is where Agent 365 becomes the common agent control plane. With Copilot Studio there’s an important simplification, you don’t need to instrument the agent manually to get Agent 365 observability. Microsoft says Copilot Studio agents emit observability data automatically. Invocations and tool activity flow into the Agent 365 observability backend and can surface across Microsoft 365 administration, Defender and Purview.
Bringing Copilot Studio activity into Defender
On the Defender side, the first step is switching on the AI agent inventory: turn on Defender XDR preview features, then enable Security for AI. Once it’s on, Security for AI can detect suspicious or malicious agent behaviour and support investigation of Agent 365-managed agents, using the observability data Copilot Studio emits by default.
Hunt across agent activity
Runtime visibility is most useful when agent events can be queried. In Defender’s Advanced hunting, agent activity appears as events in the CloudAppEvents table, with action types such as:
· InvokeAgent
· InferenceCall
· ExecuteToolBySDK
· ExecuteToolByGateway
· ExecuteToolByMCPServer
A starter query:
CloudAppEvents
| where ActionType in ("InvokeAgent", "InferenceCall", "ExecuteToolBySDK", "ExecuteToolByGateway", "ExecuteToolByMCPServer")
| sort by Timestamp desc
| take 50
Microsoft describes Defender as supporting near-real-time detection and investigation for AI agents managed through Agent 365.
Runtime protection is more useful than post-incident visibility
Monitoring tells you what happened. Runtime protection introduces the possibility of stopping an unsafe action before the agent completes it. Defender can bring runtime security controls into specific stages of the agentic loop, with current Copilot Studio protection focused on tool invocations. Defender’s real-time protection for Copilot Studio agents is currently in preview. For Copilot Studio specifically, it evaluates tool invocations before the agent executes them and blocks the ones it judges to be a threat.
Two things to know before you rely on it. Real-time protection is part of Defender for Cloud Apps, so it needs the right licensing. And if the Microsoft 365 connector isn’t connected, Defender still blocks suspicious activity, but the alerts and incidents won’t appear in the Defender portal.
Complete implementation walkthrough
Each section below is a hands-on tutorial with screenshots. Follow the steps in order. Menus and preview features change often, so your screens may differ slightly.
Purview Information Protection and the Confidential label
- Open the Microsoft Purview portal (purview.microsoft.com). Use the app launcher or the Solutions page to see the available solutions.

2. Go to Settings → Solution settings → Information Protection. Under Co-authoring for files with sensitivity labels, tick Turn on co-authoring for files with sensitivity labels and click Apply. This also enables sensitivity-label support for SharePoint and OneDrive.

3. Back on Solutions, select Information Protection.

4. In the Information Protection menu, select Sensitivity labels.

5. Review the existing labels and label groups. Select Create → Label group.

6. Name the group Agent 365 — Wealth Advisory, set the display name, and add a description for users (for example, labels for information accessed, processed or generated by the Wealth Advisor agent). Click Next.

7. Review the settings and click Create label group.

8. Confirm that the label group was created. Choose Don’t create a label yet and click Done.

9. Select the new Agent 365 — Wealth Advisory group, open its ⋮ menu and choose Create label in group.

10. Name the label Confidential and set the display name. Add a description for users and one for admins covering internal investment policies, portfolio information and client-related business information. Click Next.

11. On the scope page, select Files & other data assets and click Next.

Step 12. Under protection settings, tick Apply content marking and leave Control access unticked. Click Next.

13. Turn on Content marking, tick Add a footer and select Customize text. Enter CONFIDENTIAL — WEALTH ADVISORY as the footer text and click Save.

14. Check that the footer text now shows under Add a footer, then click Next.

15. Leave auto-labeling for files and emails switched off for this label. Click Next.

16. Leave the groups and sites protection settings at their defaults. Click Next.

17. Review the label settings (scope, content marking and footer) and click Create label.

18. Confirm that the label was created. Choose Don’t create a policy yet and click Done.

Financial-data detection and auto-labelling
- On Sensitivity labels, select the Agent 365 — Wealth Advisory group again, open its ⋮ menu and choose Create label in group.

2. Name the label Wealth Advisory — Financial Data Detection. Add a description explaining that it automatically identifies Wealth Advisory files and emails containing sensitive financial information and recommends the Confidential label. Click Next.

3. Select Files & other data assets and Emails, then click Next.

4. Select Apply content marking and click Next.

5. Turn on Content marking, select Add a footer and select Customize text. Enter CONFIDENTIAL — SENSITIVE FINANCIAL INFORMATION and click Save.

6. Check the footer text under Add a footer, then click Next.

7. Turn on Auto-labeling for files and emails. Under Content contains, select Add → Sensitive info types, search for “credit card”, tick Credit Card Number and click Add.

8. Set the confidence level to High confidence and the instance count to 1 to Any. Under When content matches these conditions, choose Automatically apply the label. Add a message for users, for example: “Sensitive financial information was detected. The Confidential label has been automatically applied to help protect this content.” Click Next.

9. Leave the groups and sites protection settings at their defaults. Click Next.

10. Review the label settings, including the auto-labeling rule, and click Create label.

11. Confirm that the label was created. Choose Don’t create a policy yet and click Done. You will publish it in the next section.

Publishing the sensitivity labels
- On Sensitivity labels, tick the Wealth Advisory label you created and select Publish label.

2. On Assign admin units, leave the scope as Full directory and click Next.

3. Choose the sensitivity labels to publish. Tick both Wealth Advisory labels (Confidential and Financial Data Detection), click Add and then Next.

4. Review the admin-unit scope (Full directory) and click Next.

5. On Publish to users and groups, confirm the location and scope (Exchange email, All users & groups) and click Next.

6. On Policy settings, leave the optional requirements unticked for this pilot. Click Next.

7. Documents: leave the default label as None and click Next.

8. Emails: leave the default label as Same as document and click Next.

9. Meetings and calendar events: leave the default label as None and click Next.

10. Fabric and Power BI content: leave the default label as None and click Next.

11. Name the policy Wealth Advisory Sensitivity Label Pilot and add a description. Click Next.

12. Review the policy details (name, labels, users and groups) and click Submit.

13. Confirm the New policy created message. It can take up to 24 hours for the labels to reach users’ apps. Click Done.

Applying labels and testing Copilot access
- Open the SharePoint finance lab site and go to the Wealth Advisor library. Select the client investment document, WA-POL-001.

2. Open the document in Word and apply the Highly Confidential — Client Data label from the Sensitivity button on the Home tab. This is an existing label in my tenant, not one of the two created above. The label name appears at the top of the window.

3. Open Wealth Advisor Copilot in Teams and ask: “What sensitive client financial information is available in the Wealth Advisor SharePoint site?” Look closely at the answer. The agent still returns client details, because a label classifies content but does not by itself stop the agent from using it. That gap is what the DLP policy closes.

While the label test above showed a crucial gap: the agent still returned client details, we can close it creating a DLP policy to hide portfolio/client investment data, similar to how we created one in earlier blog “Block-Financial-PII-Copilot” which blocks credit card number.
Defender at a glance: hunting and real-time protection
Here is the hunting workflow at a glance.
- Sign in to the Microsoft Defender portal and go to Investigation & response → Hunting → Advanced hunting.
- Use the AgentsInfo table (under Agents) to build KQL queries over your custom Copilot Studio agents.

Microsoft Defender preview features and AI agent inventory
- Open the Microsoft Defender portal and go to Setup & configuration → Settings.

2. Select Microsoft Defender XDR → Preview features and turn Preview Features On.

3. Back on the Settings page, open Security for AI.

4. Under Assets, select AI agents, then click Enable security for AI to turn on the Copilot Studio AI agent inventory.

Conclusion
The biggest lesson from this build is that the controls already responsible for enterprise identity, information protection and threat response are being extended to agents.
Entra decides who the agent is and under what conditions it can access a resource.
Purview understands the sensitivity of the information and determines whether AI can process it.
Agent 365 gives the organisation a common inventory and observability plane.
Defender watches what happens at runtime and can intervene when agent behaviour becomes unsafe.
References and further reading
The following Microsoft Learn resources provide current product guidance for the controls discussed in this article:
· Conditional Access for Agents in Microsoft Entra
· Target agent identities in Microsoft Entra Conditional Access policies
· Enable sensitivity labels for files in SharePoint and OneDrive
· Use sensitivity labels as conditions in DLP policies
· Observability integration for Copilot Studio
· Discover AI agents and assess security posture using Microsoft Defender
· Protect AI agents in real time using Microsoft Defender


