Skip to main content
All posts
Cybersecurity19 min read

AI Agent Identity: Workload Identity and Token Exchange

How to give AI agents their own identity: workload identity, on-behalf-of and RFC 8693 token exchange, with scope narrowing at every hop and no secrets.

Published Updated: 15 November 2026

In April 2026 Microsoft declared its Entra Agent ID platform generally available, with agent identity blueprints, per-agent identities, named human sponsors and agent versions of the on-behalf-of flow. AWS shipped on-behalf-of token exchange for Bedrock AgentCore Identity on 30 April. On 22 June the IESG approved the IETF's cross-domain identity-chaining draft. And the MCP specification's 2026-07-28 revision restated, in capital letters, that an MCP server "MUST NOT accept or transit any other tokens."

Platforms and standards bodies have converged on one answer within a few months. An AI agent needs its own identity. When it acts for a person, it needs a token that says so and can do less than that person can. This article is for the people who must turn that into architecture: CISOs, identity architects, platform leads and agent builders on Azure, AWS or Google Cloud.

TL;DR / Key takeaways

  • Agents are a new kind of non-human identity. They are not service principals and not users. They decide at run time what to call, which breaks the assumptions behind both.
  • Identity first, secrets never. The agent proves who it is with a managed identity, federated credential or SPIFFE ID. Leaked secrets stay valid for years.
  • Exchange, don't forward. At every hop, trade the incoming token for one with a single audience and fewer scopes, via RFC 8693 or your IdP's on-behalf-of flow.
  • The act claim is your audit trail. Delegation tokens name the user as subject and the agent as actor, so the API and the log can tell them apart.
  • Policy lives at the token service. Conditional Access, lifetime caps, sponsorship and revocation work at issuance. An API key bypasses all of them.
OAuth token exchange for an AI agent. The user stays the subject, the agent and the MCP server become actors, and each token is re-issued for one audience with fewer scopes. Numbers 1–6 match the sections below.
OAuth token exchange for an AI agent. The user stays the subject, the agent and the MCP server become actors, and each token is re-issued for one audience with fewer scopes. Numbers 1–6 match the sections below.

Download: Editable draw.io file · Open in diagrams.net · Chart data (CSV)

Why this matters now

Non-human identities already dominate. Idira by Palo Alto Networks, which now publishes CyberArk's Identity Security Landscape series, surveyed more than 2,900 security decision-makers for its 2026 Identity Security Landscape. It reports that machine identities, "including AI agents", outnumber humans 109 to 1. Entro Labs, using its own customer telemetry, reported 144 to 1 for the first half of 2025. Different methods, same order of magnitude.

Agents make this worse twice over. Every agent, tool server and sub-agent needs an identity. And unlike a service account running the same code nightly, an agent picks its next API call from a prompt that may contain text from an email or a web page. The OWASP Non-Human Identities Top 10 for 2025 names what we keep finding: overprivileged NHIs, long-lived secrets, NHI reuse and improper offboarding.

The secrets problem is measurable. GitGuardian's State of Secrets Sprawl 2026 counted 28.65 million new hardcoded secrets in public GitHub commits in 2025, with AI-service secrets up 81%. It found 24,008 unique secrets in MCP configuration files alone. And more than 64% of credentials it had confirmed valid in 2022 were still valid in January 2026. A leaked agent secret is not a short incident. It is a door that stays open for years.

The pattern, hop by hop

The hero diagram shows one realistic chain. A user asks an agent to summarise their open support tickets. The agent calls a ticketing MCP server, which calls the ticketing system's REST API. The numbers match the callouts.

Loading diagram...

① The user signs in once, and the token names the agent

The user authenticates to the client app, ideally with phishing-resistant MFA, and the client receives T0. Its audience is the agent: not Microsoft Graph, not the ticket API, not "everything". This first narrowing step is the one most often skipped. Hand the agent a broad Graph token "because it might need mail later", and every later hop starts from the widest possible point.

Entra Agent ID makes this explicit. Its on-behalf-of documentation says the user token must be issued to the agent identity blueprint, and a token for another resource such as Microsoft Graph is rejected. Agents cannot start interactive /authorize flows. Consent is configured on the blueprint and inherited by its agent identities.

② The agent proves who it is, without a secret

Before acting for anyone, the agent must prove its own identity. This workload identity layer is where most estates carry their worst debt. From best to worst:

  • Platform-issued identity: a managed identity on Azure, an IAM role on AWS, a Google Cloud service identity or a SPIFFE ID from SPIRE. The platform attests the workload and issues short-lived credentials. Google's Agent Identity is built on SPIFFE and gives each agent an X.509 certificate valid for 24 hours, renewed automatically.
  • Federated credential: the workload presents a token from a trusted issuer, such as a Kubernetes service account or GitHub Actions OIDC token, and nothing is stored. Our workload identity federation guide covers the set-up.
  • Certificate: acceptable when federation is impossible, if the key sits in an HSM or key vault and rotates.
  • Client secret: Microsoft's documentation says secrets "should not be used in production environments", and repeats the warning for agent blueprints. Entra still allows them for up to 24 months.

