Skip to content

Microsoft Agent 365: Keeping Your AI Agents in Check at Runtime, Part 1

Mumbai, India | January, 2018

This is Part 1 of 2 in the third post of my Agent 365 governance series. Earlier posts covered agent identity (Blog 1) and access governance, lifecycle controls and information protection (Blog 2, Parts 1 and 2). An agent can have an approved identity and legitimate access to enterprise data while still invoking the wrong tool, processing information that should not enter an AI interaction, or behaving in ways security teams need to investigate. Runtime governance therefore needs multiple layers working together.

In this first part, I use a finance-focused Wealth Advisor Copilot to explore the identity and access boundary, because the most important question comes after deployment:

What happens when the agent is actually running?

Table of Contents

  • Start with the runtime boundary
  • Control agent access with Microsoft Entra
  • Before you start
  • Assign the Entra roles
  • Custom security attributes and the agent identity
  • Conditional Access for agent identities
  • Test the policy
  • Check the sign-in logs
  • Continue to Part 2

Start with the runtime boundary

One of the easiest mistakes in agent security is to concentrate almost entirely on the agent’s capabilities, tools, knowledge bases and others. They matter, but they aren’t a security boundary. A stronger design asks for the below:

· Which resources can each identity access?

· What information is the agent allowed to process?

· Which tools can the agent invoke?

· What happens when behaviour becomes risky?

· Can a security team reconstruct what happened afterwards?

That moves governance into enterprise controls and not just concentrate on agent build.

Control agent access with Microsoft Entra

For autonomous agents, Conditional Access can evaluate the agent identity itself when it requests an access token. Separate access patterns should be established for agents acting on behalf of users, agents using their own identity, and agents operating through agent user accounts. For autonomous access, Conditional Access targets the agent identity rather than a human user. This is important because policies that target human users don’t necessarily cover autonomous agent access and this becomes vital when agents start accessing SharePoint, APIs or MCP-based tools autonomously.

Before you start

  • A Microsoft Entra tenant where your Copilot Studio agent shows up under Entra ID → Agents → Agent identities.
  • An admin account that can assign Entra roles (the account used here is that of a Global Administrator).
  • The licence for Conditional Access in your tenant (mine is Entra ID P2).

Assign the Entra roles

Instead of maintaining long lists of individual agent identities, let us create a custom security attribute set for the finance scenario. In lifecycle-driven governance, we should select agent identities in Conditional Access based on custom security attributes. Let’s now start implementing it!

  1. Sign in to the Microsoft Entra admin centre as the Agent Governance account. Go to Entra ID → Roles & admins and search for “attribute definition administrator”. Open that role.
Microsoft Entra roles and administrators for the Agent Governance account

2. On the role’s Assignments page there are no active assignments yet. Select + Add assignments.

Attribute Definition Administrator assignments in Microsoft Entra

3. The Add assignments wizard opens on the Membership tab with the role (Attribute Definition Administrator) and scope (Directory) already set. Under Select member(s), click No member selected.

Starting a new Attribute Definition Administrator role assignment

4. Search for “agent governance”, select the Agent Governance account so it appears under Selected, then click Select.

Selecting the Agent Governance account as the role member

5. Check that Agent Governance is listed under Selected member(s), then click Next.

Reviewing the selected member before proceeding with the assignment

6. On the Setting tab, set Assignment type to Active and tick Permanently assigned. Enter a justification (for example, “For setting custom security attributes”) and click Assign.

Configuring the assignment as active and permanently assigned

7. Verify the result. Under Active assignments, Agent Governance should now appear as a Direct assignment with the state Assigned.

Verifying the completed Attribute Definition Administrator assignment

8. Go back to Roles & admins, search for “attribute assignment administrator” and open that role.

Locating the Attribute Assignment Administrator role in Microsoft Entra

9. This role has no active assignments yet either. Select + Add assignments.

Reviewing Attribute Assignment Administrator assignments

10. Confirm the role is Attribute Assignment Administrator and the scope is Directory, then click No member selected.

Starting a new Attribute Assignment Administrator role assignment

11. Search for “agent governance”, tick the Agent Governance account and click Select.

Selecting the Agent Governance account for the assignment

12. Review the selected member and click Next.

Reviewing the selected member before continuing

13. On the Setting tab, choose Active, tick Permanently assigned, add a justification and click Assign.

Configuring the Attribute Assignment Administrator assignment as active and permanent

14. Look for the green “Assigning role to member” confirmation banner in the top-right corner.

Confirmation that the Agent Governance account received the role

15. Verify the assignment. Agent Governance should now be listed under Active assignments for the Attribute Assignment Administrator role.

Verifying the completed Attribute Assignment Administrator assignment

Custom security attributes and the agent identity

  1. Return to the Microsoft Entra admin centre overview. Both attribute roles are now in place, so you can start defining the governance attributes.
Microsoft Entra admin center overview for the Agent Governance tenant

2. In the left navigation, open Custom security attributes (under Entra ID). Select Add attribute set.

Opening Custom attributes in Microsoft Entra

3. In the New attribute set pane, enter the name FinanceAgentAttributes and a short description of its purpose (classifying AI agent approval and governance status). Leave the maximum number of attributes at 25 and click Add.

Creating the FinanceAgentAttributes custom security attribute set

