# Conditional Access for AI agents: secure Entra Agent ID sign-ins

> Apply Conditional Access to AI agents in Microsoft Entra: block unapproved and risky agent identities, protect agent user accounts, and keep on-behalf-of access covered by user policies.

Source: https://www.epifive.com/blog/conditional-access-ai-agent-identities · Published 2026-10-11 · EpiFive

To apply Conditional Access to AI agents, first identify how each agent gets its tokens, because the policy has to target the token's subject: the signed-in user for on-behalf-of access, the agent identity for autonomous app-only access, or the agent's user account when the agent acts as a user. Then create policies under **Users, agents or workload identities** > **Agents** that block every agent identity except approved ones, block high-risk agents using Microsoft Entra ID Protection, and start each policy in report-only mode.

## Who this is for and what you will have at the end

This guide is for identity and security administrators whose tenants now contain agents registered through Microsoft Entra Agent ID, whether they're Copilot Studio agents or agents on third-party platforms such as Amazon Bedrock or n8n that are configured with Agent ID. These agents request tokens like any other client, and without a policy they get them whenever they hold valid credentials and permissions.

At the end you will have:

- A way to map each agent to the identity Conditional Access actually evaluates.
- A report-only policy that blocks all agent identities except those you approve, using either the object picker or custom security attributes.
- A policy that blocks high-risk agent identities, and equivalent policies for agent user accounts.
- A verification routine using sign-in log filters for agents, and a list of the boundaries where Conditional Access doesn't apply.