Entra adds a structural idea other platforms will likely copy. An agent identity blueprint holds the credential, preferably a federated credential backed by a managed identity, and issues tokens for the agent identities created from it. Each agent gets its own identity, its own audit trail and a sponsor, a named human accountable for it. One blueprint, many agents, no secret per agent.

③ Exchange one: user plus agent becomes a token for the MCP server

The agent must not forward T0 to the MCP server. It goes back to the authorization server and asks for an exchange. In RFC 8693 terms it sends the token-exchange grant type, subject_token=T0 (the user), an actor_token proving its own identity, a resource or audience naming the MCP server, and only the scopes this hop needs, say tickets.read tickets.write.

The authorization server checks consent, checks that this agent may act for this user (RFC 8693 defines a may_act claim for that), and applies policy. It returns T1: subject still the user, audience the MCP server, and an act claim naming the agent.

Microsoft's agent OBO flow does the same with different parameters: the blueprint obtains an exchange token for a named agent identity (fmi_path), which then presents it with the user token. AWS describes AgentCore's version as an exchange for "a new scoped-down access token" carrying both identities.

④ The MCP server validates, then exchanges again

The MCP server validates that T1's audience is itself, per RFC 8707 resource indicators, and it does not pass T1 on. The 2026-07-28 specification says MCP servers "MUST only accept tokens that are valid for use with their own resources." Our MCP authorization deep dive covers the client side.

To call the ticket API, the MCP server runs its own exchange: subject T1, actor its own workload identity, audience the ticket API, scope tickets.read. The resulting T2 has a nested act claim, MCP server outermost, agent inside. RFC 8693 is precise: the outermost act is the current actor, and nested ones are informational only. The API must not grant access because the agent once appeared in the chain.

⑤ The downstream API enforces audience, scope and actor

Here the narrowing pays off. The API checks audience and scope, returns only the user's tickets and logs user, actor and chain. If a prompt injection persuaded the agent to "close all tickets", the call fails twice: T2 has no write scope, and the user could not close other people's tickets anyway.

A shared API key can never give you this. The API cannot tell users apart, cannot see that an agent is involved, and cannot revoke one agent without breaking all of them. Microsoft's Conditional Access documentation puts it bluntly: an agent using an API key "bypasses the Microsoft Entra ID authentication and token issuance pipeline entirely".

⑥ Policy, sponsorship and revocation sit at the token service

Because every hop returns to the authorization server, policy works there. In Entra, Conditional Access evaluates on-behalf-of requests against policies for the user, who is the subject. Autonomous calls are evaluated against the agent identity or its blueprint, and agent user accounts need their own policies. A policy on the agent identity does not cover OBO calls, which surprises most teams. Lifetimes are capped at issuance, Continuous Access Evaluation revokes in near real time, and sponsorship workflows keep a human attached when people change roles.

Know the limits. Conditional Access for agents needs Microsoft 365 E7, or an Agent 365 licence on top of Entra ID P1 or Microsoft 365 E3. It skips the intermediate exchange step and covers only Entra-protected resources. Our agentic AI threat model maps where identity controls stop and other controls take over.

Beyond one tenant: where the standards are going

Real chains cross authorization servers. Three IETF efforts address that (status checked on 15 November 2026):

  • Identity and Authorization Chaining Across Domains (draft-ietf-oauth-identity-chaining-17) combines token exchange with a JWT authorization grant, so a token from domain A can be traded for one in domain B. Approved as a Proposed Standard on 22 June 2026, it is in the RFC Editor queue.
  • Identity Assertion JWT Authorization Grant (ID-JAG, draft-ietf-oauth-identity-assertion-authz-grant-06) lets an enterprise IdP vouch for a user towards a SaaS authorization server, so the enterprise decides which agent reaches which app. MCP's Enterprise-Managed Authorization extension, marked stable, builds on it.
  • Transaction Tokens (draft-ietf-oauth-transaction-tokens-11) carry user and context through a call chain inside one trust domain, with very short lifetimes. It is still a working group draft.

Build on RFC 8693 now; add the cross-domain layer when agents reach third-party SaaS.

What the numbers say

Default or maximum lifetime of common workload credentials, log scale. Green bars are short-lived and issued per request; warm bars are long-lived secrets.
Default or maximum lifetime of common workload credentials, log scale. Green bars are short-lived and issued per request; warm bars are long-lived secrets.

