Funded key with limits, or approve each payment? Putting a spend policy between an AI agent and HTTP 402 A developer built spendctl, a local sidecar that sits between an AI agent and HTTP 402 payment endpoints (x402/MPP), keeping the private key and spend policy outside the model. The sidecar enforces per-request and daily budgets, domain allowlists and human approval thresholds, and adds an explicit 'unknown' ledger state for payments that settle while the paid API times out, backed by idempotency keys and a manual resolve command. A hosted sandbox is available as a remote MCP server with tools including sandbox_pay, check_budget and approve. Agents can pay for APIs now. With x402 and MPP a server answers 402 Payment Required with a price, the client signs a stablecoin authorization, retries, and gets the data. No API key, no invoice, no account. It works, and it is the part people demo. The part nobody demos is who decides . Two patterns keep coming up: Both put the money decision inside the agent's reach: in a prompt, in a tool argument, in an environment variable the model can read. I wanted the decision outside the model, in something a human writes once and can audit later. That became spendctl , a local sidecar. This post is about the design, including the one state that turned out to matter most. The agent never holds a key. It sends its HTTP request through the sidecar instead: as a gateway URL, through HTTP PROXY , with a wrapFetch in the SDK, or as an MCP pay tool. When the seller answers 402, the sidecar does three things: $0.40 would exceed the daily budget of $0.25 for agent researcher , $0.21 already spent" , not as a stack trace. agents: researcher: budget: { perRequest: "0.05", daily: "0.25" } allow: "api.example.com" requireApprovalAbove: "0.02" The model sees a budget, a refusal or an approval id. It never sees a private key, and it cannot change the policy. A payment that crosses the threshold needs a human. Two modes: X-Spendctl-Approval: