AI Engineer World's Fair 2025
Securing Agents with Open Standards
Loading slides…
Read the talk
Securing Agents with Open Standards
Agents need more than permission to call tools: they need a user identity, bounded access, and a way to obtain approval before sensitive actions execute.
From a talk by Bobby Tiernay and Kam Sween
Before you start: Basic familiarity with API access tokens, LLM tool calls, and TypeScript will help you follow the walkthrough.
Who is the agent acting for?
When an agent takes an action on someone’s behalf, how do you establish whose authority it used? Bobby Tiernay and Kam Sween approach that question through their engineering work at Auth0: Auth for Gen AI, the Auth0 MCP server, and the first-party agent Tenant Security Manager. Their practical concern is delegation: connecting an agent’s ability to act with the particular user who authorized it.
Once agents move beyond chat, the failure modes become concrete. Secrets can leak into prompts or logs. Scopes can grant more access than an operation needs. A system can appear to work while recording too little information to reconstruct an incident. The missing evidence is often basic: who requested an action, what the agent did, and when it happened.
Bobby frames this through the access-control side of OWASP’s excessive agency risk. API calls, data retrieval, tokens, credentials, and keys all give an agent ways to affect a system. That access needs limits, monitoring, and a connection to a real user. Sensitive data exposure follows the same concern: an agent that can reach unauthorized material may disclose it. As agents start workflows and change systems, the relevant identity cannot stop at the application’s service account; it must preserve the individual user’s context.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Replace shared keys with delegated tokens
The first concrete comparison is an agent calling an API with a shared key loaded from an environment variable. The key may be reused across users, environments, and services. The request succeeds, but the credential does not distinguish the people behind those requests. Rotation becomes a manual coordination problem, and the key’s permissions may be much broader than any one task requires.
The alternative inserts a backend into the credential flow. The agent requests access for one user and one target API. The backend uses a mechanism such as OAuth token exchange to provide a short-lived token. This gives the system a place to centralize token handling and associate downstream activity with user context.
| Concern | Shared environment-variable key | Delegated token flow |
|---|---|---|
| User context | Reused across users | Bound to a particular user |
| Target access | Broad, reused permissions | Limited to the target API |
| Credential lifecycle | Manual key rotation | Short-lived tokens, centrally managed |
| Accountability | Shared credential obscures attribution | User context supports an audit record |
Bobby reports that this approach has scaled better in their experience, including deployments with dozens or hundreds of agents; he supplies no measured benchmark.
Token scope is useful only when the system knows whose authority it represents. Identity connects actions to users, supports investigation, and informs subsequent access decisions. An agent running under a service account may possess considerable authority without knowing which user’s permissions should constrain a particular request. That creates the conditions for a confused deputy: the agent can exercise its own access on behalf of someone who should not have it.
The proposed foundation combines OAuth 2.1, Rich Authorization Requests, and token exchange, while preserving upstream identity and handling token refresh properly. In Bobby’s sequence, the agent asks the backend for access; the backend retrieves the necessary material from a vault and obtains a short-lived token for the user and API. The application uses that token transiently instead of making the agent a persistent store of secrets. The custody point is to avoid long-lived secrets carried around by the agent, not to assume that a usable access token can never enter application memory.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Control what the model sees and when the agent acts
In retrieval-augmented generation, authorization determines which information becomes model context. Different users should not automatically retrieve the same documents. Enforce access at the retrieval layer, before sensitive data reaches the LLM. Asking the model to decide whether it should reveal material is too late: the material has already crossed the boundary. Fine-grained policy enforcement belongs in the system that supplies the context.
Some actions also need approval at the moment they are about to happen. Client-Initiated Backchannel Authentication, or CIBA, separates the agent’s request from the device on which the user authenticates and approves it:
- The agent sends a request to the authorization server.
- The server contacts the user through a trusted device, for example with a push notification.
- The user approves or denies the request; Bobby also describes the possibility of asking for more information.
- The application receives the authorization outcome and can continue accordingly.
This suits background agents and environments without a screen available for a browser redirect. It removes the need for an approval interface on the agent’s device, not the user’s participation on the trusted device.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Remote MCP makes identity a request-level concern
MCP introduces another boundary as tools move from local processes communicating over standard input and output to shared servers on a network. A local integration’s assumptions do not automatically carry over to a remote, distributed system. Each request now needs a trustworthy association between the caller, the user, and the requested action.
The pattern presented here uses browser sign-in, followed by token issuance handled by the MCP server, with the agent’s scope and binding established before issuance. The client does not expose third-party credentials. This reflects the March 2025 MCP authorization specification, which referenced OAuth 2.1 as an IETF draft. Later MCP resource-server arrangements should not be substituted for this historical walkthrough. The security requirement remains straightforward: on a shared tool server, establish who is making each request and what that identity is allowed to do.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
A local trading assistant with an approval boundary
Kam brings these pieces together in a local AI trading assistant. He points to a collection of examples from the application’s package.json, then introduces the scenario: an agent makes local tool calls to a broker service to buy stock, but the user must explicitly approve the action before it executes. The design has three parts:
- User identification and context: establish which user the agent represents.
- Token vault: keep secrets and sensitive token handling out of the application’s embedded configuration.
- CIBA: obtain consent before executing the sensitive action.
The identity provider must support CIBA, an OpenID Connect specification. Auth0 supplies that role in the demo, but the pattern does not require Auth0 specifically.
The application is a TypeScript CLI with a stock-trading tool, inspected in IntelliJ. Kam mentions a Python example as forthcoming; the walkthrough here remains in TypeScript.
Before opening the runtime code, he sketches a fuller trading system. A user tells a chatbot to buy stock at a particular threshold. A polling service tracks the changing price. When the threshold is reached, the system requests approval through CIBA immediately before executing the trade. The demo leaves out parts of that monitoring stack to concentrate on identity and consent. Kam’s joke about trading rules based on vibes and Truth Social posts underscores why the live example avoids making market behavior its central dependency.
The runtime separates conversation handling from session setup. generateMessages mediates between the user and the LLM, with the buy tool supplied to it. main establishes the context and binds it to a particular session thread. That association gives tool execution a stable answer to “which user is using this session?” rather than requiring the model to infer identity from conversation text.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Authenticate, pause for consent, then call the tool
The tool definition is wrapped in two higher-order functions. useDeviceFlow bootstraps the OIDC authentication client so the application can obtain access tokens on behalf of a user. useCIBA intercepts the sensitive tool call and lets the user approve or deny it, supplying the identity provider with configuration about the requested resource use. These are the wrapper names shown in the recording, rather than a claim about today’s SDK signatures.
The demo uses a blocking callback: the application waits for approval before proceeding. An asynchronous continuation or polling arrangement could also be used. Blocking is an application choice, not a requirement that CIBA impose the same execution model on every client. The essential boundary can be expressed in TypeScript as a wrapper around a tool:
typescript
type Session = { userId: string };
type Tool<Input, Output> = (
input: Input,
session: Session
) => Promise<Output>;
type Approval<Input> = (
request: { userId: string; input: Input }
) => Promise<"approved" | "denied">;
function requireApproval<Input, Output>(
approve: Approval<Input>,
execute: Tool<Input, Output>
): Tool<Input, Output> {
return async (input, session) => {
const decision = await approve({
userId: session.userId,
input
});
if (decision !== "approved") {
throw new Error("User did not approve the action");
}
return execute(input, session);
};
}
Here, approve is the integration boundary for the approval flow. The tool receives the same input and session only after approval; a denial never reaches execute.
Inside the buy tool, Kam highlights the credential-handling call at line 28. The displayed code retrieves credentials, assigns an access token, and adds an authorization header before a POST request. He identifies the utility as Auth0 Token Vault and distinguishes its token-management role from that of a credential manager. Tokens are still sensitive credentials; the useful distinction is that the tool obtains the token it needs without embedding client secrets in its source.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
The ten-share request and the intended approval flow
As Kam starts the services, he emphasizes that local execution does not eliminate identity requirements. Multiple users, multiple agents, access to user files, and compliance concerns still demand attribution of who accessed what and when. This demo does not have a fully stateful service that persists user identity, so it begins with authentication through a user interface. Once the application has the user’s tokens, CIBA handles approval of sensitive actions without another login interface in the CLI.
OAuth, OIDC, and CIBA therefore belong in the initial application design, even if they are not the first features a developer wants to build. Kam acknowledges a competing pressure in an example application: enough infrastructure to make the security behavior meaningful, but little enough that readers can follow it. The simplified local services and blocking approval callback keep attention on that boundary.
The live request is to buy ten stocks of SECO. The intended next step is for the LLM to interpret the request and select the stock-buying tool. The attempt stalls; Kam attributes the interruption to Wi-Fi and switches to describing what should have happened. No completed approval or successful trade is shown, and the broker is a local mock trading service rather than a connection executing a real market transaction.
In the narrated flow, the authentication middleware would first prompt Kam to log in and obtain tokens for the agent to act on his behalf. CIBA would then send the authorization request to Auth0’s backend and trigger a notification on his phone. The notification would identify the agent and the proposed purchase of ten shares, rather than presenting a generic approval request without context. Kam could approve and advance the flow or cancel it. Subsequent trades would reuse the authenticated session, but each would still pass through CIBA approval. Signing in establishes identity; it does not preapprove every later trade.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Standards supply the foundation; integrations connect the pieces
Kam closes the demo by acknowledging that he has talked through the flow rather than successfully shown it. The components nevertheless correspond to defined protocols: OIDC for identity, CIBA for backchannel authentication and consent, and Rich Authorization Requests for richer authorization expressions. He describes Auth0’s offerings at the time as a mixture of developer previews and production capabilities, but is explicitly unsure whether CIBA is generally available or still in early access. The recording should not be treated as a definitive release-status announcement.
Bobby returns to the integration work left above those protocols. Standards reduce the need to invent identity mechanisms, but developers still need usable connections among authentication, delegated API calls, token exchange and storage, asynchronous confirmation, and authorization for retrieved data. Auth0 packages those pieces in Auth for Gen AI; Bobby notes that other platforms offer similar capabilities. OpenFGA is another option for fine-grained authorization without requiring Auth0’s platform.
The closing invitation extends beyond that product packaging. Bobby asks developers to bring the identity and access problems they encounter in practice, describes his participation in MCP specification discussions, and points to open-source work such as MCP Auth. The remaining engineering work is to make these standards usable together: carry the user’s authority through the agent’s tool calls, enforce access before data or actions cross a boundary, and return consequential decisions to the user when consent is required.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Resources
From the talk
The standard for backchannel authentication and consent, including poll, ping, and push token delivery.
The token-exchange standard covering delegation, impersonation, and target resources.
Structured authorization requests for expressing permissions beyond simple scope strings.
The March 2025 MCP specification describes OAuth-based authorization for HTTP transports.
An MCP server for Auth0 administration, with setup instructions and controls over exposed tools. The repository labels it beta.
An open-source engine for modeling and enforcing fine-grained permissions, with local setup instructions.
SDK setup for connecting an MCP resource server to a compatible authorization provider.
Further reading
JavaScript integrations and examples for tool authorization, RAG access control, and asynchronous user confirmation.
Updates since the talk
Current guidance for storing external-provider tokens and accessing APIs on users' behalf.
Full transcript
Loading transcript…