The failure mode in standard agent approvals

When teams connect large language model (LLM) agents to production backends, they face an authorization problem: how do you allow an autonomous agent to suggest database mutations, financial transfers, or deletions without giving it ambient authority to damage production data?

The standard industry approach is boolean human-in-the-loop (HITL) consent. When an agent decides to invoke a dangerous tool, the runtime pauses and asks the human a simple confirmation question:

def call_tool(name, args):
    if tool_requires_approval(name):
        if not ask_human(f"Approve running {name}?"):
            return rejected
    return execute(name, args)

This looks safe on the surface, but it contains a fundamental defect: the human approves a tool name, while the language model selects the runtime arguments.

Because an LLM’s reasoning is non-deterministic and vulnerable to prompt injection, the model can alter arguments between the moment of human review and the moment of backend execution. If an operator approves deleting a staging task named t-42, an injected prompt or hallucination can cause the model to invoke delete_task(task_id="t-99"), deleting a production record instead.

Traditional enterprise identity frameworks do not prevent this drift. If the human operator possesses general delete permissions across the workspace, role-based access control and attribute-based policy engines see a valid user and execute the command. The drift remains invisible to the policy engine because the access policy evaluates who the user is rather than what specific bytes the user authorized, allowing the model to carry the user’s identity faithfully while mutating their approved action.

Prompt-Injection Drift Attack:
1. Agent proposes: delete_task(task_id="t-42")
2. Human reviews:  "Approve deleting task t-42?" -> Human clicks Approve
3. Injected prompt: Agent substitutes task_id="t-99"
4. Boolean check:  "User approved delete_task" -> Executes delete_task(t-99)

Solving this requires shifting from ambient identity propagation to parameter-bound cryptographic delegation. Under this model, the human signs the exact parameters of the proposed action, an authorization server verifies that signature to mint an ephemeral, single-use credential, and the backend resource server (RS) executes the command only when the live request strictly matches the approved payload.


The four invariant constraints of agent delegation

An agent authorization architecture must satisfy four constraints. Drop any one of them, and the security model breaks in a predictable way.

1. Parameter-bound intent

The human’s cryptographic signature must be computed directly over the canonical bytes of the exact command and arguments that will execute.

We structure this using the Rich Authorization Requests (RAR, RFC 9396) specification. Along with the command name and arguments, the canonical payload includes an expiration timestamp (exp), an approver identity (approver_id), and the exact human-readable summary displayed on the consent screen (binding_message). The term and the pattern come from OpenID Connect Client-Initiated Backchannel Authentication (CIBA), where the same binding message is shown on the consumption device and the authentication device so the user can confirm the two refer to the same transaction, and the user’s own credentials are never exposed to the client. Including binding_message in the signed bytes prevents a compromised bridge from displaying a benign description (such as “Clean temporary cache”) while submitting destructive parameters (such as “Drop customer table”) to the user’s signing key.

One signed approval payload must exchange for at most one minted credential.

Most authorization systems track single-use guarantees only at the credential layer by recording consumed JSON Web Token (JWT) identifiers (jti). However, if an attacker intercepts the signed approval payload before it reaches the authorization server, they can present that same signed payload repeatedly within its time-to-live window. Each presentation generates a fresh, valid credential for the same destructive action. Enforcing consent atomicity requires the authorization server to record canonical payload hashes and reject duplicate mint requests.

The interface displaying the proposed action must run in a trust domain isolated from the environment orchestrating the LLM.

If the agent process controls the rendered pixels, it can present benign text to the human while passing malicious canonical bytes to the signing custodian. In production environments, the consent interface must be hosted by a dedicated authorization server (the standard Financial-grade API FAPI 2.0 deployment shape), so the operator reviews and approves what the authorization server renders rather than what the agent outputs. CIBA is the standardized form of this constraint. The current Internet Engineering Task Force (IETF) draft on AI agent authentication and authorization (draft-klrc-aiagent-auth) names CIBA as its human-in-the-loop mechanism for this reason, keeping user approval on an out-of-band channel the agent does not control, and pairs it with RFC 8693 token exchange for downstream calls.

4. Destination gating

The target resource server must independently validate the credential and enforce parameter binding on every state-modifying endpoint.

If the backend resource server permits ambient access or fails to match incoming request parameters against the token’s embedded authorization details, an agent could discover direct backend APIs and bypass the delegation workflow entirely.

From exact bytes to bounded intent

The reference implementation matches the live request byte-for-byte against the signed parameters. That is the right default for destructive one-shot actions, but it does not scale to a long-running agent that must act many times under one approval.

