← Publications · 2026-05-25
Xybern
Xybern Research
2026-05-25
Why OAuth Is Not Enough For AI Agents

Every enterprise that deploys AI agents already has OAuth. Most of them assume that means they have agent authorisation. They do not.

OAuth 2.0 is the most widely deployed authorisation protocol in enterprise software. It handles identity federation, service-to-service authentication, and delegated access across billions of API calls every day. Security engineers understand it. Procurement teams are comfortable with it. Compliance frameworks reference it.

It was also designed in 2012 for a problem that is fundamentally different from the one AI agents create.

This piece explains precisely where that gap is, why it cannot be patched with additional OAuth scopes or token configurations, and what an authorisation layer for AI agents actually requires.


What OAuth Was Built For

OAuth 2.0 solves one problem: delegated access. A human user wants to grant a third-party application the ability to act on a specific subset of their resources, without giving that application their credentials.

The canonical flow is straightforward. A user authorises a calendar application to read their Google Calendar. Google issues the application an access token scoped to calendar.readonly. The application presents that token to the Google Calendar API. Google validates the token, confirms the scope, and returns the data. The application never sees the user's password. The user can revoke the token at any time.

This is an elegant solution to a real problem. The critical elements are:

  • A principal (the human user) who consents to delegation
  • A client (the application) with deterministic, known behaviour
  • A resource server (Google Calendar) that enforces scope at the API level
  • A scope that defines what data the client may access

The OAuth model assumes the client is deterministic. Given the same token and the same API call, a correctly implemented application behaves the same way every time. The token answers one question: is this application authorised to access this resource?

AI agents break every one of these assumptions.


What AI Agents Actually Do

An AI agent is not an application in the sense OAuth was designed for. An AI agent is an autonomous process that makes decisions based on model reasoning and executes actions in external systems as a consequence of those decisions.

This distinction matters at every level of the governance problem.

An agent does not execute a predetermined call sequence. It reasons about what to do next based on its current context window, the instructions it has received, the outputs of previous tool calls, and the training data embedded in its weights. Two runs of the same agent against the same task can produce different action sequences. The same agent with the same OAuth token can send an email, delete a file, update a database record, or call an external API depending on what its model decides to do.

Agents also operate across extended time horizons. A single agent session can involve dozens of sequential actions, each one building on the results of the last. The agent that started by reading a customer record ends by sending a contract, filing a document, and updating a CRM. Every one of those actions happened under the same OAuth token.

In enterprise deployments, agents chain. Agent A produces an output that Agent B uses to take an action that Agent C uses to call an external system. When the external system receives that call, it receives a credential. The credential tells it nothing about the chain of reasoning and delegation that produced the action.

And agents operate at machine speed. There is no human reaction time between an agent decision and its execution. By the time an operator notices a problem, the action has already happened.


The Six Places OAuth Breaks

1. Scope Is Coarse. Agent Actions Are Surgical.

OAuth scope controls what APIs a client can call. It does not control what the client does when it calls them.

mail.send authorises sending email. It does not authorise sending this specific email, with this content, to this recipient, in this context, for this reason, at this time.

An agent with mail.send scope can send any email it decides to send. An agent with files.write scope can write any file it decides to write. The scope defines the boundary of the API surface. It says nothing about whether any specific action within that surface should be permitted given the current context, the current session, and the current policy.

What OAuth Scope Controls What Agent Governance Requires
Can this identity call this API endpoint? Should this agent take this specific action, right now, in this context?
Read / write permission on a resource class Per-action evaluation against policy
Granted at token issuance time Evaluated at action execution time
Static for the token lifetime Dynamic, context-sensitive
Binary: allowed or not Nuanced: allowed, blocked, escalated, or rate-limited

No OAuth configuration closes this gap. The gap is not about scope granularity. It is about the difference between access control and action governance.

2. OAuth Delegates to the Application. Not to the Agent's Reasoning.

The OAuth security model assumes the entity receiving the token is deterministic. A well-implemented application behaves predictably. If payment-service has a token scoped to payments.create, the scope of risk is bounded by what payment-service is programmed to do. You can audit the code. You can predict the behaviour.

An AI agent is not deterministic in this sense. The same agent with the same token can take wildly different actions depending on its context window, the instructions it receives, and the state of the model. A prompt injection attack, an unusual input, a model hallucination, or a subtle change in the task description can cause an agent to use a legitimately scoped token in a way the operator never intended.

OAuth validates the token. It cannot validate the reasoning that produced the action the token is being used to authorise.

Traditional OAuth Model:
[User]  grants  [App]  token  [API]
         Known, deterministic behaviour

AI Agent Model:
[Operator]  grants  [Agent]  token  [API]
              Unknown, emergent, context-dependent reasoning

The token is valid. The credential is legitimate. The action is still potentially wrong. OAuth has no mechanism to distinguish.

3. OAuth Produces API Logs. Not Authorisation Trails.

