Entra Agent ID permission managemen

DesignerMike Intermediate 5/14/2026 261 views 0 likes 2 min read

Our team spent the last three months wrestling with Entra ID (formerly Azure AD) permissions because we tried to scale our internal AI agents without a proper governance strategy. We started by giving our "productivity bots" broad application permissions just to get them working, but we quickly hit a wall when the security team noticed a single agent had read access to every single user profile and group in the entire tenant.

Entra Agent ID permission managemen

We shifted to a "Least Privilege" model using custom App Roles, which is the only way to stay sane when you have more than five agents running. Instead of slapping on User.Read.All, we defined specific roles within the App Registration. This allowed us to assign the agent to specific security groups rather than giving it a blanket pass to the whole directory.

The adoption process was a tug-of-war between the devs (who wanted everything enabled to avoid 403 errors) and the IT admins (who wanted to lock everything down). The breakthrough happened when we automated the permission request flow. We stopped manually clicking through the Azure Portal and moved to a Terraform-based approach for managing Service Principals.

Here is a simplified snippet of how we define the app role in our configuration to ensure the agent only sees what it needs:

{
  "id": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
  "isEnabled": true,
  "value": "Agent.ReportReader",
  "description": "Allows the AI agent to read specific report metadata"
}

The biggest win in terms of speed was the onboarding of new agents. Once the permission templates were set in Terraform, spinning up a new bot with the correct Entra identity took ten minutes instead of two weeks of emails back and forth with the Global Admin.

However, the pushback was real. The legacy IT crowd hated the idea of "non-human identities" having any level of autonomy. They were terrified of a prompt injection attack leading to a data leak via the Graph API. To solve this, we implemented strict conditional access policies. We restricted the agent's identity to only be callable from our specific internal VNet IP ranges.

Current State of our Setup:

Identity Type: We use Managed Identities for Azure resources whenever possible to avoid managing client secrets that expire and break the workflow.

Permission Scope: We moved from Application permissions (which are dangerous) to Delegated permissions where the agent acts on behalf of the logged-in user, ensuring the AI can't see anything the human user couldn't see themselves.

Audit Trail: We piped Entra sign-in logs for the Agent IDs into a Log Analytics workspace. This way, if an agent starts making 10,000 calls a minute to the Graph API, we get a Slack alert immediately.

The lesson here is that AI implementation is 20% prompt engineering and 80% identity and access management. If you don't nail the Entra ID side, your project will either be a security nightmare or get killed by the IT department before it ever hits production.

Related examples in this direction are worth a look in these real-world AI monetization case studies, with plenty of directly applicable cases.

All Replies (0)

No replies yet — be the first!

Write a Reply

Markdown supported