An AI agent that does anything useful needs to act on systems: read a calendar, query a database, send a message. The lazy way to grant that is to hand the agent a standing credential (an admin token, a service account, the user's own session) and let it do whatever it likes. That works in a demo and becomes one of the riskiest decisions in the architecture. The right question is the one identity engineers answered years ago for third-party apps: how does a program act on behalf of a user without becoming that user? The answer is delegated authorization, and agents need it more than earlier apps did.
Why “just give it a token” fails
When a human logs in, authority is bounded by a person: they get tired, they hesitate, they notice when something is off. An agent has none of those brakes. It will make ten thousand calls a minute and follow an instruction buried in a web page as faithfully as one from you. So the credential you give it sets its entire blast radius. A broad, long-lived token gives the agent an account that never tires and acts on text it cannot fully verify.
The web faced this same problem when apps wanted to act for users. The bad old answer was to collect the user's password and log in as them: full impersonation, no limits, no revocation. OAuth replaced that with delegation: the user consents to a scoped grant, an authorization server issues a token good for only those scopes, and the app acts with that token instead of the user's credentials. An agent is the kind of semi-trusted deputy that delegation was designed to contain.
Scopes set the limit of an agent's power
A token's power is defined by its scopes, and this is where agent deployments go wrong. It is easier to request read_write_all once than to enumerate the four operations the agent actually performs, so teams over-scope “to be safe,” which increases the damage if the token leaks. The right posture is the one OAuth encourages and few teams enforce: request the narrowest scopes, for the shortest lifetime, bound to the specific task. An agent that summarizes invoices needs invoices:read, not a token that can also delete them.
Two refinements matter for agents specifically. First, keep the agent's identity distinct from the user's. A token that says “this is the scheduling agent acting for Alice” is auditable and revocable in a way that Alice's own session is not. OAuth 2.0 Token Exchange (RFC 8693) defines how to mint these on-behalf-of tokens. Second, scope is a ceiling, and the resource must still authorize each call on its own terms. Delegation narrows what the agent can attempt; it does not decide what it should.
Treat the token as a high-value secret. If an agent's token leaks (logged in plaintext, echoed into a prompt, or exfiltrated by an injected instruction), whoever holds it becomes the agent. Short lifetimes, rotation, storage outside the model's context, and revocation you can actually trigger limit a leak to a short window.
Designing agent authorization that holds
- Give the agent its own identity. Never let it inherit a human's session or a shared admin account; a distinct principal is what makes audit and revocation possible.
- Scope to the task, expire fast. Use narrow scopes and short-lived tokens, refreshed as needed. A smaller window limits what a stolen token can do.
- Authorize at the resource. Check every action against policy where it lands, including after the token was issued.
- Protect and rotate secrets. Keep tokens out of prompts, logs and model context; assume any credential the model can see, an attacker can eventually extract.
Delegated authorization is an established answer to an established problem. What is new is that the authority goes to a deputy that reads untrusted text and does not get suspicious. The controls come from OAuth, and the discipline has to be stricter, because the holder is easier to talk into misusing the token. You cannot bound an agent's authority until you know every agent you run and exactly what each one can reach.