When an agent uses an OAuth token to call an API, the audit log records: which client called which endpoint at what time. It does not record why. It does not record what context led the agent to make that decision. It does not record the chain of reasoning from task instruction to action execution.

Compliance requirements in regulated industries do not ask what API was called. They ask what decision was made, by what process, on what basis, and what controls prevented the wrong decision from being executed. An OAuth-backed API log cannot answer these questions.

Audit Event Type OAuth API Log Authorisation Layer Record
Which API was called
Which token was used
What the agent intended to do
What policy was evaluated
What enforcement decision was made
Whether human review was triggered
Who approved the action
The signed decision record

Post-hoc API logs are observability. An authorisation trail is governance. They are not substitutes for each other.

4. Tokens Are Persistent. Agent Actions Are Situational.

An OAuth access token, once issued, authorises everything the bearer does with it for its lifetime. A sixty-minute token grants sixty minutes of access to every operation within its scope.

There is no native mechanism in OAuth to say: this token is valid for this specific agent, executing this specific task, in this specific session, and should not authorise actions outside the defined task boundary.

An agent that completes its assigned task but retains a valid token can, in principle, continue to take actions. An agent that is compromised mid-session can use the same valid token to exfiltrate data or escalate privilege. The token does not know what the agent was supposed to do. It only knows what it is allowed to access.

This is not a token lifetime configuration problem. No token expiry setting prevents an agent from taking unintended actions within its valid window. Shorter token lifetimes reduce exposure but do not eliminate it and create operational complexity in multi-step agent workflows that span natural token boundaries.

What is needed is not a shorter-lived token. It is per-action evaluation at the point of execution.

5. Multi-Agent Chains Break the Delegation Model Entirely.

OAuth was designed for two-party delegation: a principal delegates to a client. The client acts. The resource server validates.

Enterprise AI architectures are not two-party. They are n-party chains:

Orchestrator Agent
        │
        ▼
  Research Agent ──→ Web Search Tool
        │
        ▼
  Analysis Agent ──→ Internal Database
        │
        ▼
  Action Agent ──→ CRM API ──→ Email API ──→ Contract Storage

When the Action Agent calls the CRM API, whose OAuth token does it present? The token of the operator that initiated the chain? A service account token? A token issued to the Action Agent specifically?

Each of these choices creates a different accountability gap. An operator-level token used by a downstream agent grants that agent the full permissions of the operator for the entire session. A service account token severs the accountability chain from the human principal who authorised the task. An agent-specific token requires each agent to independently acquire and manage credentials, which does not compose cleanly in long-running pipelines.

More importantly: when the CRM receives the API call, it receives a credential. It does not receive information about who instructed the chain, what the original task was, what the intermediate agents decided, or whether any of those decisions were reviewed by a human. The accountability chain is invisible at the point of action.

OAuth extended with PKCE, DPoP, or token exchange helps but does not solve this. These are mechanisms for binding tokens to specific clients in two-party flows. They do not add the semantics needed to govern n-agent chains with maintained accountability at every action node.

6. OAuth Has No Human-in-the-Loop Primitive.

Regulated industries require human approval for high-stakes actions. A financial services firm needs a human to approve any agent action involving a transaction above a threshold. A legal firm needs a human to review before an agent files a document or sends external correspondence. A healthcare operator needs a human to confirm before an agent updates a treatment record.

OAuth provides no mechanism for this. An agent with a valid token executes at machine speed. There is no hook in the OAuth flow that says: pause here, ask a human whether this specific action should proceed, wait for approval, and then either execute or abort.

OAuth-based agent execution:
Agent decides to act  token valid  action executes
                        (no pause, no review, no escalation)

Authorisation layer execution:
Agent decides to act  policy evaluated  [if high-stakes: pause + escalate to human]
                                          
                    [low risk: execute]  [human approves/blocks]  execute or abort

Human-in-the-loop is not an OAuth extension. It is a different architectural requirement that sits outside the OAuth model entirely.


The Prompt Injection Problem OAuth Cannot Touch

There is a failure mode unique to AI agents that OAuth cannot address under any configuration.

Prompt injection is an attack in which malicious content embedded in an agent's context window manipulates the agent's reasoning and causes it to take actions the operator did not intend. The attack does not require compromising credentials. It does not require bypassing access control. It uses the agent's own reasoning against it.

An agent with a valid OAuth token that has been prompt-injected still presents a valid credential to the API it calls. The API validates the token and executes the action. OAuth sees nothing anomalous. The audit log records a legitimate call from a legitimate client. The action was still unauthorised in any meaningful sense: it was not what the operator intended, it was not what the business policy permitted, and it caused harm.

Defending against prompt injection requires evaluating the intent and context of every action at the point of execution, not validating the credential presented to the endpoint. This is an authorisation-layer problem, not a token problem.


What the Gap Looks Like in Practice

To make this concrete, consider a finance agent deployed to automate invoice approval workflows.

What OAuth provides: The agent has a token scoped to invoices.read, invoices.approve, and payments.create. The token validates that this service is allowed to call these endpoints.