Google announced the Agent Payments Protocol (AP2) in September 2025 with over 60 launch partners, reaching v0.2.0 in April 2026. AP2 shows the same idea at two grains: an Intent Mandate signs an envelope of what the user wants, and a Cart Mandate binds the exact stock keeping unit (SKU), price, tax, and total before payment.

RFC 9396 leaves the fields of each authorization_details entry to the API that defines the type, and the specification’s own payment example bounds an instructed amount and creditor rather than identifying an exact transaction. A resource server following this pattern could evaluate incoming requests against bounds (such as a spending ceiling, an allowed set of task IDs, or an expiration window) instead of requiring byte-for-byte parameter equality, and the four constraints hold unchanged. This extension is not in the reference implementation yet.


Enforcing caller scopes before human prompts

A common design mistake is treating human-in-the-loop approvals as a substitute for basic transport-level access control. If an authorization gate only triggers when human confirmation is required, a caller with read-only permissions (tasks.read) could invoke non-gated write operations without restriction.

Our implementation enforces required scopes at the central dispatcher before routing requests to the approval gate. Tool declarations explicitly bind permissions to commands, requiring tasks.read for read tools (list_tasks, get_task) and tasks.write for modifying commands (create_task, update_task, delete_task).

When an incoming request arrives, the dispatcher first verifies that the caller’s bearer token includes the required scopes. If a read-only caller attempts a write command, the dispatcher immediately rejects the call with an Unauthorized error. The request never reaches the human consent surface.

This cleanly separates two distinct operational questions:

  1. Access eligibility. Does this caller possess the base authority to attempt this category of action?
  2. Action delegation. For this specific execution, did an authorized human explicitly sign these exact parameters?

Separating the security core from transport carriers

In a bridge architecture, you must distinguish between the security core (the cryptographic delegation mechanism) and the transport carrier (the protocol moving messages between systems).

┌────────────────────────────────────────────────────────────────────────┐
│ The Security Core: Cryptographic Delegation                            │
│ Human Signs Bytes ──> Authority Mints JWT ──> RS Validates Parameters  │
└───────────────────────────────────┬────────────────────────────────────┘
                                    │
          ┌─────────────────────────┴─────────────────────────┐
          ▼                                                   ▼
┌───────────────────────────────────┐   ┌────────────────────────────────┐
│ Single-Domain Carrier (MCP)       │   │ Multi-Domain Carrier (A2A)     │
│ URL Elicitation on tools/call     │   │ Task SSE Pause & Resume        │
│ No inter-agent protocol needed    │   │ Sub-agent delegation w/o auth  │
└───────────────────────────────────┘   └────────────────────────────────┘

Because the security core provides all cryptographic guarantees independently of the network transport, replacing the transport protocol does not alter the underlying safety guarantees.

Depending on the deployment architecture, we map the core across two transport patterns:

Single-domain workflows (Model Context Protocol)

In the common case where a single agent exposes tools directly to an operator’s client, no cross-agent transport is required. Under the Model Context Protocol (MCP) 2026-07-28 revision, the protocol core is stateless, with no Mcp-Session-Id and no initialize handshake, designed for deployment behind a round-robin load balancer. Mid-call user input is handled through Multi Round-Trip Requests, where a tool call returns resultType: "input_required" and the client retries the original call with inputResponses attached. URL-mode elicitation remains the required path for interactions that must not pass through the client, which is exactly what an out-of-band consent page requires. Long-running work moved to the io.modelcontextprotocol/tasks extension with polling via tasks/get.

The ActionAuth reference implementation follows this flow. The server pins mcp>=2.0 and negotiates the protocol version per request. For clients negotiating versions at or above 2026-07-28, the server answers a sensitive tool call with input_required carrying a URL-mode elicitation to the consent page. The operator reviews and signs there, and the client retries the call with the approval attached so the server can mint the credential and execute. Older clients receive the legacy URL-mode elicitation error (-32042) instead, because their result union lacks the input_required type and would fail per-version schema validation with -32603. A stateless protocol also makes the multi-replica replay trap described in the consent atomicity post the default deployment pattern rather than an edge case.

Multi-domain delegation (Agent-to-Agent Protocol)

When an orchestrator agent delegates tasks to external sub-agents, teams frequently make the mistake of forwarding ambient bearer tokens across the chain. Sharing bearer tokens destroys audit accountability because the sub-agent acts with the primary agent’s identity, and the audit log cannot prove which human authorized the sub-agent’s actions.

