entra-agent-id
Microsoft Entra Agent ID (preview) for creating OAuth2-capable AI agent identities via Microsoft Graph beta API. Covers Agent Identity Blueprints, BlueprintPrincipals, Agent Identities, required permissions, sponsors, and Workload Identity Federation.
Install / Use
npx skills add microsoft/skills --skill entra-agent-idInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
OperationsSupported Platforms
Our assessment of entra-agent-id
entra-agent-id scores 93/100 on our quality scale, 154th of 746 Operations skills we index (top 21%).
Its SKILL.md is 9.2 KB long, well organised into 26 sections with 12 code examples: a thorough specification that gives an agent plenty to work with.
With 3,051 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so entra-agent-id is actively maintained.
- Our last check on 2026-10-26 found the source still online.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit β read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-09-29. Automated pattern scan on 2026-09-29. It catches known dangerous patterns, not every risk β read a skill before letting an agent act on it.
entra-agent-id compared with similar skills
All 4 of these similar skills score higher than entra-agent-id; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| entra-agent-id (this skill)by microsoft | 93 | 3.1k | 54d ago | SKILL.md |
| Agent-Reachby Panniantong | 100 | 112.3k | 9d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 79.8k | today | CLAUDE.md |
| Scraplingby D4Vinci | 100 | 103.6k | 2d ago | MCP Server |
| crawl4aiby unclecode | 100 | 87.4k | 3d ago | MCP Server |
Frequently asked questions
- How do I install entra-agent-id?
- Run
npx skills add microsoft/skills --skill entra-agent-id. The install tabs above show the steps for each supported agent. - Which AI agents does entra-agent-id work with?
- It is written for Zed, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is entra-agent-id safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is entra-agent-id still maintained?
- The repository was last updated about 2 months ago, so entra-agent-id is actively maintained.
Skill content
View source on GitHubname: entra-agent-id description: | Microsoft Entra Agent ID (preview) for creating OAuth2-capable AI agent identities via Microsoft Graph beta API. Covers Agent Identity Blueprints, BlueprintPrincipals, Agent Identities, required permissions, sponsors, and Workload Identity Federation. Includes Microsoft Entra SDK for AgentID (containerized sidecar) for polyglot agent authentication (Docker/Kubernetes), 3P agent integration, autonomous and interactive agent patterns. Triggers: "agent identity", "agent id", "Agent Identity Blueprint", "BlueprintPrincipal", "entra agent", "agent identity provisioning", "Graph agent identity", "entra sidecar", "agent id sidecar", "auth sidecar", "3P agent", "third-party agent identity", "polyglot agent auth".
Microsoft Entra Agent ID
Create and manage OAuth2-capable identities for AI agents using Microsoft Graph beta API.
Preview API β All Agent Identity endpoints are under
/betaonly. Not available in/v1.0.
Before You Start
Search microsoft-docs MCP for the latest Agent ID documentation:
- Query: "Microsoft Entra agent identity setup"
- Verify: API parameters match current preview behavior
Conceptual Model
Agent Identity Blueprint (application) β one per agent type/project
βββ BlueprintPrincipal (service principal) β MUST be created explicitly
βββ Agent Identity (SP): agent-1 β one per agent instance
βββ Agent Identity (SP): agent-2
βββ Agent Identity (SP): agent-3
Prerequisites
PowerShell (recommended for interactive setup)
# Requires PowerShell 7+
Install-Module Microsoft.Graph.Beta.Applications -Scope CurrentUser -Force
Python (for programmatic provisioning)
pip install azure-identity requests
Required Entra Roles
One of: Agent Identity Developer, Agent Identity Administrator, or Application Administrator.
Environment Variables
AZURE_TENANT_ID=<your-tenant-id>
AZURE_CLIENT_ID=<app-registration-client-id>
AZURE_CLIENT_SECRET=<app-registration-secret>
Authentication
β οΈ
DefaultAzureCredentialis NOT supported. Azure CLI tokens containDirectory.AccessAsUser.All, which Agent Identity APIs explicitly reject (403). You MUST use a dedicated app registration withclient_credentialsflow or connect viaConnect-MgGraphwith explicit delegated scopes.
PowerShell (delegated permissions)
Connect-MgGraph -Scopes @(
"AgentIdentityBlueprint.Create",
"AgentIdentityBlueprint.ReadWrite.All",
"AgentIdentityBlueprintPrincipal.Create",
"User.Read"
)
Set-MgRequestContext -ApiVersion beta
$currentUser = (Get-MgContext).Account
$userId = (Get-MgUser -UserId $currentUser).Id
Python (application permissions)
import os
import requests
from azure.identity import ClientSecretCredential
credential = ClientSecretCredential(
tenant_id=os.environ["AZURE_TENANT_ID"],
client_id=os.environ["AZURE_CLIENT_ID"],
client_secret=os.environ["AZURE_CLIENT_SECRET"],
)
token = credβ¦[redacted]("https://graph.microsoft.com/.default")
GRAPH = "https://graph.microsoft.com/beta"
headers = {
"Authorization": f"Bearer {token.token}",
"Content-Type": "application/json",
"OData-Version": "4.0", # Required for all Agent Identity API calls
}
Core Workflow
Step 1: Create Agent Identity Blueprint
Sponsors are required and must be User objects β ServicePrincipals and Groups are rejected.
import subprocess
# Get sponsor user ID (client_credentials has no user context, so use az CLI)
result = subprocess.run(
["az", "ad", "signed-in-user", "show", "--query", "id", "-o", "tsv"],
capture_output=True, text=True, check=True,
)
user_id = result.stdout.strip()
blueprint_body = {
"@odata.type": "Microsoft.Graph.AgentIdentityBlueprint",
"displayName": "My Agent Blueprint",
"sponsors@odata.bind": [
f"https://graph.microsoft.com/beta/users/{user_id}"
],
}
resp = requests.post(f"{GRAPH}/applications", headers=headers, json=blueprint_body)
resp.raise_for_status()
blueprint = resp.json()
app_id = blueprint["appId"]
blueprint_obj_id = blueprint["id"]
Step 2: Create BlueprintPrincipal
This step is mandatory. Creating a Blueprint does NOT auto-create its service principal. Without this, Agent Identity creation fails with:
400: The Agent Blueprint Principal for the Agent Blueprint does not exist.
sp_body = {
"@odata.type": "Microsoft.Graph.AgentIdentityBlueprintPrincipal",
"appId": app_id,
}
resp = requests.post(f"{GRAPH}/servicePrincipals", headers=headers, json=sp_body)
resp.raise_for_status()
If implementing idempotent scripts, check for and create the BlueprintPrincipal even when the Blueprint already exists (a previous run may have created the Blueprint but crashed before creating the SP).
Step 3: Create Agent Identities
agent_body = {
"@odata.type": "Microsoft.Graph.AgentIdentity",
"displayName": "my-agent-instance-1",
"agentIdentityBlueprintId": app_id,
"sponsors@odata.bind": [
f"https://graph.microsoft.com/beta/users/{user_id}"
],
}
resp = requests.post(f"{GRAPH}/servicePrincipals", headers=headers, json=agent_body)
resp.raise_for_status()
agent = resp.json()
API Reference
| Operation | Method | Endpoint | OData Type |
|-----------|--------|----------|------------|
| Create Blueprint | POST | /applications | Microsoft.Graph.AgentIdentityBlueprint |
| Create BlueprintPrincipal | POST | /servicePrincipals | Microsoft.Graph.AgentIdentityBlueprintPrincipal |
| Create Agent Identity | POST | /servicePrincipals | Microsoft.Graph.AgentIdentity |
| List Agent Identities | GET | /servicePrincipals?$filter=... | β |
| Delete Agent Identity | DELETE | /servicePrincipals/{id} | β |
| Delete Blueprint | DELETE | /applications/{id} | β |
All endpoints use base URL: https://graph.microsoft.com/beta
Required Permissions
| Permission | Purpose |
|-----------|---------|
| Application.ReadWrite.All | Blueprint CRUD (application objects) |
| AgentIdentityBlueprint.Create | Create new Blueprints |
| AgentIdentityBlueprint.ReadWrite.All | Read/update Blueprints |
| AgentIdentityBlueprintPrincipal.Create | Create BlueprintPrincipals |
| AgentIdentity.Create.All | Create Agent Identities |
| AgentIdentity.ReadWrite.All | Read/update Agent Identities |
There are 18 Agent Identity-specific Graph application permissions. Discover all:
az ad sp show --id 00000003-0000-0000-c000-000000000000 \
--query "appRoles[?contains(value, 'AgentIdentity')].{id:id, value:value}" -o json
Grant admin consent (required for application permissions):
az ad app permission admin-consent --id <client-id>
Admin consent may fail with 404 if the service principal hasn't replicated. Retry with 10β40s backoff.
Cleanup
# Delete Agent Identity
requests.delete(f"{GRAPH}/servicePrincipals/{agent['id']}", headers=headers)
# Delete BlueprintPrincipal (get SP ID first)
sps = requests.get(
f"{GRAPH}/servicePrincipals?$filter=appId eq '{app_id}'",
headers=headers,
).json()
for sp in sps.get("value", []):
requests.delete(f"{GRAPH}/servicePrincipals/{sp['id']}", headers=headers)
# Delete Blueprint
requests.delete(f"{GRAPH}/applications/{blueprint_obj_id}", headers=headers)
Best Practices
- Always create BlueprintPrincipal after Blueprint β not auto-created; implement idempotent checks on both
- Use User objects as sponsors β ServicePrincipals and Groups are rejected
- Handle permission propagation delays β after admin consent, wait 30β120s; retry with backoff on 403
- Include
OData-Version: 4.0header on every Graph request - Use Workload Identity Federation for production auth β for local dev, use a client secret on the Blueprint (see references/oauth2-token-flow.md)
- Set
identifierUrison Blueprint before using OAuth2 scoping (api://{app-id}) - Never use Azure CLI tokens for API calls β they contain
Directory.AccessAsUser.Allwhich is hard-rejected - Check for existing resources before creating β implement idempotent provisioning
References
| File | Contents | |------|----------| | references/oauth2-token-flow.md | Production (Managed Identity + WIF) and local dev (client secret) token flows | | references/known-limitations.md | 29 known issues organized by category (from official preview known-issues page) | | references/sdk-sidecar.md | Microsoft Entra SDK for AgentID β endpoints, 3P agent patterns, Docker/K8s deployment, security |
External Links
| Resource | URL | |----------|-----| | Official Setup Guide | https://learn.microsoft.com/en-us/entra/agent-id/identity-platform/agent-id-setup-instructions | | AI-Guided Setup | https://learn.microsoft.com/en-us/entra/agent-id/identity-platform/agent-id-ai-guided-setup | | Microsoft Entra SDK for AgentID β Overview | https://learn.microsoft.com/en-us/entra/msidweb/agent-id-sdk/overview | | Microsoft Entra SDK for AgentID β Endpoints | https://learn.microsoft.com/en-us/entra/msidweb/agent-id-sdk/endpoints |
Related Skills
Agent-Reach
112.3kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu β one CLI, zero API fees.
headroom
79.8kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Scrapling
103.6kπ·οΈ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
crawl4ai
87.4kOfficial Crawl4AI Cloud: a hosted web scraping, extraction, and search API for AI agents. Free API key, 1,000 credits a month, no card. Fully open source: this repo is the Apache-2.0 crawler that powers it, and you can self-host it.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit β see the Safety scan above for what the skill file itself contains.