4. Confirm the Succeeded notification and check that FinanceAgentAttributes appears in the list. Open the new attribute set.

Confirmation that FinanceAgentAttributes was created successfully

5. Inside FinanceAgentAttributes, select Add attribute. Name it AgentApprovalStatus, add a description, set the data type to String and set Only allow predefined values to be assigned to Yes. Then click + Add value, type Draft, keep Is active ticked and click Add. Repeat for each value.

Adding predefined governance values to the AgentApprovalStatus attribute

6. Add all six lifecycle values: Draft, In_Review, Approved, Rejected, Suspended and Retired. Check that each one is marked active, then click Save.

Defining AgentApprovalStatus and restricting it to predefined values

7. Confirm the Succeeded notification. AgentApprovalStatus should now be listed as an active attribute with its predefined values.

Verifying the active AgentApprovalStatus attribute and its lifecycle values

8. Go to Entra ID → Agents → Agent identities, search for “wealth advisor” and open Wealth Advisor Copilot (Microsoft Copilot Studio).

Opening the agent identities inventory in Microsoft Entra

9. In the agent’s left menu, select Custom security attributes. No attributes are assigned yet, so click Add assignment.

Opening custom security attributes for Wealth Advisor Copilot

10. Set Attribute set to FinanceAgentAttributes, Attribute name to AgentApprovalStatus and Assigned values to Approved. Click Save.

Assigning AgentApprovalStatus to the Wealth Advisor Copilot identity

11. Confirm the “Attributes successfully changed” banner. The agent now carries AgentApprovalStatus = Approved.

Confirmation that the custom security attribute was applied successfully

Conditional Access for agent identities

  1. Return to the Microsoft Entra overview. Next, build the access control that uses this attribute.
Returning to the Microsoft Entra overview before creating access controls

2. In the left navigation, open Conditional Access → Policies and select + New policy.

Opening Conditional Access policies and starting a new policy

3. Name the policy Block unapproved finance agent identities. Under Assignments, select 0 users or agents selected, then open the What does this policy apply to? dropdown and choose Agents.

Targeting agent identities in a new Conditional Access policy

4. Under Include, select All agent identities. The policy now scopes to every agent identity.

Including all agent identities in the policy scope

5. Switch to the Exclude tab, select Select agent identities, then under Select based on attributes, click None.

Choosing to exclude agent identities based on custom security attributes

6. In the Edit filter pane, set Configure to Yes and build the rule: Attribute = AgentApprovalStatus, Operator = Equals, Value = Approved. Check the rule syntax at the bottom, then click Done. Approved agents are excluded, so every other agent is blocked.

Building the custom security attribute filter for approved finance agents

7. Under Target resources, choose Resources (formerly cloud apps) and select All resources (formerly ‘All cloud apps’).

Selecting the target resources for the Conditional Access policy

8. Under Access controls, select Grant, choose Block access and click Select.

Configuring the grant control to block access

9. Review the policy. Set Enable policy to On and click Create.

Reviewing the policy state before creation

10. Confirm the success notification. The policy appears in the list with the state On.

Confirmation that the Block unapproved finance agent identities policy was created

11. Check that Block unapproved finance agent identities is now in your Conditional Access policy list.

The new agent-focused Conditional Access policy in the policy list

12. Test the policy before you rely on it. On the Conditional Access page, open What if and set Select identity type to Agent identities.

Opening What If and selecting Agent identities as the identity type

13. Under Agent identity, select Edit agent identity.

Editing the agent identity used in the What If evaluation

14. Select the Copilot Studio agent identity you want to evaluate and click Select.

Selecting a Copilot Studio agent identity for policy evaluation

15. Under Target resource, leave the type as Cloud apps and click Select cloud app.

Adding the target resource to the What If test

16. Search for “office”, tick Office 365 SharePoint Online and click Select.

Selecting Office 365 SharePoint Online as the target resource

17. Click What If and review the Evaluation result. Under Policies that will apply, Block unapproved finance agent identities should appear with the grant control Block access.

Reviewing the What If inputs and policy evaluation result

Test the policy

  1. Now test the agent itself. In Microsoft Teams, find Wealth Advisor Copilot and click Add.
Opening Wealth Advisor Copilot in Microsoft Teams

2. Ask the agent a policy question, for example: “What is the permitted equity allocation range for a Moderate Risk client under our investment policy?” Check that it answers.

Testing the agent with an investment-policy question

Check the sign-in logs

  1. Return to the Microsoft Entra admin centre and expand Monitoring & health. Select Sign-in logs.
Returning to Microsoft Entra to inspect sign-in activity

2. Open the Service principal sign-ins tab. You should see a sign-in event for Wealth Advisor Copilot.

Agent sign-in events for Wealth Advisor Copilot

3. Select Add filter, choose Is Agent, set the value to Yes and click Apply.

Applying the Is Agent filter to the sign-in events view

4. Confirm that the Is Agent: Yes filter is active and the view shows agent sign-in events only.

Filtered sign-in events showing agent activity

Continue to Part 2

Identity tells you who the agent is and under what conditions it can access a resource, but not what the agent processes. Part 2 explores into Microsoft Purview, DLP, Agent 365 and Microsoft Defender to cover data controls, observability, hunting and runtime protection.

Richa Pandit originally posted this article on 29 November 2026 at 11:31 PM.

Leave a Reply