# Where spend controls can live

> Five places a spending rule for an AI agent can live, what each one can enforce, and what it cannot see. With sources, and where a sidecar fits next to the limits you already have.

Source: https://spendctl.dev/docs/spend-controls-compared/ (spendctl documentation; index of all pages at https://spendctl.dev/llms.txt)

**In short:** a spending rule for an agent can live in the prompt, in the payment SDK inside the agent's process, in the wallet's policy engine, in a hosted platform that holds the wallet, or in a sidecar the agent's requests pass through. They are not alternatives. Each sees a different part of a payment, and the useful question is which part each one cannot see.

## Side by side

| Where the rule lives | Runs in | Can enforce | Cannot see or do |
|---|---|---|---|
| Prompt ("never spend more than $5") | the model | nothing; it is a request | everything: the model can be argued out of it |
| Payment SDK option | the agent's process | a cap per payment, sometimes a rolling total | other processes and restarts, the host being paid, a human approval |
| Wallet policy engine | the wallet provider | rules on the keys it holds | other wallets; often the typed-data signatures x402 uses; the HTTP request behind a payment |
| Hosted agent-payment platform | the vendor's service | caps and sometimes approvals on the wallet it holds | wallets held elsewhere; traffic that does not go through it |
| Sidecar (spendctl) | a process you run next to the agent | budgets, allowed hosts, pinned recipients, approvals, one ledger, across wallets and protocols | payments that do not pass through it (see [what it does not cover](#what-a-sidecar-does-not-cover)) |

## Prompt instructions

An instruction is read by the same model an attacker is trying to steer. In a 2026 study by researchers at Cornell Tech and Yale, nine of ten frontier models raised their own daily cap when they could reach the confirmation code, with no attacker involved. [Why prompts are not spending controls](https://spendctl.dev/docs/evidence/) collects the evidence. Keep the instruction, because it shapes ordinary behaviour, and do not count it as a control.

## Payment SDK options

The x402 client ships a per-payment cap, `spendControls`, with a default of `$1` per payment, and it can be switched off with `false` ([source](https://github.com/x402-foundation/x402/blob/main/typescript/packages/core/src/client/x402Client.ts)). It caps one payment, so a daily or per-task total has to be built on the client's hooks, which a public issue describes as hard to do correctly ([x402 issue #3703](https://github.com/x402-foundation/x402/issues/3703)). The x402 v2 specification itself lists client-side budget management as out of scope ([specification](https://github.com/x402-foundation/x402/blob/main/specs/x402-specification-v2.md)).

Coinbase's CDP SDK adds rolling caps for x402, and its README warns that the client assigns no default spend controls: unless you configure them, no cap applies ([README](https://github.com/coinbase/cdp-sdk/blob/main/typescript/packages/cdp-sdk/README.md)).

What an SDK option cannot change is where it runs: inside the agent's process, configured by the code the agent is part of. It knows the amount. It does not know which host the task was meant to pay, and it has nobody to ask.

## Wallet policy engines

A wallet provider can refuse to sign. That is a strong control for the keys it holds, and it stops at them: an agent with two wallets has two policies. There is also a gap specific to x402. Privy's documentation notes that x402 payments are signed as EIP-712 typed data rather than sent as ordinary transactions, so a policy written for `eth_sendTransaction` does not cover them ([Privy docs](https://docs.privy.io/recipes/agent-integrations/x402)). And a wallet sees an address and an amount, not the URL the agent called or the price that endpoint charged last time.

## Hosted agent-payment platforms

Managed services now include spending limits. Amazon Bedrock AgentCore payments, for example, gives each payment session a budget and an expiry and denies further payments when either is reached, with two wallet providers supported ([AWS docs](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/payments.html)). Limits like these are free with the tooling and worth switching on.

What they govern is the wallet inside that platform. A team with a CDP wallet for one agent, its own key for another and a card-based method for a third has three sets of limits, three approval paths (or none) and three ledgers.

## A sidecar

spendctl runs as a separate process next to the agent, and the agent's HTTP requests go through it. When a seller answers 402, the sidecar reads the quote, checks it against a policy file the model cannot edit, and only then asks your wallet to sign. Because it sits on the request path, it knows what the others do not:

- **the host and path** the agent actually called, so rules can name sellers and endpoints, not only addresses;
- **the last price** paid for that endpoint, so a jump needs a human;
- **every agent and wallet behind it**, so one budget, one approval flow and one ledger apply to all of them;
- **who is asking**: approvals need an admin token the agent never holds.

It does not hold keys or funds. Signing happens in the sidecar you run, against a wallet you own, a Coinbase CDP server wallet or your own key.

### What a sidecar does not cover

- A payment the agent makes without going through it. Do not give the agent a key of its own; the sidecar is only a control if it is the only way to pay.
- A compromised host. If the machine running the sidecar is taken over, the policy is too. Keep wallet balances small and add the wallet provider's own limits behind it.
- Budgets across several sidecars with separate ledgers. One sidecar serialises its budget checks; pooled budgets across sidecars are in development for Team.

The full list is on the [Security model](https://spendctl.dev/docs/security/).

## Use them together

1. Keep the instruction in the prompt. It prevents honest mistakes.
2. Leave the SDK's per-payment cap on. It is a last line inside the process.
3. Switch on your wallet provider's limits. They hold even if the sidecar's host is lost.
4. Put the policy that names hosts, budgets, recipients and approvals in the sidecar, where one file covers every agent and every wallet.

## Next

- [Budgets for AI agents](https://spendctl.dev/docs/agent-budgets/): the policy file, key by key.
- [HTTP 402, x402 and MPP](https://spendctl.dev/docs/how-agents-pay/): what a quote contains and who signs.
- [Sandbox](https://spendctl.dev/docs/sandbox/): try a refusal and an approval with mock money, nothing to install.
