Delegated Agent OAuth Lab: Act for a User, No Password
This is a hands-on lab about letting an AI agent act for a user without handing it the user’s password or a master key. The agent should hold a narrow, expiring token that names the service it is for, that you can see and that you can revoke. You make 12 scored calls on the flow, scope, lifetime, audience, binding, token exchange, consent and revocation.
The scenario is fictional. The rules come from the OAuth RFCs, the OAuth security best current practice and the MCP authorization draft, listed below. For a general tour of OAuth grants, see the OAuth Flow Lab.
You are Marcus Oyelaran, identity architect at Fernbank Energy. Your AI assistant Scout must read and draft email and book meetings for staff, and it calls a calendar service that in turn calls a directory service. You must let it act for a user without ever holding that user's password or a master key. Over 12 scored decisions you choose the flow, scope, lifetime, audience, binding, token exchange, refresh handling, consent screen and revocation. Everything is invented. Each call scores 0 to 10 with the source behind the feedback.
Make it yours
Replace the sample names so the scenario and the debrief you export are about your organisation.
TL;DRWhat this is
5 points
- A scenario lab about how an AI agent acts for a user without holding the user's password or a master key. You act as identity architect at a fictional company.
- You make 12 scored decisions: why passwords and static API keys fail, the authorization code flow with PKCE, narrow scopes, token lifetime, audience restriction with resource indicators (RFC 8707), sender-constrained tokens (DPoP, RFC 9449), refresh-token handling, token exchange for downstream calls (RFC 8693), the "act" claim, the consent screen, revocation and introspection, and what OAuth does not fix.
- It draws on the RFCs themselves, the OAuth security best current practice (RFC 9700), the MCP authorization draft, the MCP security best practices and OWASP guidance on excessive agency. The OAuth 2.1 document is an Internet-Draft and is labelled as one.
- Free to play, no account needed. Every name is invented. No attack steps appear and no real token or host is shown.
- Defensive and educational only.
How this differs from our other agent labs
The OAuth Flow Lab is a general OAuth lab: pick the right grant for each kind of app. This lab assumes you know the code flow and asks the agent-specific questions after it: how narrow, how long, which audience, bound to what key, what happens on a downstream hop, and how you stop it. The OAuth Consent Lab is about reviewing other apps’ consent requests; here you design your own agent’s.
The Agent Credential Broker Lab is about where credentials live once issued; this one is about what gets issued and to whom. The Agent Task Permission Scoper helps you decide the minimum permissions for one task, and the MCP Proxy Policy Lab covers the gateway that checks those tokens on MCP traffic.
Frequently asked questions
How should an AI agent act on behalf of a user?
Through delegated authorisation, not the user's credentials. The user signs in at the authorization server, approves specific permissions, and the agent receives a token limited to them. RFC 9700 says the password grant must not be used because it exposes the user's credentials to the client. The lab takes you through the choices that follow: flow, scope, lifetime, audience, binding, refresh, downstream calls and revocation.
What is the difference between delegation and impersonation in token exchange?
RFC 8693 explains that with impersonation, the acting party is indistinguishable from the user in the token's context; with delegation, the actor keeps its own identity and it is understood that it acts for the user. The "act" claim expresses that delegation has occurred and names the actor. For agents, delegation keeps a record that software, not the person, did the thing.
Why audience-restrict an agent's token?
So a token stolen from or sent to one service cannot be used at another. RFC 8707 lets the client name the resource it will use the token at, so the authorization server can restrict the audience, and RFC 9700 says each resource server must verify the token was meant for it. The MCP authorization draft requires the resource parameter, and the MCP security best practices forbid accepting tokens not issued for the server.
Does DPoP make a stolen token useless?
Only if the thief cannot also use the key. RFC 9449 sender-constrains tokens so that a token without the matching private key is rejected, in contrast to a bearer token that any holder can use. If the key sits in the same compromised sandbox, the benefit shrinks, so key placement matters.
How do you revoke an agent's access?
Revoke the grant at the authorization server. RFC 7009 says a revocation request invalidates the token and, where applicable, other tokens based on the same authorization grant. Short-lived access tokens limit how long offline checks keep accepting an old one, and token introspection (RFC 7662) lets a resource server ask whether a token is currently active.
Is OAuth 2.1 a standard yet?
No. At our access date it is an Internet-Draft (draft-ietf-oauth-v2-1-17, dated 31 October 2026, expiring 4 May 2027). RFC 9700 is the published best current practice, and the lab cites the RFCs for requirements.
What does this lab say about NIST SP 800-63C?
Only that it exists and what it covers: identity federation and assertions for people. It is background for the idea of one party vouching for an identity to another, and it does not set rules for AI agents, so the lab does not use it to justify agent design choices.
Is the scenario based on a real incident?
No. The organisation, assistant and services are invented. The lab quotes no real token, host or lifetime. Standards cited do not give token lifetimes in minutes, so the lab does not either.
How is the lab scored?
Each of the 12 decisions scores 0 to 10 and the result is your share of the maximum, with a short band saying what it means. The debrief shows the source behind each rationale. Lines labelled PlayCISO practice are our reasoning, not a statement by a source.
Sources
All read on 4 November 2026. Lines in the feedback marked “PlayCISO practice” are our own reasoning, not a statement by any source. The scenarios are fictional. We cite primary sources, not vendor advisories, and say where a page could not be fully read.
- IETF (RFC 9700, BCP 240): Best Current Practice for OAuth 2.0 Security (Published 2025)
- IETF (RFC 6749): The OAuth 2.0 Authorization Framework (October 2012)
- IETF (RFC 7636): Proof Key for Code Exchange by OAuth Public Clients (September 2015)
- IETF (RFC 8707): Resource Indicators for OAuth 2.0 (February 2020)
- IETF (RFC 8693): OAuth 2.0 Token Exchange (January 2020)
- IETF (RFC 9449): OAuth 2.0 Demonstrating Proof of Possession (DPoP) (September 2023)
- IETF (RFC 7009): OAuth 2.0 Token Revocation (August 2013)
- IETF (RFC 7662): OAuth 2.0 Token Introspection (October 2015)
- IETF OAuth working group: The OAuth 2.1 Authorization Framework (draft-ietf-oauth-v2-1-17) (31 October 2026 (draft, expires 4 May 2027)) An Internet-Draft, not a standard; work in progress. We cite it only to say where the direction of travel is.
- Model Context Protocol specification: Authorization (draft specification) (Draft version on 4 Nov 2026) A draft that can change. We cite its rules on the resource parameter (RFC 8707) and on servers accepting only tokens meant for them.
- Model Context Protocol documentation: Security Best Practices (Current version on 4 Nov 2026)
- OWASP GenAI Security Project: LLM06:2025 Excessive Agency (2025 edition)
- NIST: Digital Identity Guidelines: Federation and Assertions (SP 800-63C-4) (July 2025) Covers identity federation and assertions for people. It is background for the idea of a trusted party vouching for an identity; it does not set rules for AI agents.
More security tools
The tools people use most on PlayCISO.
Catch injected instructions hiding in content your AI agent should only read.
Score your readiness against the first international standard for AI security threats.
Critical CVEs across 21 major vendors, month by month — and what the 2026 surge means.
Build an ordered ruleset, replay labelled packets and catch shadowed and any-to-any rules.
Self-assess all six Functions, from Govern to Recover, and see your weakest one.
Search 172 threat actors across Microsoft, CrowdStrike, Mandiant and community names.