These are documented defaults and maxima from vendor documentation, not measurements. Platform-issued credentials cluster around one hour: Kubernetes projected tokens, SPIRE X.509-SVIDs, AWS STS sessions, Google Cloud and Entra access tokens. Even Entra tokens extended to 28 hours under Continuous Access Evaluation can be revoked in near real time.

Then comes a gap of three orders of magnitude. Entra client secrets can live 24 months. Google Cloud service account keys never expire by default unless you enforce the iam.serviceAccountKeyExpiryHours policy. Combine that with GitGuardian's finding on 2022 secrets still valid in 2026, and the lesson is plain: rotation policies do not fix long-lived secrets. Removing them does.

Machine identities per human identity, as reported by four sources using different methods
Machine identities per human identity, as reported by four sources using different methods

The second chart is deliberately not a trend line. Two bars are surveys (CyberArk 2025, 82:1; Idira 2026, 109:1) and two are one vendor's telemetry (Entro, 92:1 and 144:1). What they share is scale: roughly a hundred machine identities per person, before most organisations run agents widely. If each agent adds a blueprint, an identity, a tool-server identity and credentials, lifecycle automation stops being optional.

In a recent engagement…

During an identity review this year for a European financial services firm, we looked at their first production agent, an internal assistant answering questions about customer correspondence. It worked well. Its identity design was the one we see most often.

The agent ran under one app registration with tenant-wide permission to read mail, because "delegated permissions were harder to get working". Its client secret had a copy in a pipeline variable. Every audit entry showed the same application. And a prompt injection in one email could, in principle, steer the agent to any mailbox.

The fix followed the diagram: delegated access via on-behalf-of exchange, a federated credential instead of the secret, a separate identity and exchange for the tool layer, and a named sponsor. The hardest part was agreeing that the agent should be able to do less. Once the business owner saw that "less" meant "only what the user can already see", the argument ended.

Decision table: which identity pattern for which agent

The Hop column refers to the callouts in the hero diagram.

Agent situationIdentity patternToken flowHopWatch out for
Interactive assistant acting for a signed-in userPer-agent identity, delegated permissionsOBO / RFC 8693, user as subject, agent as actor①–③Policies target the user, not the agent
Background agent with no userPer-agent identity, own permissionsClient credentials with federated credential②Treat it like a privileged account
Agent needing a mailbox or Teams presenceAgent user account paired 1:1 with the agent identityAgent user flow②"Users" policies do not apply to agent users
Agent calling an MCP server that calls another APISeparate identity per tool serverSecond exchange, nested act④Never forward tokens; validate audience
Agent reaching SaaS in another IdP's domainEnterprise IdP controls accessID-JAG / identity chaining③Draft standards; check support per app
Anything still using a static API keyBroker the key behind a token-protected gatewayAgent gets a token for the gateway⑤Time-box it; the key still exists

The checklist we use in reviews:

  1. Every agent has its own identity, and every identity has a named human sponsor.
  2. No agent or tool server uses a client secret or static key in production.
  3. Incoming tokens are audienced to the agent; outgoing tokens come from exchange, never forwarding.
  4. Every exchanged token has one audience and fewer scopes than its parent.
  5. Downstream APIs log subject, current actor and the act chain.
  6. Policy covers users (OBO), agent identities (autonomous) and agent user accounts separately.
  7. Agent identities are offboarded automatically when the agent or its sponsor goes away.
  8. High-impact actions need a fresh, narrow token, ideally behind a human approval gate.

Governance for European enterprises

No EU regulation mentions RFC 8693, but several require what it provides: unique identities, least privilege and traceability.

NIS2. Article 21(2) of Directive (EU) 2022/2555 lists minimum measures for essential and important entities. Point (i) covers "access control policies"; point (j) covers multi-factor or continuous authentication where appropriate. A tenant-wide agent permission behind a static secret is hard to defend as an appropriate access policy. Our Entra ID hardening guide maps the tenant baseline.

DORA. Delegated Regulation (EU) 2024/1774 requires, in Article 20, identity policies that uniquely identify and authenticate "natural persons and systems", with a full lifecycle. Article 21 requires access rights "based on need-to-know, need-to-use and least privilege principles" and strong authentication for remote and privileged access. Sponsored agent identities with narrowed, delegated tokens answer both.

EU AI Act. If an agent is part of a high-risk AI system, Article 12 record-keeping applies; for Annex III systems that now starts on 2 December 2027 under Regulation (EU) 2026/1744. A log of user, agent and actor chain is the raw material, and cheaper to design in now.

GDPR. Article 25 requires that by default only the personal data necessary for each purpose is processed. An agent that can read every mailbox fails that test. One scoped to the asking user's data passes.

