← All Recipes
Bazantic // Recipe

Agent Spend Audit

By K

agent-spend-audit

Audit an AI agent fleet's x402 stablecoin spend and decide whether to block a vendor. Use this when asked what agents spent, which vendors or facilitators are risky, what blocking a vendor would cost, or whether a proposed block is safe to enforce. The one thing to get right: in x402 the agent SIGNS an EIP-3009 authorization and a facilitator BROADCASTS it, so the on-chain tx.from is the facilitator, NOT the spender. Measured on Base, payer differs from tx.from on 99.6% of payments, so attributing spend by tx.from credits almost every payment to the wrong party. Always attribute by payer. Enforcement follows the same asymmetry: constrain eth_signTypedData_v4, never eth_sendTransaction, because the agent never calls the latter. Always backtest a proposed block before recommending it: a rule that blocks nothing is noise, and a rule targeting a vendor that many independent payers also use is probably a false positive. The most valuable answer is often that a rule should NOT be enforced. Cite transaction hashes in every claim, because a spend or risk statement no one can verify is worthless. Never say enforcement happened: a proposal is not an enforcement, and applying one requires a human quorum approval.

Recipe inputs
Complete fields before a run.
Enter raw JSON for this Recipe.
Output example
Representative published output.
{
  "spend": {
    "payments": 908,
    "total_usd": "5065.56",
    "payer_ne_txfrom": 905,
    "attribution_note": "905 of 908 payments have payer != tx.from. Attributing by tx.from would credit them to the relaying facilitator."
  },
  "caveats": [
    "Every payment is confidence 'heuristic': these are reconstructed from AuthorizationUsed + Transfer + calldata, not proven settlements.",
    "amount_usd is null for assets that are not USD stablecoins; decimals alone are not a price.",
    "Nothing was enforced. Enforcement requires a human quorum approval."
  ],
  "risky_vendors": [
    {
      "why": "Not present in the ERC-8004 registry.",
      "rule": "R1",
      "address": "0xcc1984e79726e7a0ae2b9df2ac9e79fb4983930e",
      "backtest": {
        "would_block": 0,
        "recommendation": "Do NOT enforce. 302 independent payers use this vendor, so a block is likely a false positive.",
        "false_positives": 1
      },
      "evidence_tx": [
        "0x0b291976699594c3e72cb6675f2e9cbf41c3cf1f80bf394b236c35005e3b9e28"
      ]
    }
  ]
}