The blockchain does not forget, but it often fails to enforce. On July 15, X-Agent open-sourced xpense, a payment control plane designed for AI agents. The code is live on GitHub. The docs promise a seven-step deterministic flow. The integration with OKX’s TEE and x402 is complete. But here is the scar: the code is unaudited. Every transaction leaves a scar on the blockchain, but without a third-party audit, that scar could be from a hemorrhage, not a healing. This is not a product launch. It is an invitation to inspect the scaffolding before the building is occupied.
Context:
The problem is real: AI agents must pay for compute, data, and API services. Existing solutions like HTTP 402/x402 provide raw payment channels but no upper-layer control. Agents can drain budgets, be tricked into repeat payments, or receive subpar service with no recourse. Xpense fills that gap by acting as a middle-layer control plane — a middleware between the agent and the payment rail. It defines a deterministic flow for authorization, execution, verification, and settlement. It also introduces a dual state machine to separate payment logic from delivery verification. The project is backed by OKX’s Agentic Wallet, using their Trusted Execution Environment (TEE) for key isolation. In my analysis of DeFi yields in 2020, I discovered that protocol revenue projections often ignored automated bot activity. Here, the risk is similar: the architecture looks clean on paper, but the hidden assumptions matter. The core promise is that every agent financial action becomes a single, verifiable chain of facts. But who verifies the verifier?
Core:
Let me walk through the architecture as presented. The seven-step flow is: (1) Agent emits an intent to pay, (2) Policy engine checks budget and rules, (3) Funds are locked in the underlying wallet (OKX’s x402 wallet), (4) Service is requested from a provider (e.g., an API endpoint), (5) Delivery is verified — this is where the dual state machine comes in. One state machine tracks payment (pending, fulfilled, refunded). Another tracks service delivery (requested, completed, failed). They are decoupled to allow refunds without human intervention. (6) Settlement occurs only after successful delivery confirmation, (7) An immutable audit trail is recorded on-chain. This design treats the LLM as a non-trusted root — the model never holds keys or signs transactions. Instead, it triggers the policy engine which runs inside OKX’s TEE. The private keys reside in the TEE, isolated from both the user and the LLM. This is a reasonable engineering compromise for today’s hardware constraints. But based on my audit experience during the 2017 ICO boom, I know that complex control flows often obscure simple bugs. The policy engine logic must be bulletproof. A flawed rule — for example, a budget reset bug — could allow an agent to drain a wallet. The routing algorithm that selects the cheapest provider (principle three) could be gamed by malicious providers offering low prices with fake attestations. The documentation claims that delivery verification uses TEE attestations. That is only as strong as the TEE manufacturer. Data is the only witness that cannot be bribed — but here the witness is a black box. The code is open, but without an audit, we are trusting that the smart contracts and the TEE enclave implement the design correctly. In my 2021 NFT wash trading expose, I found that 60% of high-value sales were between wallets controlled by the same entity. Here, the equivalent would be a provider that submits a fake delivery attestation to receive payment without delivering service. The dual state machine is elegant, but it introduces an oracle problem: who decides if delivery was successful? The current design relies on the TEE to attest, but the TEE cannot verify semantic correctness of a service. An AI model provider could return junk and still produce a valid TEE attestation that the compute ran. The gap between attestation and reality is where manipulation hides. This is the scar that will appear on-chain if not fixed.
Contrarian:
The market narrative frames xpense as bringing trust to AI-agent payments. The contrarian angle is that it actually shifts trust from the LLM to a centralized policy engine and a single hardware vendor (OKX’s TEE). That is not decentralization. It is a walled garden with a nice key. The team is anonymous — no names, no track record. Open-source is necessary but not sufficient. I wrote in my wash trading expose that transparency without verification is just theater. Here, the transaction logs are public, but the logic that decides to pay might be buggy. The dual state machine is elegant in theory, but in practice the oracle remains: who verifies delivery? TEEs are not sybil-resistant oracles. A malicious provider could fake attestations if they compromise the TEE or if the TEE has side-channel vulnerabilities. The routing algorithm could be gamed by creating fake provider identities. The project’s reliance on OKX creates a single point of failure — if OKX’s TEE is breached or if the partnership ends, xpense’s security model collapses. Correlation does not equal causation: just because the code is open and integrated with a major exchange does not mean it is secure. Silence is data too. The absence of an audit, the absence of team visibility, and the absence of multi-wallet support are all gaps that bear watching. The architecture is clever, but cleverness without verification is a risk.
Takeaway:
xpense is a bold step toward a machine-payable economy. But before integrating any agent with real funds, demand two things: a comprehensive audit from a top-tier firm (like Trail of Bits or OpenZeppelin), and a clear roadmap to multi-wallet support to de-risk the OKX dependency. The code is a scar we can read, but its meaning is yet to be determined. Watch for delivery verification failures in the wild. If the dual state machine works under adversarial conditions, it will become a standard. If it fails, it will be a cautionary tale. The next signal to monitor: publication of an audit report. Until then, treat xpense as a prototype, not a production system. The blockchain remembers, but it cannot protect against unverified logic.

