arXiv(opens in a new tab)cs.CRAug 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2609.00060

A Formal Analysis of Agent Payment Protocols

Ke Jiang, Mohan Yu, Yuan Chang, Mohit Kumar Jangid, Jianyu Niu, Cong Wang, Yinqian Zhang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Ke Jiang*, Mohan Yu*, Yuan Chang*, Mohit Kumar Jangid† Jianyu Niu‡, Cong Wang‡, Yinqian Zhang*,

*Southern University of Science and Technology, †Indian Institute of Technology, ‡City University of Hong Kong

Abstract—Agent payment protocols are emerging as a key transaction layer for autonomous commerce, enabling AI agents to purchase goods and services and execute payments on users' behalf. Unlike conventional payment flows, they distribute user intent, delegated authority, credential use, settlement, and fulfillment across multiple actors and stages, creating security dependencies that no single message or participant can enforce. Yet these guarantees remain largely implicit across evolving specifications, schemas, and reference implementations, with little systematic formal analysis.

We formalize four representative agent payment protocols: x402, MPP, ACP, and AP2 in Tamarin. Using a common abstraction of the agent payment lifecycle, we construct source-grounded models that capture each protocol's roles, state, trust assumptions, and lifecycle transitions. Rather than assuming a complete property taxonomy, we use source-backed verification questions and counterexample traces to expose missing bindings, state constraints, and cross-stage correspondences, consolidating them into 18 shared security principles. Across 86 verification cases, our analysis reproduces 46 known or calibration cases and identifies 40 previously undocumented formal-consistency findings. For each retained violation, we isolate the missing protocol relation, construct a minimally strengthened reference model, and reverify the intended property. We further evaluate the new x402 findings across three implementations and validate ten representative findings through implementation PoCs, SDK/schema-level witnesses, and source-aligned executable traces spanning five security principles. Our results show that delegated authorization must remain consistent with its resulting economic and service effects across actors, states, and protocol stages.

I. INTRODUCTION

AI agents are rapidly extending their autonomy into the economic domain, taking on delegated authority to transact on users' behalf. They can purchase goods [1], complete checkout [44], and pay for APIs [35], data [18], and digital services [15] with limited human involvement. This shift has spurred a new generation of agent payment protocols [37], [32], [25], [12] that automate payment negotiation and encode delegated authority. Adoption is already substantial: x402 alone reported more than 75 million transactions within a recent 30-day period [37].

As payment becomes part of autonomous agent execution, security must extend beyond validating an individual transfer. Unlike conventional payment flows, where authorization and checkout are more tightly coupled [4], [40], agent payments may separate authorization, payment, settlement, and fulfillment across different participants and times. A user may authorize a task before the final merchant or terms are fixed, so each subsequent step can be locally valid while the transaction as a whole is inconsistent with that authorization. Existing protocols realize this workflow differently: x402 [37]

and the Machine Payments Protocol (MPP) [32] integrate payment into HTTP interactions, the Agentic Commerce Protocol (ACP) [25] coordinates agent-initiated checkout, and the Agent Payments Protocol (AP2) [12] uses signed mandates to encode delegated authority. Despite these different designs, the security relations connecting authorization, payment, settlement, and fulfillment remain largely implicit across evolving specifications, schemas, and reference implementations.

Existing work provides only partial answers. Detailed studies have analyzed x402 and AP2 from the perspectives of protocol logic, implementation behavior, runtime attacks, and deployment security [16], [17], [35], [6], [14], while broader work organizes threats across agent payment and commerce systems [21], [22]. These efforts expose important weaknesses, but do not provide a common, machine-checked specification-level analysis across heterogeneous agent payment protocols. This leaves one central question: what security relations are required across agent payment workflows, and do current protocols preserve them?

Answering this question raises three challenges. First, the relevant relations are not fully explicit: security requirements are distributed across normative prose, schemas, examples, and reference implementations, while important bindings and state constraints may remain implicit or underspecified. Second, agent payment protocols encode transactions through different roles, authorization artifacts, settlement mechanisms, trust assumptions, and state machines, making comparison difficult without erasing protocol-specific semantics. Third, many violations arise only through stateful composition, such as retries, concurrent sessions, reusable credentials, and asynchronous payment or fulfillment, and are difficult to anticipate from isolated message analysis.

We address these challenges by analyzing x402, MPP, AP2, and ACP with a specification-driven, counterexample-guided methodology in Tamarin. We define a common verification boundary over roles, lifecycle stages, trust assumptions, and security-relevant effects, while deriving each protocol's executable semantics independently from pinned source evidence. Rather than assuming a complete property taxonomy, we begin with source-grounded verification questions fixed before each Tamarin run. Failed proofs are traced back to their source evidence and attributed to modeling errors, environmental assumptions, or source-supported protocol behavior; any newly exposed relation is independently formulated and verified before being consolidated across protocols. This process preserves protocol-specific semantics while progressively forming a shared security property system.

Our analysis yields 18 security properties across integrity, payment, and service, instantiated in 86 source-mapped verification cases for x402, MPP, AP2, and ACP. We reproduce 46 known or calibration cases and identify 40 previously undocumented formal-consistency findings. For each violation, we isolate the missing protocol relation, construct a minimally strengthened reference model, and reverify the intended property. We further evaluate the new x402 findings across three implementations and validate ten representative findings through implementation PoCs, SDK/schema-level witnesses, and source-aligned executable traces. These results show that locally valid protocol steps can still compose into globally inconsistent authorization, payment, or service outcomes.

Contributions. We make the following contributions:

  • A cross-protocol security framework for agent payments. We develop a specification-driven, counterexample-guided methodology that preserves protocol-specific semantics while consolidating independently verified relations into 18 security properties across integrity, payment, and service.

  • Systematic formalization of four emerging protocols. We formalize x402, MPP, AP2, and ACP in Tamarin through 86 source-mapped verification cases, capturing their end-to-end workflows, trust assumptions, and stateful execution semantics.

  • New security findings and verified repairs. Our analysis reproduces 46 known or calibration cases and identifies 40 previously undocumented formal-consistency findings. For each retained violation, we isolate the missing protocol relation, construct a minimal strengthening, and reverify the intended guarantee.

  • Practical validation. We evaluate the new x402 findings across three implementations and validate ten representative findings spanning five security properties through implementation PoCs, SDK/schema-level witnesses, and source-aligned executable traces.

Responsible disclosure. We responsibly disclosed our findings and proof-of-concept attacks to the corresponding protocol developers and maintainers. As several issues remain under investigation or mitigation, we withhold unnecessary exploit-enabling details and report only the protocol mechanisms, counterexamples, and controlled validation to establish the findings.

References (38)