$npx -y skills add vinayaklatthe/microsoft-security-skills --skill agent-identity-governanceGuidance for governing the identities of AI agents and non-human identities (NHIs) — Microsoft 365 Copilot Studio agents, Microsoft Foundry agents, custom AI agents, and traditional service principals/managed identities — through their full lifecycle. Covers ownership and tagging
| 1 | # AI Agent & Non-Human Identity Governance |
| 2 | |
| 3 | AI agents — Microsoft 365 Copilot Studio agents, Microsoft Foundry agents, custom-built |
| 4 | ones, plus traditional service principals and managed identities — are now the |
| 5 | fastest-growing identity population in most tenants. They authenticate, hold permissions, |
| 6 | act on behalf of users (or themselves), and are usually under-governed. |
| 7 | |
| 8 | This skill is the lifecycle governance layer for those identities: ownership, scoping, |
| 9 | credential hygiene, reviews, decommissioning, and incident response. |
| 10 | |
| 11 | ## When to use |
| 12 | Establishing or maturing governance for the agent / NHI population — Copilot Studio |
| 13 | agents, Foundry agents, custom LLM agents, and the service principals that back them. |
| 14 | |
| 15 | **Do not use this skill** for workload identity federation patterns alone |
| 16 | (`entra-workload-identity`), human identity governance (`entra-id-governance`), or |
| 17 | generic agent build guidance. |
| 18 | |
| 19 | ## Agent identity inventory — know what you're governing |
| 20 | |
| 21 | | Class | Identity model | Surface | |
| 22 | |---|---|---| |
| 23 | | **Copilot Studio agent (M365)** | Tenant-scoped agent identity + per-user delegated permissions | M365 admin center / Copilot Studio | |
| 24 | | **Microsoft Foundry agent** | Service principal + managed identity + per-user OBO | Azure portal / Foundry | |
| 25 | | **Custom AI agent (your code)** | App registration + workload identity federation / managed identity | Entra admin center | |
| 26 | | **Plugin / connector** | Service principal + delegated/app Graph permissions | Entra admin center | |
| 27 | | **Legacy automation service principal** | App registration, often with secret | Entra admin center | |
| 28 | |
| 29 | ## Approach |
| 30 | |
| 31 | 1. **Inventory and tag.** Pull every app registration, service principal, and Copilot |
| 32 | Studio / Foundry agent. Tag each with: |
| 33 | - **Owner** (person + group). |
| 34 | - **Sponsor / business owner**. |
| 35 | - **Purpose** (one sentence). |
| 36 | - **Data scope** (which tenants/sites/mailboxes/resources). |
| 37 | - **Lifecycle stage** (pilot / production / sunset). |
| 38 | - **Criticality** (tier 0 / 1 / 2). |
| 39 | Orphaned identities → freeze them; require owner re-claim. |
| 40 | |
| 41 | 2. **Scope permissions tightly.** |
| 42 | - Microsoft Graph: prefer **Sites.Selected** over `Sites.Read.All`, **mailbox |
| 43 | scoping via Application Access Policy** over `Mail.Send`, custom security |
| 44 | attributes over broad directory roles. |
| 45 | - Azure: scope role assignments at RG or resource, never subscription Owner unless |
| 46 | truly required. |
| 47 | - Copilot Studio agent knowledge sources: explicit site/library lists, not "All |
| 48 | SharePoint." |
| 49 | - Foundry agent tools: only the tools needed; remove `http` plugin unless |
| 50 | necessary. |
| 51 | |
| 52 | 3. **Credential hygiene.** No client secrets in new builds — federated credentials |
| 53 | (GitHub Actions, Azure DevOps, AKS, external OIDC) or certificates with auto-rotation |
| 54 | via Key Vault. Existing secrets: inventory, cap expiry at 180 days, rotate via |
| 55 | automation, plan migration to federation. |
| 56 | |
| 57 | 4. **Conditional Access for workloads** (Workload Identities Premium). Apply to |
| 58 | tier-0 agents and externally-callable agents: |
| 59 | - Restrict source IP ranges. |
| 60 | - Block legacy auth. |
| 61 | - Require named locations. |
| 62 | Don't try to apply to every SP in the tenant — focus on high-blast-radius identities. |
| 63 | |
| 64 | 5. **Access reviews for agents** via Entra ID Governance. Owner reviews per quarter: |
| 65 | - Still needed? |
| 66 | - Still the right scope? |
| 67 | - Credential rotation up to date? |
| 68 | - Owner / sponsor still in role? |
| 69 | Auto-disable on owner non-response. |
| 70 | |
| 71 | 6. **Lifecycle workflows.** Build automation for: |
| 72 | - **Provisioning**: owner-initiated request → approval → SP created with template |
| 73 | permissions, tagged, owner assigned. |
| 74 | - |