On Whose Behalf? Identity and Permissions for AI Agents
When an agent files an expense, reads a customer record or merges code, three questions must have clear answers: which agent did it, for which person, and was it allowed? Today's identity systems were built for two kinds of actor: people who log in and services that run with fixed keys. Agents are neither. They act for a user, often across many apps, with permissions that should be narrower than the user's and last only as long as the task. This part explains how identity for agents is being built: delegated tokens, MCP authorization, agent directories, and the least-privilege rules that keep a hijacked agent from doing much harm.
1. Case file
2. Why agents break identity
3. Three ways to give an agent access
| Model | How | Problem |
|---|---|---|
| Shared key | Paste an API key or the user's password into the agent's config | No record of which actions were the agent's; key often has full access and never expires; leaks into context or logs |
| Agent as a service account | The agent gets its own fixed credentials | Acts as itself, so it can see data the user cannot (the confused deputy); one identity for every user |
| Delegated, scoped tokens | The user authorises the agent via OAuth; the agent gets short-lived tokens naming both user and agent, limited to specific scopes and resources | More moving parts, but this is where standards are heading |
4. Anatomy of a delegated token
What the resource sees
A simplified access token for an agent acting for a user, in the style of OAuth token exchange (RFC 8693). Toggle to compare. Our illustration.
The key fields: sub (the user), act (the agent acting for them), aud (the one resource the token is valid for), scope (what it may do) and a short exp. Microsoft describes an agent-aware on-behalf-of flow in Entra along these lines, keeping the user as subject and naming the agent in actor claims; resources can then apply both the user's and the agent's policies.
5. MCP authorization
For remote MCP servers over HTTP, the June 2025 revision of the MCP specification made the roles explicit: the MCP server is an OAuth resource server that validates tokens, while a separate authorization server (the company's identity provider) issues them. Servers publish metadata (RFC 9728) so clients can discover where to log in; tokens are bound to a specific server with resource indicators (RFC 8707), so a token for one server cannot be replayed against another. The spec also says a server must not simply pass the client's token through to downstream APIs, the pattern behind confused-deputy bugs. Later revisions adjusted client registration. Local servers running over standard input and output still take credentials from their environment, which is why sandboxing them (Part 2) matters.
6. Agent directories
Enterprises already manage people and apps in a directory; agents are being added as a third kind of entry. Microsoft Entra Agent ID registers agents as identities in the directory, so existing tools (conditional access, sign-in logs, lifecycle and ownership) apply to them. Okta's Cross App Access protocol lets an identity provider broker an agent's access from one enterprise app to another without the user clicking through consent screens app by app, with IT controlling which connections are allowed. Its standardisation work is known as ID-JAG. Within one Microsoft tenant, on-behalf-of tokens cover the case; across vendors, brokering of this kind or per-user OAuth is still needed. The direction is the same everywhere: every agent has an owner, a lifecycle and logs, just like an employee account.
7. Least privilege in practice
Build a permission set for a support agent
Tick what the agent may do. Our risk scoring: what could a hijacked agent do with this set?
8. The series
Inside the Agent Layer: eight parts
9. Reading the numbers
- Primary
- MCP authorization specification (2025-06-18 revision and later). Microsoft Entra Agent ID documentation. OAuth token exchange (RFC 8693), resource indicators (RFC 8707), protected resource metadata (RFC 9728).
- Secondary โ ๏ธ
- Okta Cross App Access availability and the Entra on-behalf-of details (third-party integration guides).
- Our illustrations
- Token example, permission builder and risk scores.