Skip to the stories
Microsoft 365 & SharePoint

Microsoft Entra Conditional Access Adds an Undocumented Agent Session Risk Condition

An Entra template targets high-risk agent-assisted sessions, but the risk signals are undocumented and hands-on tests didn’t trigger the condition.

Microsoft Entra Conditional Access Adds an Undocumented Agent Session Risk Condition

Agent session risk in Microsoft Entra Conditional Access

Microsoft Entra Conditional Access appears to have a way to assess risk during agent-assisted sessions. That could let administrators restrict a risky action taken by an AI agent without treating all of the user’s activity as risky. The catch for administrators: the condition isn’t available in the policy editor, Microsoft hasn’t documented its risk signals, and hands-on testing described here didn’t trigger it.

The finding came from examining Microsoft Entra Conditional Access policy templates and their exported JSON. One template, “Block assistive agent flows with high risk,” showed a configured condition in its summary, yet none of the visible condition pickers appeared selected. Inspecting the policy data exposed two properties that explain the template’s scope: agentSessionRiskLevels and agentContext.

Conditional Access template for blocking high-risk assistive agent flows

What the policy targets

The exported configuration sets agentSessionRiskLevels to high and includes allAgentAssistedFlows in agentContext. It also sets the client app type to all and uses a block grant control. These fields indicate that the template is designed to block high-risk agent-assisted flows.

That scope matters. It doesn’t describe a policy for an autonomous agent identity or a standalone agent user account. Those are separate access patterns and require their own Conditional Access configurations.

The distinction could give administrators a narrower control point. If Entra identifies an agent-assisted session as high risk, a policy could block the agent’s request while leaving the user’s own access unaffected. That is the intended operational value of session-level risk: assess the agent’s activity in context instead of applying the same decision to every action associated with the user.

The underlying schema also appears to support Low, Medium and High risk levels. However, the Entra admin center doesn’t expose a selectable agent session risk condition, and the available information doesn’t explain which signals determine a session’s level. Administrators should treat the condition’s behavior as uncertain until they can observe it in their own tenant.

Deploy the built-in template

The Entra admin center provides a starting point through its Conditional Access policy templates. To create the high-risk policy, open Entra ID, go to Conditional Access, choose the option to create a policy from a template, and select “Block assistive agent flows with high risk.” Review the configuration and create it in Report-only mode first. After validating the policy’s effects, it can be switched to On mode to block matching sessions.

Built-in Conditional Access template for high-risk agent sessions

Because the editor doesn’t show the agent-specific condition, administrators can export the created policy’s JSON and check for agentSessionRiskLevels: "high" and the allAgentAssistedFlows scope. That confirms the fields in the saved configuration; it doesn’t confirm that the risk classifier will detect a particular scenario.

Set a Medium threshold with Microsoft Graph PowerShell

The built-in template covers High risk. The source describes using Microsoft Graph PowerShell and the Graph beta endpoint to create a Report-only policy for Medium-risk agent sessions. The sample targets all users, all cloud applications and all client app types, includes all agent-assisted flows, and configures a block control. It requests Policy.Read.All and Policy.ReadWrite.ConditionalAccess scopes when connecting to Graph.

Before using the sample, administrators need a Microsoft Graph PowerShell connection with those permissions. The request creates the policy through https://graph.microsoft.com/beta/identity/conditionalAccess/policies, then prints the returned policy name, ID and state.

Connect-MgGraph -Scopes "Policy.Read.All", "Policy.ReadWrite.ConditionalAccess"

$params = @{
    displayName = "Report-only - Block Medium Risk Agent Sessions"
    state = "enabledForReportingButNotEnforced"

    conditions = @{
        clientAppTypes = @("all")
        agentSessionRiskLevels = "medium"
        agentContext = @{
            includeAgentContexts = @("allAgentAssistedFlows")
            excludeAgentContexts = @()
        }
        users = @{
            includeUsers = @("All")
            excludeUsers = @()
            includeGroups = @()
            excludeGroups = @()
            includeRoles = @()
            excludeRoles = @()
        }
        applications = @{
            includeApplications = @("All")
            excludeApplications = @()
        }
    }

    grantControls = @{
        operator = "OR"
        builtInControls = @("block")
    }
}

$policy = Invoke-MgGraphRequest `
    -Method POST `
    -Uri "https://graph.microsoft.com/beta/identity/conditionalAccess/policies" `
    -Body ($params | ConvertTo-Json -Depth 20) `
    -ContentType "application/json"

Write-Host "Policy created successfully!" -ForegroundColor Green
Write-Host "Policy Name: $($policy.displayName)"
Write-Host "Policy ID: $($policy.id)"
Write-Host "Policy State: $($policy.state)"

The reported creation succeeded using Microsoft Graph beta. Since the sample uses a beta endpoint and an undocumented condition, administrators should validate the configuration and its evaluation in their tenant before relying on it to block activity.

Detection remains unproven

In the hands-on scenarios described, the Agent Session Risk condition wasn’t triggered, including when malicious instructions were introduced. With no documented explanation of the signals involved, that result leaves an important operational question unanswered: what behaviors, if any, cause Entra to classify an agent-assisted session as risky?

For now, Report-only mode offers a way to inspect the policy’s effects before enforcement. Teams can compare the template’s High threshold with a custom Medium threshold, confirm the agent-assisted flow scope in exported JSON, and watch for evaluations in their own environment. The condition may add a useful layer to identity protection, but its practical value depends on signals and behavior that administrators still need to verify.

Source: Shanchana · blog.admindroid.com

Same flag