For the wider architecture of AI workloads that call corporate data, see [the production LLMOps and enterprise RAG architecture](https://www.epifive.com/blog/production-llmops-enterprise-rag-architecture).

## How Conditional Access sees an agent

Every access token has one subject and one audience. Conditional Access evaluates both whenever Microsoft Entra ID issues or refreshes a token, and the subject depends on how the agent authenticates.

| If the agent | Access pattern | Policy target |
|---|---|---|
| Accesses downstream resources for a signed-in user | On-behalf-of (OBO), also called delegated access | Users and groups |
| Accesses resources with its own agent identity and no signed-in user | Application-only (client credentials) | Agent identity or agent identity blueprint |
| Accesses resources through its own user account | Agent-user access | The agent's user account |

Three consequences follow, and most misconfigurations come from ignoring one of them:

- **OBO access is governed by user policies.** When an agent reads a mailbox on a user's behalf, the token represents the user. Selecting the agent identity in a policy doesn't cover those requests. Your existing user policies, such as MFA and device requirements, do.
- **An agent can use more than one pattern.** A policy that targets an agent identity doesn't apply to that agent's user account, and the reverse is also true. Create a separate policy for each token subject the agent uses.
- **Blueprints act as classes.** An agent identity blueprint defines the configuration for the agent identities created from it. A policy that targets a blueprint covers all agent identities created from it, including future ones. It covers agent identities only, not agents' user accounts.

## Prerequisites

- **Licensing**: Microsoft 365 E7 (which includes Agent 365 and Microsoft Entra Suite), or a Microsoft Agent 365 license paired with at least Microsoft Entra ID P1 or Microsoft 365 E3. Agent risk-based policies need Agent 365 with Microsoft Entra ID P2 or Microsoft 365 E5.
- **Role**: at least **Conditional Access Administrator** to create policies. Viewing the Risky Agents report needs Security Administrator, Security Operator or Security Reader.
- **At least one agent identity** registered in the tenant.
- **Target resources registered in Entra ID.** Every resource the policy protects needs an enterprise application (service principal) in the tenant. That applies to Microsoft Graph, MCP servers, OpenAPI tools and custom tools. Register custom tools as applications and expose their permissions, otherwise there is nothing for Conditional Access to evaluate.
- **Security defaults turned off.** Conditional Access policies for agents don't apply while security defaults are enabled.

## Step 1: Inventory agents and how they sign in

Before writing a block policy, find out which agents are signing in and with which identity type.

1. Sign in to the Microsoft Entra admin center as at least a Reports Reader.
2. Browse to **Entra ID** > **Monitoring & health** > **Sign-in logs**.
3. Add the **Is Agent** filter and set it to **Yes**, or the **Agent type** filter and choose **Agent ID user**, **Agent Identity** or **Agent Identity Blueprint**.
4. Check both the user sign-in tabs and the service principal tab. Because agents can sign in with delegated or app-only permissions, their sign-ins can appear in any of the sign-in log types.

The same data is available from the Microsoft Graph beta endpoint. This request returns service principal sign-ins made by agent identities:

```text
GET https://graph.microsoft.com/beta/auditLogs/signIns?$filter=signInEventTypes/any(t: t eq 'servicePrincipal') and agent/agentType eq 'AgentIdentity'
```

In audit logs, agent activity appears under the underlying object type: blueprints as application events, agent identities as service principal events, and agents' user accounts as user events. The `agentType` property on `initiatedBy`, `performedBy` and `targetResources` tells you whether an event involved an agent; any value other than `notAgentic` indicates agent involvement.

Record, for each agent, its blueprint, whether it uses its own identity, a user account, or OBO, and which resources it calls. That list becomes your approval list.

## Step 2: Block agent identities you haven't approved

The recommended baseline is a block policy that includes all agent identities and excludes the approved ones. Microsoft documents two ways to express "approved".

### Option A: the enhanced object picker

1. Browse to **Entra ID** > **Conditional Access** > **Policies** and select **New policy**. Give it a name that follows your naming standard.
2. Under **Assignments**, select **Users, agents or workload identities**.
3. Under **What does this policy apply to?**, select **Agents**.
4. Under **Include**, select **All agent identities**.
5. Under **Exclude**, choose **Select individual agent identities**. Use the **All**, **Agent blueprint principals** and **Agent identities** tabs to pick the approved blueprints or individual agents, then choose **Select**.
6. Under **Target resources** > **Include**, select **All resources (formerly 'All cloud apps')**.
7. Under **Access controls** > **Grant**, select **Block**, then **Select**.
8. Set **Enable policy** to **Report-only** and select **Create**.

Excluding a blueprint rather than individual agents keeps the policy stable as new instances are created from an approved blueprint.

### Option B: custom security attributes

The object picker doesn't scale well past a handful of agents. Microsoft's recommended approach is to tag agents and resources with custom security attributes and target the attributes.

1. Create an attribute set, for example `AgentAttributes`, with an attribute `AgentApprovalStatus` that allows multiple values and only predefined values. Microsoft's example values are `New`, `In_Review`, `HR_Approved`, `Finance_Approved` and `IT_Approved`.
2. Optionally create a `ResourceAttributes` set with a `Department` attribute to tag the resources each class of agent may use.
3. Assign the attribute values to each approved agent or blueprint.
4. Create the policy as in Option A, but under **Exclude** choose **Select agent identities based on attributes**, set **Configure** to **Yes**, pick `AgentApprovalStatus`, set **Operator** to **Contains** and **Value** to the approval value, such as `HR_Approved`.
5. Target **All resources**, grant **Block**, and create the policy in **Report-only**.

Any new agent tagged with a matching value is covered automatically, and approval becomes an attribute change rather than a policy edit.

Note that agent identities support only the **Block access** control. There is no MFA or compliant-device grant for an agent signing in as itself, because no interactive remediation is possible.

## Step 3: Block high-risk agent identities

Microsoft Entra ID Protection evaluates agents for risk. Detections include a sign-in spike, unfamiliar resource access, failed access attempts against unauthorized resources, directory reconnaissance, suspicious credential usage on blueprints, early-life malicious activity, threat intelligence matches, and admin-confirmed compromise. Agent risk is in preview.

1. Create a new policy and under **Users, agents or workload identities** > **Agents**, include **All agent identities**.
2. Under **Target resources** > **Include**, select **All resources (formerly 'All cloud apps')**.
3. Under **Conditions** > **Agent risk (Preview)**, set **Configure** to **Yes** and select **High**.
4. Under **Access controls** > **Grant**, select **Block**.
5. Set **Enable policy** to **Report-only** and create the policy.

Agent risk is the only condition available when a policy targets agent identities. Investigate flagged agents in the **Risky Agents** report in ID Protection. From there you can **Confirm compromise**, which sets risk to High and triggers this policy, **Confirm safe**, **Dismiss risk**, or **Disable** the agent. Risk detections are retained for up to 90 days.

In OBO flows, risky activity is attributed to the user rather than the agent, so your existing user risk policies handle those cases.

## Step 4: Protect agents that act as users

Some agents have their own agent user account with a mailbox and Teams presence. Agent user targeting is in preview, and it has rules that differ from normal users:

- Policies that target all users, selected users, groups, directory roles or external users don't apply to agent user accounts.
- Group-based inclusion and exclusion isn't supported for agent user accounts. Use **All agent users (Preview)**, select individual agent users, or use custom security attributes.

Microsoft documents three policies for this pattern:

| Policy | Assignment | Condition | Grant |
|---|---|---|---|
| Block risky agent user accounts | **All agent users (Preview)** | **Agent risk (Preview)**: Medium and High | Block |
| Require a compliant device | **All agent users (Preview)** | **Agent execution environments (Preview)**: Agent user sessions initiated from endpoints | Require device to be marked as compliant |
| Require a compliant network | **All agent users (Preview)** | **Agent execution environments (Preview)**: Agent user sessions initiated from endpoints | Require compliant network |

Scope device and network policies with the **Agent execution environments** condition. Device compliance needs Intune enrollment, which is currently supported only on Windows 365 Cloud PCs for Agents, and a compliant network needs the Global Secure Access client. An agent running directly in cloud infrastructure has neither, so without the condition it would be blocked with no path to compliance.

## Step 5: Keep on-behalf-of access covered by user policies

Most interactive agents use OBO. The agent exchanges the user's token for a new one scoped to the downstream resource, and that exchange is evaluated by Conditional Access against the user. Review your user policies with that in mind:

- Policies that require MFA, compliant devices or session controls for users already apply when an agent acts for them.
- Resource-scoped policies, such as stricter rules for a sensitive SharePoint site or a custom API, apply to the agent's OBO tokens for that resource.
- Excluding a user or group from a policy also removes that protection from every agent acting on their behalf.

## Where Conditional Access does not apply

Conditional Access doesn't evaluate:

- An agent identity blueprint acquiring a token for Microsoft Graph to create an agent identity or agent user account. Blueprints can't access resources on their own.
- Intermediate token exchanges at the `AAD Token Exchange Endpoint: Public` resource (`fb60f99c-7a34-4190-8149-302f77469936`). Tokens for that endpoint can't call Microsoft Graph, and the agent's later token acquisition is still evaluated.
- Any tenant with security defaults enabled.
- Resources accessed with an API key or any credential that bypasses Microsoft Entra token issuance.

The last point matters for MCP servers and tools. If a tool accepts a static key, no Entra policy protects it. Register the tool as an application and require Entra tokens. The [Zero Trust remote access architecture](https://www.epifive.com/blog/zero-trust-enterprise-remote-access-architecture) applies the same principle to human access.

## Verify the policies

1. Use the **What If** tool at **Entra ID** > **Conditional Access** > **Policies** > **What If**. It can simulate a sign-in for an agent identity (preview) as well as for users and single-tenant service principals. Provide the identity, target resource, device platform and client app.
2. Let the policies run in report-only mode and open agent sign-ins in the sign-in logs. The **Report-only** tab shows results such as **Report-only: Failure** for agents the policy would block.
3. Check that every approved agent shows **Report-only: Not applied** for the block policy. If one shows failure, its blueprint or attribute is missing from the exclusion.
4. After review, switch **Enable policy** from **Report-only** to **On**.

## Troubleshooting

| Symptom | Likely cause | Fix |
|---|---|---|
| Agent still reaches data after the block policy is on | The agent uses OBO, so the user is the subject | Apply the control through user policies or the resource's policy |
| Agent user account not affected by an all-users policy | All-users assignments exclude agent user accounts | Target **All agent users (Preview)** |
| Group exclusion ignored for an agent user | Group-based scoping isn't supported for agent users | Use individual selection or custom security attributes |
| Agent user blocked by compliant device policy | Agent runs in cloud infrastructure with no device | Add **Agent execution environments** scoped to endpoint sessions |
| Agent sign-ins show no Conditional Access results | Security defaults enabled, or the resource isn't registered in Entra ID | Move to Conditional Access; register the resource as an application |
| Agent not in the exclusion picker | It isn't an Agent ID object | Confirm in the sign-in logs that its **Agent type** is populated |

Blocked agents surface the same Conditional Access failure codes as users; the guide on [AADSTS53003 blocked by Conditional Access](https://www.epifive.com/blog/aadsts53003-blocked-by-conditional-access) covers reading the policy result from the sign-in event.

## Checklist

- Each agent mapped to its token subject: user (OBO), agent identity, or agent user account.
- Licensing confirmed, security defaults off, target resources registered in Entra ID.
- Report-only block policy for all agent identities, excluding approved blueprints or attribute values.
- Report-only block policy for high-risk agent identities.
- Agent user policies for risk, compliant device and compliant network, scoped with agent execution environments.
- User policies reviewed for OBO coverage; no broad user exclusions.
- Results verified with What If and the sign-in log **Report-only** tab before enforcing.

## See also

- [Conditional Access Named Locations: Set Up Trusted IPs and Countries](https://www.epifive.com/blog/entra-conditional-access-named-locations-setup)
- [Google GTIG: AI Agents Exploit Patches, What to Check and Do Now](https://www.epifive.com/blog/google-gtig-ai-agent-exploits-patch-check)
- [Conditional Access All resources exclusions: test the 2026 change](https://www.epifive.com/blog/conditional-access-all-resources-exclusions-enforcement)

## References

- [Conditional Access for agents in Microsoft Entra](https://learn.microsoft.com/en-us/entra/identity/conditional-access/agent-id)
- [Target agent identities in Conditional Access policies](https://learn.microsoft.com/en-us/entra/identity/conditional-access/howto-target-agent-identities)
- [Secure autonomous agents with Conditional Access](https://learn.microsoft.com/en-us/entra/identity/conditional-access/policy-autonomous-agents)
- [Secure agent users with Conditional Access](https://learn.microsoft.com/en-us/entra/identity/conditional-access/policy-agent-user)
- [ID Protection for agents](https://learn.microsoft.com/en-us/entra/id-protection/concept-risky-agents)
- [Microsoft Entra Agent ID logs](https://learn.microsoft.com/en-us/entra/agent-id/sign-in-audit-logs-agents)
- [Integrate third-party agents with Microsoft Entra Agent ID](https://learn.microsoft.com/en-us/entra/agent-id/choose-agent-integration-path)
- [Conditional Access: Grant](https://learn.microsoft.com/en-us/entra/identity/conditional-access/concept-conditional-access-grant)
- [The Conditional Access What If tool](https://learn.microsoft.com/en-us/entra/identity/conditional-access/what-if-tool)
- [Analyze Conditional Access policy impact (report-only mode)](https://learn.microsoft.com/en-us/entra/identity/conditional-access/concept-conditional-access-report-only)

## Frequently asked questions

### Can Conditional Access require MFA for an AI agent?

No. When a policy targets agent identities, the only available control is Block access, because an agent signing in with its own identity can't complete interactive remediation. Policies for agent user accounts can also grant access with Require device to be marked as compliant or Require compliant network.

### Do Conditional Access policies for all users apply to AI agents?

Not to agent identities or agent user accounts. Policies that target all users don't include agents' user accounts, and agent identities are a separate assignment type. However, when an agent acts on behalf of a signed-in user, the user is the token subject, so the user's policies apply.

### What license does Conditional Access for agents need?

Microsoft 365 E7, which includes Agent 365 and Microsoft Entra Suite, or a Microsoft Agent 365 license paired with at least Microsoft Entra ID P1 or Microsoft 365 E3. Agent risk-based policies need Agent 365 with Microsoft Entra ID P2 or Microsoft 365 E5.

### Why didn't my agent Conditional Access policy apply?

The most common reasons are targeting the wrong token subject, security defaults being enabled, or the agent calling a resource with an API key instead of a Microsoft Entra token. Agent identity blueprints creating agent identities and intermediate token exchanges are also outside Conditional Access evaluation.

