К основному содержанию
скилл Claude Code GitHub Copilot

entra-agent-id · microsoft — скилл для Claude Code: что делает и как установить

Помогает создавать и настраивать идентификаторы ИИ-агентов с поддержкой OAuth2 через Microsoft Graph beta API. Пригодится при настройке сервисных учетных записей в Microsoft Entra.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add microsoft/skills --skill entra-agent-id -a claude-code
Открыть на GitHub

Что делает entra-agent-id

Скилл содержит инструкции и примеры вызовов для управления сущностями Microsoft Entra Agent ID. Он описывает создание Agent Identity Blueprint, обязательного BlueprintPrincipal и конкретных инстансов Agent Identity. Все операции выполняются исключительно через эндпоинты Microsoft Graph /beta и требуют обязательного заголовка OData-Version: 4.0.

В правилах зафиксированы технические ограничения API. Спонсорами агента могут выступать только пользователи: объекты ServicePrincipal и группы сервис отклоняет. Аутентификация через DefaultAzureCredential не поддерживается из-за маркера Directory.AccessAsUser.All, вызывающего ошибку 403. Для взаимодействия требуется отдельная регистрация приложения с потоком client_credentials или модуль PowerShell с явными делегированными разрешениями.

Инструмент нужен тем, кто проектирует запуск автономных агентов или контейнерных sidecar-модулей в облаке Microsoft. Если ваша инфраструктура не использует Entra ID, ставить скилл нет смысла.

Какие задачи решает

  • создать Agent Identity Blueprint через Microsoft Graph beta API
  • зарегистрировать BlueprintPrincipal для связки сущностей агента
  • выпустить сервисные учетные записи Agent Identity для инстансов
  • привязать спонсоров-пользователей к учетным записям агента

Примеры запросов агенту

  • Создай Agent Identity Blueprint для нового агента через Python
  • Зарегистрируй BlueprintPrincipal для существующего blueprint app_id
  • Как выпустить Agent Identity для инстанса с привязкой спонсора-пользователя?

Как установить entra-agent-id

1Через Skills CLI (Vercel)

npx skills add microsoft/skills --skill entra-agent-id -a claude-code

2Вручную: положить файлы

~/.claude/skills/entra-agent-id/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/entra-agent-id/

Из того же набора18

Весь набор →
Planner microsoft Planner изучает требования и кодовую базу, затем составляет план реализации без изменения кода. Подойдёт, если перед работой нужно определить затронутые файлы и этапы. Claude Code GitHub Copilot 406установок frontend-design-review microsoft Скилл проверяет и создаёт интерфейсы с учётом дизайна, доступности и дизайн-системы. Подходит для ревью UI, PR и адаптивной вёрстки. Claude Code GitHub Copilot 237установок deploy microsoft Запускает развёртывание проверенных IaC-шаблонов в Azure и проверяет состояние ресурсов. Срабатывает автоматически на четвертом шаге оркестратора azure-app-onboard. Claude Code GitHub Copilot 126установок microsoft-docs microsoft Скилл отвечает на вопросы о технологиях Microsoft через официальную документацию. Подойдёт для туториалов, настроек, лимитов и разбора концепций. Claude Code GitHub Copilot 118установок cloud-solution-architect microsoft Превращает ИИ-агента в архитектора облачных решений по стандартам Azure Architecture Center. Помогает выбирать архитектурные стили и проверять дизайн систем по правилам WAF. Claude Code GitHub Copilot 117установок mcp-builder microsoft Пошаговое руководство по созданию MCP-серверов на TypeScript, Python и C# для интеграции сторонних API с языковыми моделями. Claude Code GitHub Copilot 108установок skill-creator microsoft Помогает создавать и обновлять скиллы для AI-агентов, особенно для Azure SDKs и Microsoft Foundry. Пригодится, когда нужен понятный каркас навыка. Claude Code GitHub Copilot 106установок continual-learning microsoft Скилл учит агента запоминать ошибки, паттерны и проектные соглашения между сессиями. Без него каждый запуск — с чистого листа; с ним агент накапливает опыт и работает точнее. Claude Code GitHub Copilot 79установок

Другие версии entra-agent-id

Похожие

