Securing Agents using the Entra Platform
By Rojan Koc, Cloud Security Architect (Note that this is purely written and designed with my own personal perspective and does not represent the views, policies, or official position of my employer or any affiliated organization.)
As AI systems take on increasingly autonomous and user-delegated responsibilities, the identities representing those agents, Microsoft Entra Agent IDs - become integral components of the enterprise identity fabric that covers both Human and Non-Human Identities. Agent IDs authenticate to resources, hold permissions, execute workflows, and may act on behalf of users or systems or perform tasks totally anonymous. Because they operate as first-class identities, they must be governed with the same guardrails as human and workload identities.
Microsoft Entra Agent ID and Agent ID Blueprints provide a security and governance model purpose-built for managing agent identities at scale. The following guidance and Diagram represents the end-to-end lifecycle and security flow for an Agent ID within Microsoft Entra ID on what is actually supported as of today. It shows how an Agent ID is created, governed, authenticated, evaluated for risk, and monitored across the Entra platform.
Prefer Strong, Non-Human Credential Strategies for Agent IDs
Microsoft Entra Agent ID supports secure, non-human credential models appropriate for autonomous or semi-autonomous agents. Supported credential types include:
Microsoft explicitly discourages long-lived secrets. Secrets if used must be tightly governed, short-lived, and rotated frequently.
Establish Agent ID Blueprint Categories for Consistent Governance
Agent ID Blueprints define the expected security baseline and metadata for every Agent ID created from them. Blueprints ensure that each Agent ID receives:
Supported blueprint elements include:
Blueprints help ensure uniform onboarding and governance before the agent requests for a bearer token to access the resource server.
Use the Agent Registry for Discovery and Governance
All Agent IDs appear in the Agent Registry, a dedicated catalog within Microsoft Entra that provides:
The registry improves transparency by treating agents as structured, governable identities rather than ad-hoc workload accounts, without an parent identity which the "Blueprint principal" acts as.
Recommended by LinkedIn
Agent Collection as part of the Agent Registry provides you an overview of Global (Allowed Agents) and Quarantined (Disallowed agents) which in the essence depict if an Agent is exposed to the end-user or not.
Govern Agent IDs with Entra Identity Governance
Agent IDs can be governed and controlled by Microsoft Entra Identity Governance capabilities besides being added to a Registry:
Key governance goals include:
Use Identity Protection and CA for Risky Agents
Microsoft Entra Identity Protection extends its threat detection model to risky agents, providing:
Supported signals focus on behavioral anomalies and misuse patterns—not user-centric signals like password spray or sign-in behavior.
Expand Logging and Monitoring for Agent ID Activity
Microsoft supports full audit and monitoring visibility for Agent IDs through:
KQL to detect OAuth Permissions Grant & PIM Assignments for Agents (Feel free to modify or adjust it to meet your needs)
AuditLogs
| where TimeGenerated >= ago(365d)
| where OperationName in~ (
"Add OAuth2PermissionGrant",
"Add v2 application permissions",
"Add app role assignment to service principal")
| extend ActorUPN = tostring(InitiatedBy.user.userPrincipalName), ActorApp = tostring(InitiatedBy.app.displayName),
SpId = tostring(TargetResources[0].id),
SpDisplayName = tostring(TargetResources[0].displayName),
AppType = tostring(TargetResources[0].type)
| where SpDisplayName has_any ("agent", "ai", "gpt", "copilot", "assistant") or ActorApp has_any ("agent", "ai", "gpt", "copilot", "assistant")
| project TimeGenerated, OperationName, SpDisplayName, ActorApp
| order by TimeGenerated desc
This query detects when AI or agent-type service principals receive new OAuth API permissions. It analyzes the past 365 days of AuditLogs for operations that add OAuth permissions or app roles, including the type of permission or role granted and which agent identity was involved. I recommend using App Governance in Microsoft Defender for Cloud Apps (MCAS) to detect risky, high-impact, or unused critical permissions and to build a periodic operational review-cycle to mitigate these findings and assess their impact.
This will be useful.
Very useful article!
Great explanation! But my tenant still has no any agent id for my agents created in Microsoft Foundry, what should I do?
Great post!
Great summary ❤️