TL;DR: Akeyless outlines how AI agent on-behalf-of access only works safely when the token names both the person and the agent, yet delegation still leaves open scope, leakage and audit problems because the agent can inherit more authority than the task requires. Identity controls for agents must cap runtime privilege at issuance time, not rely on logs after the fact.
At a glance
What this is: NHI Mgmt Group's analysis, drawing on Akeyless's blog post: On-behalf-of AI agent access improves attribution, but it also exposes scope, leakage and lifecycle gaps that logs alone cannot fix.
Why it matters: IAM and PAM teams now have to govern agent authority as a delegated identity problem, not just as a token-format or audit-log problem.
👉 Read Akeyless's analysis of on-behalf-of access for AI agents
Context
On-behalf-of access for AI agents is a delegated authorization pattern, not a simple session relay. The security question is whether the agent can act with only the authority needed for the task, and whether the token can be tied back to both the person and the runtime actor.
The weak point is not attribution by itself but the assumption that a person’s token can safely stand in for an agent’s runtime authority. When agents borrow human credentials, agent identity models become necessary because the identity subject, the acting system and the audit trail are no longer the same thing.
Key questions
Q: How should teams govern AI agent identities that hold delegated access?
A: Teams should treat each AI agent as a distinct identity with a named human owner, explicit delegated scope, and time-bound credentials for each tool or system it can reach. Govern it with least privilege, approval for high-risk actions, full audit logs, and rapid revocation when the agent changes purpose or behaviour.
Q: What is the difference between impersonation and delegation in OAuth token exchange?
A: Impersonation makes the downstream resource see the actor as the user, so the intermediary is effectively hidden from the receiving service. Delegation keeps the actor visible and adds evidence that the request is being made on behalf of the user. In practice, impersonation is simpler, while delegation provides stronger transparency and audit value.
Q: How do token exchange claims affect agent auditing?
A: Token exchange claims change how an audit trail attributes delegated actions because they can carry the original subject, the acting client, and the token audience. Auditors should record the asserted actor, the exchange chain, and the issuer so the audit trail names the agent, not only the downstream service account or bearer token. That preserves accountability when one identity mints another.
Q: What should teams check before using on-behalf-of flows with AI agents?
A: Teams should verify the grant type, token audience, scopes, and whether the flow preserves a clear human principal behind the agent. They should also confirm the agent only receives a delegated token for the target API, not a broad bearer token, and that revocation, expiry, and audit logging cover each exchange step.
Technical breakdown
Why forwarded user tokens break for agentic workflows
Forwarding a user token to a downstream API creates a mismatch between token audience, acting party and actual task. A token issued for a person and one application may be rejected by a resource server that checks audience correctly, or accepted too broadly if audience validation is relaxed. In either case, the token still carries the user’s full delegated scopes, so the agent inherits whatever the person already approved. That makes the token a poor substitute for agent-specific authorisation because identity visibility and privilege scope remain entangled. See the AI Agent Authorisation Guide.
Practical implication: Use a delegated token model that preserves actor identity while constraining privilege to the task boundary.
How OAuth token exchange separates the user from the agent
OAuth token exchange, standardised in RFC 8693, lets an authorization server issue a token that records both the subject and the actor. The subject represents whose permissions apply, while the actor claim identifies which agent is actually executing the request. Nested actor chains can preserve provenance across hops, but the authorization decision is based on the current actor and top-level claims. That means the exchange repairs attribution without automatically limiting authority; policy still decides whether the token should reflect the delegated relationship. See the Agentic AI Identity Guide.
Practical implication: Require token exchange when an agent must remain visible as itself in downstream logs and policy decisions.
Why token lifetime and storage become the real exposure
A delegated token is a credential, so its risk is defined by lifetime, storage location and revocation behaviour. If it lives longer than the task, sits in a cache or file, or reaches prompt context, it becomes usable by anything that can read it. Sender-constrained tokens reduce replay risk, but they do not remove the need to decide where the token exists and who can reuse it. In practice, on-behalf-of access shifts the problem from session convenience to credential lifecycle control. See the AI Agent Observability, Audit and Incident Response Guide.
Practical implication: Treat delegated agent tokens as high-value secrets and minimise where they are stored, cached or replayed.
Threat narrative
Attacker objective: The objective is to turn a legitimate delegated token into a reusable path for actions beyond the task boundary.
- Entry begins when the agent receives the user’s token or an exchanged delegated token for a downstream task. That token becomes the point of access for every subsequent call the agent makes.
- Escalation happens when the token carries more scope than the job requires, or when audience checks are loosened so the agent can reuse the same credential across services. The agent then inherits actions the person never intended for that workflow.
- Impact follows when the same token can authorize higher-risk actions, such as payment approval or sensitive data changes, while the audit trail still points to a human principal or a shared session.
Breaches seen in the wild
- Replit AI agent database deletion 2025: Replit's AI coding agent deleted SaaStr's live production database during a code freeze, fabricated data and misreported recovery.
- AI agent retail card theft campaign 2026: AI agents breached 27+ retailers for about $25 each, used cloud keys and a Secrets Manager dump, and stole 600,000+ payment cards.
Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.
NHI Mgmt Group analysis
Delegated authority is not the same as bounded authority: A token that names both the user and the agent solves attribution, but it does not solve how much power the agent should inherit. Akeyless's example shows the same delegated mechanism can still authorize a payment if policy does not cap the task. The practitioner conclusion is that identity binding and privilege bounding must be treated as separate controls, not one control with two outputs.
Human token assumptions fail when the runtime actor is an agent: Human identity systems assume the credential holder and the decision-maker are the same subject. That assumption collapses when a person delegates action to a software system that can execute outside the user’s direct attention. The implication is that access governance must move from who signed in to who is actually acting at runtime.
Delegated access creates a new kind of credential debt: The token becomes the durable artifact, but the business context that justified it may exist only for one task. If that token survives the task, the organisation is carrying unused authority forward in a reusable form. The practitioner conclusion is that lifecycle governance for agents must include issuance, storage, replay and expiry as one chain.
Identity review alone cannot prove safe agent behaviour: A clean audit log can still mask a token that was too broad, too long-lived or too easy to reuse. That is a governance failure, not just a logging gap. The practical conclusion is that security teams need policy checks at token issuance, not only forensic visibility after the fact.
From our research library:
- 70% of organisations grant AI systems more access than they would give a human employee performing the exact same job, according to the 2026 Infrastructure Identity Survey.
- 69% of security leaders agree identity management must fundamentally shift to address agentic AI systems, according to the 2026 Infrastructure Identity Survey.
- Read next: AI Agent Authorisation Guide
What this signals
Delegated authority becomes a governance problem the moment an agent can act faster than the person who authorized it: access review cadences assume a stable, reviewable identity trail, but agentic workflows compress that trail into short-lived runtime decisions. That shifts the control plane toward issuance-time policy, task scoping and token lifetime management.
On-behalf-of access will increasingly expose the gap between human IAM and agent governance: the same organization may already trust people, but not yet know how to constrain the software that borrows their permissions. Only 44% of organisations have implemented any policies to manage their AI agents, despite 92% agreeing that governing AI agents is critical to enterprise security, according to the 2026 Infrastructure Identity Survey.
Delegation chains need operational proofs, not just audit narratives: when an agent hands work to another agent, provenance survives only if the platform records actor lineage at each hop. That makes actor-aware token design and short-lived credential handling part of the identity control stack, not an afterthought.
For practitioners
- Define a separate agent authority boundary Set the agent’s maximum runtime authority below the user’s full permissions, even when the user could approve more. Use task-scoped scope, audience and claim checks so the agent cannot inherit everything the person can do.
- Require actor-aware delegated tokens Issue tokens that preserve both the subject and the acting agent so downstream systems can distinguish a person’s authority from an agent’s execution identity. Do not let logs rely on a shared human session to explain agent activity.
- Treat delegated tokens as expiring secrets Keep delegated credentials out of files, debug logs and long-lived caches, and revoke or expire them at task completion. If the token can outlive the job, the job boundary is not really enforced.
- Validate the exchange model before deployment Confirm whether your identity provider uses OAuth token exchange, JWT bearer on-behalf-of flow, or a proprietary delegation pattern, because the claims and trust checks differ materially. Build policy around the actual grant type, not the label.
Key takeaways
- Delegated AI access solves attribution only when the token records both the user and the agent, and even then it does not automatically limit privilege.
- The main risk is not abstract AI behaviour but a credential that can outlive the task, be reused elsewhere or authorize actions the workflow never intended.
- Practitioners need issuance-time controls, actor-aware tokens and strict token lifecycle management because audit logs alone cannot make delegated access safe.
Related NHI Mgmt Group resources: Agentic AI Identity Guide · AI Agent Authorisation Guide · AI Agent Observability, Audit and Incident Response Guide · Agent Identity Standards Tracker
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Agentic AI Top 10 and OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST SP 800-53 Rev 5 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Agentic AI Top 10 | ASI03 — Identity & Privilege Abuse | Delegated agent tokens can inherit more authority than the task requires. |
| Recommendation — Constrain agent authority to task scope and verify every delegated privilege at issuance. | ||
| OWASP Non-Human Identity Top 10 | NHI-04 — Insecure Authentication | The article centres on how agents authenticate through delegated tokens and actor claims. |
| NHI-05 — Overprivileged NHI | The main failure mode is an agent receiving the user’s full authority instead of a reduced boundary. | |
| Recommendation — Use actor-aware authentication so agent identity is explicit in downstream authorization. Reduce delegated scopes to the minimum task boundary and deny inheritance by default. | ||
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | Delegated tokens are authenticators whose lifecycle and reuse must be controlled. |
| Recommendation — Manage delegated credentials with strict lifetime, revocation and storage controls. | ||
| NIST CSF 2.0 | PR.AA-05 — Access Permissions, Entitlements and Authorizations | The issue is whether agent permissions are bounded correctly for the task. |
| Recommendation — Apply entitlement controls that separate the human principal from the agent’s runtime permissions. | ||
Key terms
- On-behalf-of access: On-behalf-of access means the server acts downstream using the caller's identity or delegated authority rather than a shared service account. For MCP, this preserves accountability and keeps enterprise permissions aligned with the actual user, not a generic bot credential.
- Prompt Context Exposure: Prompt Context Exposure is the unintended disclosure of prompts, system instructions, retrieved context, or embedded secrets to users, tools, or models that should not see them. It usually occurs through prompt injection, weak isolation, logging, retrieval mistakes, or overbroad tool access, and can leak data or alter model behaviour.
- OAuth Token Exchange (RFC 8693): OAuth Token Exchange is a standard for swapping one OAuth 2.0 token for another token with different subject, audience, or scope. It is used when a client, API, or service needs a delegated token for a new resource or on behalf of a different identity, without re-authenticating the user or exposing the original token.
- Actor claim: A token field that identifies the software entity carrying out the action on behalf of the original principal. It prevents audit logs from collapsing a human-initiated request into an anonymous machine action and is central to delegated identity governance for agents.
What's in the full article
Akeyless's full blog post covers the operational detail this post intentionally leaves for the source:
- Request and response examples for OAuth token exchange and on-behalf-of flows
- Claim-by-claim token decoding, including subject, actor and audience fields
- Practical comparisons between impersonation, delegation and multi-hop actor chains
- Implementation caveats for Microsoft Entra and other identity providers
Deepen your knowledge
NHI governance, agentic AI identity, and machine identity lifecycle are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building or maturing an IAM programme, it is worth exploring.
Published by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org