What OAuth cannot prevent: - The agent approves an invoice from a vendor that was added to a blocklist yesterday because the token was issued before the blocklist was updated - The agent approves a duplicate payment because it does not check session-level context before executing - A prompt injection in the invoice data causes the agent to approve an invoice for ten times the legitimate amount - The agent completes the task but, with a valid token still active, queries unrelated customer financial records - A downstream agent in a multi-step chain uses a delegated token to approve an invoice that the original orchestrator was not authorised to touch - The agent takes all of these actions at machine speed before any human reviews the session

None of these failures are credential failures. OAuth is working exactly as designed. The agent presented valid credentials. The API accepted them. The problem is that credentials are not governance.


What an Authorisation Layer Actually Requires

The gaps OAuth cannot close define the requirements for a proper authorisation layer for AI agents. The requirements are architectural:

Per-action evaluation. Every action an agent intends to take is intercepted before execution and evaluated against active policy. Not at token issuance. At the point of action.

Full context evaluation. The evaluation considers the action itself, the agent's session history, the agent's trust score, the current policy set, and any signals from the environment. Scope-level access control is a necessary input, not a sufficient one.

A real-time enforcement decision. The authorisation layer returns allow, block, or escalate. The agent does not execute until it receives this decision.

Multi-agent chain accountability. Every action in a chain carries the full delegation context: who initiated the task, which agents have handled it, what decisions were made at each step, and whether human review occurred. Accountability is maintained at every node.

Human-in-the-loop escalation. The layer can pause on high-stakes actions and route them to a named human reviewer. The action does not execute until the reviewer approves or blocks. The reviewer's decision is recorded as part of the authorisation trail.

A signed audit record. Every enforcement decision — allow, block, or escalate — is recorded with a signed, tamper-evident record: what the agent intended to do, what policy applied, what decision was reached, and who authorised execution. This is not an API log. It is a governance record.

Capability OAuth Authorisation Layer
Identity validation
Scope-level access control
Per-action policy evaluation
Context-aware enforcement
Multi-agent chain accountability
Human-in-the-loop escalation
Signed authorisation audit trail
Prompt injection defence
Real-time block / allow decision
Session-scoped task boundaries

OAuth belongs in this stack. Identity validation and scope-based access control are prerequisites for everything above them. The authorisation layer does not replace OAuth. It operates above it, at the layer OAuth was never designed to address.


The Architecture in Practice

An authorisation layer for AI agents sits between the agent and every system it can act on. Every tool call, API request, file write, email send, or database update passes through the layer before it reaches the destination system.

┌─────────────────────────────────────────────────────────┐
│                    Agent Runtime                        │
│                                                         │
│   Agent decides to take action                          │
│                                                        │
│                                                        │
│   ┌───────────────────┐                                │
│     Authorisation    │◄── Active Policies             │
│     Layer            │◄── Trust Scores                │
│                      │◄── Session Context             │
│     Evaluate action  │◄── Human Review Queue         │
│   └───────┬───────────┘                                │
│                                                        │
│    ┌──────┴───────┐                                    │
│                                                      │
│  ALLOW          BLOCK        ESCALATE                  │
│                                                      │
│                                                      │
│  Execute     Return error   Human reviews              │
│  + sign      + log reason    approve/block            │
│  audit                      + signed record            │
└─────────────────────────────────────────────────────────┘

OAuth handles: identity validation, credential management
Authorisation layer handles: everything above

This architecture applies to every agent in the stack and every action in a multi-agent chain. The orchestrator's original task instruction creates an authorisation context. Every downstream agent that handles part of that task operates within that context. Every action in the chain produces a signed record that references the originating task, the full delegation path, and the enforcement decision at each step.

The result is an audit trail that answers the question regulators actually ask: not what API was called, but what was authorised, by whom, on what basis, and what controls were in place.


This Is an Infrastructure Problem

The framing of this as a security question understates the issue. OAuth was not a wrong choice. It was the right choice for the problem it was designed to solve.

The problem it was designed to solve is not the problem AI agents create.

Enterprises deploying agents today are making a category error: they are using access control infrastructure to solve a governance problem. These are different layers. Conflating them does not patch the gap. It hides it.

Every serious software stack has horizontal infrastructure layers. Compute, networking, storage, identity, observability. Each layer handles a concern that cuts across everything built on top of it. You do not implement TLS per application. You do not implement DNS per service.

AI agent governance is the missing horizontal layer. It sits above identity and below application logic. It intercepts every action at the point of execution, applies policy, and produces a verifiable decision record. That is not a feature of an agent framework. That is not a configuration of OAuth. It is a dedicated infrastructure component, and it does not yet exist in most enterprise AI deployments.


Xybern is the authorisation layer for enterprise AI agents. Every agent action is enforced, audited, and governed before it executes. Learn more at xybern.com or read the technical documentation at docs.xybern.com.

Share

Link copied!

Want more insights?

We publish regularly.

Stay updated with the latest research on verified AI reasoning.

More Publications Request a pilot