The Agent-to-Agent (A2A) protocol solves this by providing a structured task lifecycle. When a remote sub-agent encounters a destructive operation, it pauses execution and emits an auth_required server-sent event containing the required action parameters. The bridge translates this event into an MCP elicitation for the human operator. The human signs the sub-agent’s specific parameters, and the signed response routes back through the task stream. The sub-agent presents the signature to its local authorization server to mint an action-scoped credential. No bearer tokens are ever shared across agent boundaries.


Three independent enforcement layers

To ensure structural resilience, Tier-2 deployments divide authorization into three decoupled enforcement layers. The authorization server evaluates a Hash-based Message Authentication Code (HMAC) signature using the Secure Hash Algorithm (SHA) family before issuing tokens:

Layer 1: Pre-Mint Verification (OAuthAuthority)
- Verifies human HMAC signature over canonical bytes
- Enforces time-to-live policy (max_signed_payload_ttl_seconds)
- Tracks consumed signature hashes to prevent mint replay
                      │
                      ▼
Layer 2: Structural Non-Mutation (Dispatcher Pass-Through)
- Forwards minted JWT to Resource Server without modification
- Structural guarantee: Dispatcher holds no signing keys to alter claims
                      │
                      ▼
Layer 3: Live Request Validation (JwtResourceServer)
- Decodes JWT using independent verification key
- Validates issuer, audience, and expiration claims
- Tracks consumed jti values to prevent execution replay
- Enforces strict byte-level match between live args and authorization_details

Architectural trust asymmetry

These three layers establish defense in depth, but they contain an important architectural asymmetry:

  • Post-Mint Independence: Layers 2 and 3 operate independently. If a software defect occurs in the bridge dispatcher, the resource server’s independent verification logic catches and rejects the corrupted token.
  • Pre-Mint Trust Root: Layer 1 represents the single trust root for human intent. Because the human’s signature is verified at the authorization server and not forwarded inside the resulting JWT claims, the downstream resource server cannot independently detect if an authorization server erroneously minted a token without verifying the signature.

Layer 1 protects whether a credential should exist; Layers 2 and 3 protect how that credential is used.


Graduating from in-process verification to production infrastructure

Adopting parameter-bound delegation does not require deploying a complete enterprise OAuth infrastructure on day one. The architecture defines two graduated implementation tiers behind a single delegation authority interface:

Capability Tier 1: In-Process Gate (InProcessAuthority) Tier 2: Separated Architecture (OAuthAuthority + JwtResourceServer)
Destructive Credential Location In-process application memory Isolated on backend Resource Server
Verification Boundary In-process HMAC verification Dedicated Authorization Server
Prompt Injection Protection Fully defended Fully defended
Parameter Drift Protection Fully defended Fully defended
Host Process Compromise Vulnerable Defended (with client-side signing)
Operational Overhead Zero external infrastructure Requires AS, RS, and JWKS management

Teams can deploy Tier 1 immediately within a single service using shared symmetric keys. Tier 1 eliminates prompt injection, parameter drift, and replay attacks with zero infrastructure overhead. When organizational requirements mandate protection against host process compromise, teams can graduate to Tier 2 by swapping configuration, without altering core application call sites.


Intentional limitations in the reference implementation

A reference implementation is most effective when its boundaries and production gaps are stated plainly:

  1. Symmetric encryption in demo. The bundled demo uses symmetric HMAC with SHA-256 (HS256) signing between the authorization server and resource server for local execution simplicity. Production systems should deploy asymmetric signing (RS256 or ES256) with JSON Web Key Sets (JWKS).
  2. Server-side signing stand-in. The demo includes a local signer module (demo_signer.py) to simulate client interactions. In production, signing keys must reside on client devices using WebAuthn, passkeys, or hardware security modules.
  3. In-memory replay storage. Consumed token and signature registries in the reference run as in-memory sets. Production deployments should back these registries with durable, TTL-aware data stores like Redis or relational databases.
  4. Co-located consent server. The reference hosts the consent UI within the bridge process for local self-containment. As noted in constraint 3, production topologies must isolate the consent interface within a dedicated authorization server domain.

Architecture summary

Parameter-bound human-in-the-loop authorization reconciles autonomous AI planning with enterprise security requirements. By shifting from coarse boolean prompts to cryptographically bound action parameters, systems can safely execute destructive operations while preserving an immutable, verifiable audit trail.

The full reference implementation is available in the ActionAuth repository (action-auth, Apache-2.0). Detailed implementation walkthroughs and test contracts are covered in our companion guides: