Skip to content

What is spendctl?

spendctl is a local sidecar your AI agents send HTTP requests through. When a seller answers 402 Payment Required (x402 v1/v2 or MPP), spendctl:

  1. reads the price and recipient from the challenge,
  2. checks the agent’s policy — budgets, allowlists, recipient pins, approval thresholds, price jumps, chain depth,
  3. asks a human when the policy says so,
  4. reserves the budget atomically and asks your wallet to sign exactly once,
  5. records the attempt, decision, amount and transaction hash in a ledger you can export.

The agent never holds a key. The policy lives in a file the model cannot edit, enforced by a process the model cannot reach. Refusals come back as plain sentences the model can read.

  • The x402 v2 specification lists “Client-side budget management” as out of scope.
  • @x402/core’s spendControls caps a single payment (default $1) inside the agent’s process.
  • The CDP SDK’s x402 spend controls add rolling caps, but run in-process with an in-memory store by default.
  • Wallet policy engines see only their own keys; hosted agent-payment platforms govern only the wallet they hold.

spendctl is one policy and one ledger in front of whichever wallet and protocol your agents meet — the spend-policy control plane for AI agents, enforced in a sidecar you run. spendctl never holds keys or funds.