# "Identity for AI Agents - Patrick Riley & Carlos Galan, Auth0"
<!--
ref: @content/youtube/aie/2026-01-14-identity-for-ai-agents-patrick-riley-carlos-galan
triggers: [need for secure identity verification, issues with agent authentication, concerns about data integrity]
trigger_prompt: When developers seek to implement secure identity solutions for AI agents or face challenges in managing agent authentication.
version: 5
updated_at: 2026-10-31T18:12:21.688Z
-->

Patrick Riley & Carlos Galan (AI Engineer, 2026-01-14): AI agents introduce new identity challenges — reflected in the updated OWASP LLM Top 10 — that existing OAuth primitives can address once properly extended.

*Synthesized from AI Engineer on AI Engineer, 2026-01-14.*

Patrick Riley (from Raleigh, previously at Red Hat) and Carlos Galan (based in Mallorca, Spain, joined Auth0 via the Okta acquisition) walk through Auth0's newly released agent identity features — launched days before the talk — and build a Next.js stock-trading agent that authenticates users, exchanges tokens for upstream APIs, exposes an MCP server, and requests out-of-band user approval for risky actions.

## Core Thesis
AI agents introduce new identity challenges — reflected in the updated OWASP LLM Top 10 — that existing OAuth primitives can address once properly extended. Auth0 frames the problem around four pillars: the AI must know who the user is, must be able to call APIs on the user's behalf, must be able to request user confirmation for risky operations, and must have fine-grained access scoping. Their new release implements this via Token Vault (manages upstream refresh/access tokens), async auth over CIBA (back-channel approval), MCP server support with Dynamic Client Registration, and FGA for role-based access.

## Key Insights
- **Four-pillar model for agent identity**: (1) AI needs to know who I am, (2) AI needs to call APIs on my behalf, (3) AI can request my confirmation for risky actions, (4) AI access must be fine-grained. This maps to the OWASP LLM Top 10's new threat categories.
- **Token Vault** persists upstream refresh tokens and manages access-token lifetimes. The agent calls a single SDK method (`get access token for connection`) specifying the upstream connection name, and Auth0 performs the refresh-token grant to issue a new upstream access token to the agent.
- **Framework-specific token choices**: LangGraph stands up an external API with its own protocol/CLI, so it gets a short-lived access token. Native apps and traditional Next.js web apps with embedded agents can use a refresh token directly. A new "custom API client" allows an MCP server to access remote data as a distinct client.
- **MCP servers are modeled as OAuth clients**, and APIs are modeled as traditional OAuth resource servers. The MCP server exposes a `.well-known` protected resource metadata endpoint advertising supported scopes, and the agent client talks to the MCP server, which in turn talks to upstream APIs — a client-to-client-to-API chain.
- **Dynamic Client Registration (DCR)** went to early access the week of the talk. Open DCR exists as a thing but has scaling concerns; client ID metadata is the next spec expected to be implemented for registering new agents.
- **Scopes cannot be prompt-injected**: scopes not defined in the connection are ignored or rejected and can never end up in an access token, because authorization happens before tool execution via the SDK wrapper, not through LLM-controlled code.
- **Agent identity is distinct from user identity in the token**: the access token carries an "authorizing party" (azp) claim identifying the agent client, while the subject identifies the delegating user — enabling policies that distinguish agent-initiated requests from direct user requests.
- **Async auth uses CIBA** (Client Initiated Backchannel Authentication, an OIDC spec) plus **Rich Authorization Requests (RAR)**. The agent submits transaction details (symbol, quantity, price), the user receives a push notification via the Guardian app (or email), approves, and the agent receives an access token containing exactly the approved details — recorded for the resource server to verify.
- **RAR schema problem**: the RAR object is unconstrained, which complicates rendering. Auth0 defined a schema flexible enough to display anything but structured enough that the Guardian app (and custom apps using the Guardian SDK) can render approval prompts dynamically.
- **Okta/Auth0 split of responsibility**: Auth0 handles consumer and agent-side identity flows; Okta covers the enterprise side where employees acting via agents also represent a company. A bridge is planned so Okta employee access policies can be applied to agent actions.

## Actionable Takeaways
1. **Build an agent with Auth0 identity on Next.js**: start from the Auth0 workshop repo, add dependencies (Node, PNPM, Auth0 CLI, OpenAI API key), create a tenant, and use the Auth0 Next.js SDK middleware/wrapper to force login on your chat route. Enable the Connected Accounts feature via the new My Account API in your client configuration.
2. **Use Token Vault for upstream API access**: define an OIDC connection with the exact scopes the upstream service requires (e.g., `read:portfolio`, `read:trades`), then call `getAccessTokenForConnection(connectionName)` in your tool handler. Auth0 stores the refresh token and issues fresh access tokens per call.
3. **Model MCP servers as linked API clients**: create a custom API client in Auth0, link it to your MCP server, expose the `/.well-known/oauth-protected-resource` metadata endpoint listing supported scopes, and apply JWT verification middleware on the MCP transport. Share tool code (TypeScript) between the agent and MCP server for consistency.
4. **Gate risky operations with async auth (CIBA)**: in the tool handler, before executing a sensitive action (e.g., `create_order`), call the back-channel auth SDK with a Rich Authorization Request payload containing the transaction details (symbol, quantity, price). The user must be enrolled in MFA (enroll via emailed instructions or Guardian SDK). The tool waits for approval, then the issued access token carries the exact approved details.
5. **Never forward a user's access token to the agent**: establish a distinct agent-as-client relationship so token refresh, scope step-up, and expiry are handled by Auth0's SDK. Forwarding user tokens forces repeated re-authentication and breaks agent autonomy.
6. **Test MCP flows with MCP Inspector first, then Claude Code / ChatGPT App SDK**: Inspector exposes the full DCR dance (protected resource metadata → auth server metadata → registration → PKCE authorization code flow → access token). Claude supports MCP auth but currently has an open issue around specifying scopes.
7. **Deployment stack used in the demo**: Vercel for hosting both the Next.js agent and co-located MCP server, Upstash (Redis) for MCP server state, Terraform + Auth0 CLI for tenant configuration.

## Notable Quotes
> "AI needs to know who I am. If the agent doesn't know who I am, it can never apply any security or any restriction or any authorization." — Carlos Galan

> "We don't want an hallucinating agent buying a stock in the middle of the night without my permission." — Carlos Galan

> "Scopes that are not part of the connection can never end up in the access token." — Carlos Galan

> "The authorization happened before the tool execution. It's not LLM code — it's old-fashioned code." — Carlos Galan

> "We've taken the agent and modeled it as a client, and taken your APIs and modeled them as traditional OAuth resource servers." — Patrick Riley

> "Access tokens will expire eventually. How autonomous will your agent be if you have to log in again every time?" — Carlos Galan

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*