A pragmatic adoption path

  1. Weeks 1–2: inventory. List every agent, copilot and MCP server with its identity, credential type, permission model and owner. Expect shared app registrations and secrets in pipelines.
  2. Weeks 3–4: kill the secrets. Move agents and tool servers to managed identities, federated credentials or SPIFFE IDs. Enforce key-expiry and secret-lifetime policies in every cloud.
  3. Month 2: one identity per agent, with a sponsor. On Entra, create blueprints and agent identities and use Microsoft's migration guide for custom app registrations. Elsewhere, enforce one workload identity per agent.
  4. Month 3: delegated exchange. Replace application permissions with OBO or RFC 8693 exchange for interactive agents. Make every MCP server validate audience and exchange onward.
  5. Month 4 onwards: policy and evidence. Add policies for users, agent identities and agent users. Log the actor chain, feed it to detection, and review sponsors quarterly.

The verdict

Agent identity is workload identity plus delegation, applied with more rigour than most of us gave service accounts. RFC 8693 dates from 2020. What changed in 2026 is that the platforms built agent identity objects on top, and MCP closed the passthrough shortcut.

Our view is direct. Agents on shared app registrations with client secrets are an incident waiting for a prompt injection. Fix the credential first, because it is cheap. Then fix delegation, because that limits the blast radius. Do not wait for ID-JAG or transaction tokens to become RFCs.

If you want help applying this to your estate, our Zero Trust team runs agent identity reviews against the checklist above. You leave with the decision table filled in for your agents and a plan to retire shared secrets.

FAQ

Why shouldn't an AI agent use a service principal or a human user account?

Both hide who actually acted. A shared service principal usually holds tenant-wide application permissions, authenticates with a long-lived secret and logs every action as the same app. A user account inherits one person's full access. Microsoft's Agent ID documentation warns that user accounts assigned to agents break Conditional Access, ID Protection and governance. Give each agent its own identity, and let it act for a user only through a delegated, narrowed token.

What is OAuth 2.0 Token Exchange (RFC 8693)?

RFC 8693, published in January 2020, lets a client present a subject_token (the party it acts for) and optionally an actor_token (itself) and receive a new token for a named audience with requested scopes. In delegation, the new token carries an act claim naming the current actor; nested act claims record earlier actors. That fits agent chains: the user stays subject, each agent or tool appears as actor.

What is the difference between on-behalf-of, delegation and impersonation?

On-behalf-of is Microsoft's name for a token exchange in which a middle-tier service trades an incoming user token for a token to a downstream API. RFC 8693 distinguishes impersonation, where the actor becomes indistinguishable from the subject, from delegation, where the token names both and the act claim identifies who is acting. For agents, prefer delegation so the API and the audit log can tell the user and the agent apart.

Is Microsoft Entra Agent ID generally available, and what does it need?

Microsoft lists the Entra Agent ID platform as generally available since April 2026, with blueprints, per-agent identities, agent user accounts and human sponsors. Some admin wizards are still in preview. Conditional Access for agents requires Microsoft 365 E7, or a Microsoft Agent 365 licence with at least Entra ID P1 or Microsoft 365 E3, so check licensing before you design policy around it.

Can an MCP server forward the user's token to the APIs behind it?

No. The MCP authorization specification (revision 2026-07-28) requires MCP servers to validate that tokens were issued specifically for them and says they must not accept or transit any other tokens. To call another API, the MCP server should obtain a separate token, ideally by token exchange that keeps the user as subject, adds the MCP server as actor and narrows the scope.

How short-lived should agent credentials and tokens be?

The agent's own credential should not be a stored secret at all: use a managed identity, federated credential or SPIFFE-style workload identity, which typically rotate around the hour mark. Exchanged access tokens should live minutes to an hour, with one audience and only the scopes that hop needs. Long-lived secrets are the outlier: Entra client secrets can run for up to 24 months, and Google Cloud service account keys never expire by default.

Sources

All sources checked on 15 November 2026. Lifetimes are the vendors' documented defaults or maxima. Ratios are reported by the named organisations using their own methods.

Tier A: standards, primary documentation and regulation

Tier B: research and community standards

Tier C: vendor reports, directional

Topics

AI agent identitynon-human identityOAuth token exchange RFC 8693on-behalf-of flowworkload identity federationMicrosoft Entra Agent IDMCP authorizationagent delegation

Frequently Asked Questions

Both hide who actually acted. A shared service principal usually holds tenant-wide application permissions, authenticates with a long-lived secret and logs every action as the same app. A user account inherits one person's full access. Microsoft's Agent ID documentation warns that user accounts assigned to agents break Conditional Access, ID Protection and governance. Give each agent its own identity, and let it act for a user only through a delegated, narrowed token.

Expert engagement

Need expert guidance?

Our team specializes in cloud architecture, security, AI platforms, and DevSecOps. Let's discuss how we can help your organization.

Get in touchNo commitment · No sales pressure

Related articles

All posts