Should AI Agents Have Their Own Identity or Act On Behalf of the User?
Should AI agents have their own identity or act on behalf of the user: delegate a live session, give unattended work its own identity, and put both names on the call.
Should AI agents have their own identity or act on behalf of the user? Put the user on the token when a person is in the session and the resource's rules are about that person. Give the agent its own identity when the work runs with nobody signed in. A call that serves a person and is carried out by software needs both names: the user as the subject, the agent as the actor, and a scope smaller than the rights either one holds alone. A token that names only the user hides the program that took the action. A token that names only a shared bot hides who asked, and the bot keeps its rights after that person has left.
The specifications, NIST pages, and vendor docs cited here were read on 29 November 2026.
What are the three ways to name the caller?
RFC 8693, OAuth 2.0 Token Exchange, separates two ideas that get called "on behalf of." When principal A impersonates principal B, A receives B's rights inside a defined context and is indistinguishable from B to whoever accepts the token. Delegation keeps A's identity. B has delegated some rights, and the actions are A's, representing B. The specification describes A, in that case, as an agent for B. In the request, subject_token is the party on whose behalf the token is requested, and actor_token is the party receiving those rights. The authorization server decides whether the issued token carries both. For a JWT, the act claim names the acting party, and nested act claims record a chain. When a principal acts on its own behalf, neither delegation nor impersonation applies. That is the nightly job, and the deploy nobody clicked.
NIST SP 800-63-4 covers identity proofing, authentication, and federation for users such as employees, contractors, and private individuals. It says it does not explicitly address machine-to-machine authentication, or access to APIs on behalf of subjects. A directory account under those guidelines is the person you delegate from. NIST's design tenets for agent identity, from 27 October 2026, cover the software. Tenet 01 asks for an identity distinguishable from a human and from a service account, with its own lifecycle. Tenet 02 says agents operate on behalf of individuals or organizations, stay linked to the party that started the task, and pass on scopes that attenuate. A distinct identity and a link to the person are both requirements.
NIST SP 800-207 defines a subject as an end user, an application, or another non-human entity. Its tenets grant access per session, allow client identity to be a user account or a service identity, and require authentication and authorization before access, with reevaluation through the transaction. Section 5.7 discusses software agents used in administering that architecture. An attacker may induce the agent to act, or steal its credential and impersonate it. The publication calls authentication of those components an open issue, which the later tenets take up as a design list.
When should the agent act for the user?
Use the user's identity, with the agent visible as the actor, when a person started the task and the resource decides by who that person is. A refund runs because this member of Support may refund. A pull request opens because this engineer may write to that repository.
Microsoft Entra Agent ID maps that session to delegated access. A local agent on a device signs the user in with the authorization code flow and PKCE, without a client secret. A hosted agent that receives a user access token uses the on-behalf-of flow and exchanges it for a token the downstream API will accept. The incoming token has to be intended for the agent's blueprint. A token issued for another resource stays where it arrived.
The rights still shrink to the task. RFC 8693's security considerations point at scope and a short lifetime, because delegation and impersonation are both chances for abuse. OWASP ASI03, Identity and Privilege Abuse, describes an agent that gained access on behalf of its maker, after which other people invoke its tools as that person. LLM06:2025, Excessive Agency, is the earlier name for holding more permission than the task needs. The user's full token, copied into a config, is that case.
Deactivating the member makes the next check fail on a delegated token that still depends on them. A job that must outlive its author needs a second identity. If act is absent, a log that records only the subject shows the user, which is the impersonation case in RFC 8693. Okta's AI agent token exchange guide describes a machine-access path where another client presents an access token, and Okta accepts it when a delegation link authorizes that client and the token targets the agent's resource URL.
When should the agent have its own identity?
Give the identity to the workload when the request has no person in it. Entra's protocol guide uses client credentials for that work. The resource token carries application permissions an administrator granted, and it identifies the agent identity as the actor. Use on-behalf-of when a signed-in user started the operation, and application permissions when the call should run as the agent. A hosted agent that does both takes a separate token for each.
SPIFFE names a workload as software deployed with one configuration for one purpose. A SPIFFE ID is a URI for it. The concepts page gives spiffe://acme.com/billing/payments. An SVID, an X.509 certificate or a JWT signed in the trust domain, is what the workload presents, with short-lived keys the Workload API can issue without a secret shipped in the application. The specification assumes one workload cannot steal another's issued credentials, and it leaves that isolation outside the spec. A pipeline presents that workload's SVID. The engineer's token stays in the engineer's session.
NIST's first tenet keeps this lifecycle apart from humans and from service accounts. An Entra agent identity is a service principal from a blueprint. It can record a sponsor, the user or group you call when something goes wrong, and that sponsor is a different field from the token's subject. The protocol guide says to prefer application permissions over a made-up user for unattended work. A mailbox that only a user object can hold is the exception, and that object is the agent's account. An agent token has the agent as its subject. A user token has the user as its subject and the agent as the actor. Prefer a federated credential or a certificate on the blueprint. The guide says to avoid a client secret there in production.
Revoke that identity by name: disable the agents of the blueprint, revoke its credential, or stop issuing SVIDs. How to find and govern shadow AI agents in your company is where a pasted key shows up instead, a secret the directory cannot revoke because the directory never issued it.
What do you issue when the call needs both?
Support uses an agent by day. A job on the same platform closes stale carts at night. Issue an agent identity for the software, and add the user's context on calls that have a user. Keep each token short-lived and bound to one audience.
Name the principals first. Write down the workload, and the person when a person started the task.
Bind each token to one audience. RFC 9700 associates an access token with one resource server, which checks the audience and refuses a mismatch. RFC 8707 defines resource as an absolute URI with no fragment, and it asks for a high degree of trust before a token lists more than one audience. The MCP authorization specification tells an HTTP server to validate the access token, to require this server as the audience, and it must not accept or transit any other token. A stdio server takes its credential from the environment. The upstream call uses a different one.
Exchange, and keep it short. The RFC 8693 example has the resource server authenticate at the token endpoint, send the inbound token as subject_token, and set resource to the upstream API. Only the issued token goes upstream. NIST's fourth tenet asks for grants that are just-in-time, time-bounded, and audience-specific. ASI03's first mitigation is a short-lived token scoped to the task. A refund in a live session takes that token. RFC 8693 treats a refresh token on an exchange as a documented exception, for access after the original credential is already gone.
Refuse passthrough. How to stop MCP token passthrough and confused deputy attacks states the credential rule: accept a token issued for this server, and call upstream with a different one. An exchange that errors, times out, or returns the wrong audience ends as a denied tool call.
Decide again on the call. ASI03 describes a purchase approved at the start of a workflow and completed hours later, on the old authorization, after the limit had changed. SP 800-207 requires reauthorization through the transaction. This call is a new request.
Keep the grant separate. Membership in Support is not yet a tool list, and not yet a judgment on the amount. Admin RBAC vs agent permissions separates the console role that registers a server from the grant on stripe.refund. That grant names a role, a team, or a project, and a large refund can wait for someone other than the requester.
How do the audit trail and offboarding differ?
| Act for the user | Agent's own identity | Hybrid | |
|---|---|---|---|
| Who the token names | The user. Under impersonation, the agent is absent | The workload | The user as subject and the agent as act, or the workload alone when no user is present |
| What one log line can answer | Which person | Which program | Who asked, which program ran, which audience accepted the token, and the decision |
| What deactivating the person stops | Delegated calls that still depend on that user | Nothing further, until the workload is revoked | That user's delegated calls. Unattended calls continue on the workload |
| What retiring the agent stops | Stored copies of user tokens | The workload's credentials and grants | The actor, its credentials, and its grants. The person's own access remains |
| Where it fails | The agent holds the user's rights, and the log names only the user | A shared bot with no owner outlives the team | A missing actor, or a failed exchange, is treated as permission |
NIST's tenth tenet asks for an append-only record the agent cannot edit, covering the agent's identity, the delegated intent, and the actions. Record the subject, the actor when policy requires one, the audience, the tool, the decision, and the reason. Leave secret values out.
Offboarding follows the columns. Deactivate the person, and require the next delegated call to see that the subject is still active. Then review workloads that person sponsored. Tenet 01 gives the agent its own lifecycle, so a blueprint disable, or a stop on SVID issuance, is a separate act from closing the person's account.
What does one support team run?
Orders and payments sit behind https://mcp.example.com. The payments API is https://pay.example.com. By day, a member of Support uses an agent. At night, cart-closer may call carts.close_stale only.
The member's inbound token names https://mcp.example.com as audience, the member as subject, and support-agent in act. The tool list is that member's grants: orders.read, and stripe.refund inside the amount the role allows. A larger refund waits for Finance, and the requester is not the approver. The gateway exchanges for a minutes-long token aimed at https://pay.example.com and scoped to that refund. Its record shows the member, support-agent, the tool, and the decision.
The night job's subject is cart-closer, with no user. A token that arrives carrying a user's subject is refused there, because the job does not act for whoever last held a session.
user_present:
subject: the member
actor: support-agent
audience: https://mcp.example.com
on_missing_actor: deny
on_audience_mismatch: deny
tools: the member's grants
upstream:
resource: https://pay.example.com
passthrough: deny
on_exchange_error: deny
unattended:
subject: cart-closer
audience: https://mcp.example.com
tools: [carts.close_stale]
on_user_subject: deny
Each path has its own credential on that shared endpoint. support-agent closes carts only with a grant. cart-closer has no refund grant.
Where does this fail closed?
The payments exchange times out after a valid inbound token. The tool call is denied. The client retries when exchange answers.
Forwarding that inbound token would send an audience of https://mcp.example.com to another resource. RFC 9700 is how the payments API refuses a token minted for somewhere else, and token passthrough is the name for a gateway that forwards it anyway. Swapping in a broader application token drops the user and adopts whatever the unattended identity can do, which may include a bot that refunds any amount. That is a new caller, authorized by the error handler. Unattended authority stays on the unattended path.
A missing actor fails the same way when policy requires delegation. The subject is the member, act is absent, and a signature-only check would record the refund as the member. RFC 8693 calls that impersonation: the receiver cannot tell the agent from the person. Reject the token. Reject it again when the member is deactivated between tools/list and tools/call. The list was built for someone the directory has since disabled, the call is a new request, and the denial says so. A token for https://wiki.example.com presented at https://mcp.example.com is a 401 before any exchange. Entra's on-behalf-of guidance is the same shape: a token issued for another resource is not relayed.
Frequently asked questions
Is on-behalf-of the same as impersonation?
RFC 8693 keeps them apart. Impersonation leaves the receiver unable to tell the agent from the user. Delegation keeps the agent's identity on act and says the agent represents the user. Entra's on-behalf-of flow is an exchange into a downstream token, and on a delegated user token the agent identity stays the actor.
Does the agent's identity replace the user's permissions?
It names the software. Tenet 02 still links the agent to whoever started the task, with scopes that attenuate, and a delegated token keeps the user as subject. Either path needs a grant to a role, a team, or a project before a tool is offered.
What if the authorization server cannot exchange?
Deny the upstream call. The inbound token stays at this server. With no user to carry, call upstream using a credential issued to this server for that API, scoped to the tools you expose. That credential belongs to the workload, and it stays out of the agent's config.
Who do you disable when someone leaves?
Disable the person so the next delegated call sees an inactive subject. Then revoke sponsored agent identities that should stop with them. A workload built to keep running does so until that workload is revoked.
Where do you put the decision?
Put it where the tool call is about to be forwarded. The token names the member, the workload, or both, and the grant is the one on that role, team, or project. Doing the same thing once per laptop is how a person's token becomes the program's credential.
Smartplane is one MCP endpoint for the organization. Admins register tools once and assign use permissions to roles, teams, and projects. Credentials are injected for the call, so agents never hold the upstream secrets. Sign-in is SSO, with SCIM offboarding. Guard rules are written in plain English, start in monitor mode, and can be switched to enforce. An action that needs a second person waits for approval by someone other than the requester. Calls, denials, and grant changes land on an append-only, hash-chained audit log. The security page lists the controls, and the product is the one URL they sit behind.
Related articles
Admin RBAC vs Agent Permissions: What Your MCP Gateway Actually Controls
The difference between admin RBAC and agent action permissions: console roles configure the gateway, and action permissions decide which tools a person's agent may call.
How to Find and Govern Shadow AI Agents in Your Company
How to find and govern shadow AI agents: inventory MCP configs, keys and OAuth grants, then put what you keep on one gateway.
RBAC vs ABAC for AI Agents
RBAC vs ABAC for AI agents: roles decide which tools an agent can see, and attributes decide which calls may run.