iso27001-audit-prep Alireza Rezvani Проверяет готовность ISMS к аудиту по ISO 27001. Запускает жёсткий опросник из 6 тем перед сертификацией, надзором или внутренним аудитом. Claude Code 22установок fda-qsr-audit-prep Alireza Rezvani Скилл проводит проверку готовности к аудиту FDA QSR через 6 вопросов. Подходит для внутреннего аудита, инспекции FDA и ответа на Form 483. Claude Code 17установок openai-platform-api-key официальный OpenAI Проверяет доступ к ключу OpenAI перед работой с AI-приложением и помогает безопасно настроить OPENAI_API_KEY. Пригодится для проектов на API OpenAI. CX Codex GP ChatGPT 16установок propose-security-hardening официальный OpenAI Скилл превращает данные о уязвимостях и результаты сканирования в варианты архитектурного усиления. Подойдёт, когда патча для отдельной находки недостаточно. CX Codex GP ChatGPT 13установок vercel-firewall официальный Vercel Labs Скилл ведёт агента по настройке Vercel Firewall: кастомные правила WAF, блокировка IP, rate limiting, Attack Mode и CLI vercel firewall. CX Codex GP ChatGPT 12установок auth официальный Vercel Labs Помогает подключить Clerk, Descope или Auth0 к Next.js и настроить вход, регистрацию и защиту маршрутов. CX Codex GP ChatGPT 8установок git-guardrails-claude-code Matt Pocock Скилл ставит хук Claude Code, который останавливает опасные Git-команды до их запуска. Нужен, если агент не должен делать push или удалять изменения. Claude Code 499 069установок ponytail-review DietrichGebert Скилл проверяет изменения глубже обычного diff: читает связанный код, ищет ошибки, риски, проблемы нагрузки и недостающие тесты. Пригодится для ревью PR и коммитов. Claude Code CX Codex Cursor +1 56 300установок

Вопросы о entra-agent-id

Как установить entra-agent-id в Claude Code?

Выполните в терминале команду npx skills add microsoft/skills --skill entra-agent-id -a claude-code.

Что делает entra-agent-id?

Скилл предоставляет справочник вызовов и сценарии для создания OAuth2-идентификаторов ИИ-агентов в Microsoft Graph beta API.

Почему нельзя использовать DefaultAzureCredential?

Токены Azure CLI содержат разрешение Directory.AccessAsUser.All, которое Graph beta API блокирует с кодом 403. Нужна отдельная регистрация приложения или вызов Connect-MgGraph.

Исходный текст

SKILL.md · MIT
---
name: 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 `/beta` only. 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)

```powershell
# Requires PowerShell 7+
Install-Module Microsoft.Graph.Beta.Applications -Scope CurrentUser -Force
```

### Python (for programmatic provisioning)

```bash
pip install azure-identity requests
```

### Required Entra Roles

One of: **Agent Identity Developer**, **Agent Identity Administrator**, or **Application Administrator**.

## Environment Variables

```bash
AZURE_TENANT_ID=<your-tenant-id>
AZURE_CLIENT_ID=<app-registration-client-id>
AZURE_CLIENT_SECRET=<app-registration-secret>
```

## Authentication

> **⚠️ `DefaultAzureCredential` is NOT supported.** Azure CLI tokens contain
> `Directory.AccessAsUser.All`, which Agent Identity APIs explicitly reject (403).
> You MUST use a dedicated app registration with `client_credentials` flow or
> connect via `Connect-MgGraph` with explicit delegated scopes.

### PowerShell (delegated permissions)

```powershell
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)

```python
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 = credential.get_token("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.

```python
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",
    "[email protected]": [
        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.`

```python
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

```python
agent_body = {
    "@odata.type": "Microsoft.Graph.AgentIdentity",
    "displayName": "my-agent-instance-1",
    "agentIdentityBlueprintId": app_id,
    "[email protected]": [
        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:
```bash
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):
```bash
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

```python
# 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

1. **Always create BlueprintPrincipal after Blueprint** — not auto-created; implement idempotent checks on both
2. **Use User objects as sponsors** — ServicePrincipals and Groups are rejected
3. **Handle permission propagation delays** — after admin consent, wait 30–120s; retry with backoff on 403
4. **Include `OData-Version: 4.0` header** on every Graph request
5. **Use Workload Identity Federation for production auth** — for local dev, use a client secret on the Blueprint (see [references/oauth2-token-flow.md](references/oauth2-token-flow.md))
6. **Set `identifierUris` on Blueprint** before using OAuth2 scoping (`api://{app-id}`)
7. **Never use Azure CLI tokens** for API calls — they contain `Directory.AccessAsUser.All` which is hard-rejected
8. **Check for existing resources** before creating — implement idempotent provisioning

## References

| File | Contents |
|------|----------|
| [references/oauth2-token-flow.md](references/oauth2-token-flow.md) | Production (Managed Identity + WIF) and local dev (client secret) token flows |
| [references/known-limitations.md](references/known-limitations.md) | 29 known issues organized by category (from official preview known-issues page) |
| [references/sdk-sidecar.md](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 |

© microsoft · MIT · microsoft/skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой