We Tested Our Own x402 Agent Payments With Real Money — Found a Bug, Fixed It, Here’s the Proof
Description and use
The x402 payment gateway for AI agents on Base mainnet occasionally failed due to a stale OFAC sanctions cache that triggered a 5 MB download. Removing the download from the payment path, adding an hourly cache refresh, and widening the authorization window to 600 s fixed the issue, allowing all GPU orders to settle in seconds.
Problem
The x402 payment endpoint failed for some GPU jobs due to a stale OFAC sanctions-list cache causing a 5 MB Treasury re‑download that exceeded the 120‑second authorization window.
Outcome
All eight GPU jobs settled with on‑chain hashes; two previously failing jobs now complete in 18.8 s. The payment path no longer stalls due to cache refresh.
Workflow
- 1. Submit GPU job request to public x402 endpoint.
- 2. Endpoint issues 402 Payment Required challenge.
- 3. Agent signs authorization and sends payment request.
- 4. System checks OFAC cache; previously triggered a 5 MB download.
- 5. Payment processed and on‑chain transaction confirmed.
- 6. Job executed and resources torn down.
Evidence
2 of 8 jobs failed on a 120‑second payment authorization window.
Root cause wasn’t price lookup or payment logic — it was our OFAC sanctions‑list cache going stale, triggering a live 5MB Treasury re‑download on every payment with no timeout.
Re‑ran the exact failing config: settled in 18.8 seconds.
- Record date: 2026-09-22T14:15:39.403Z