Skip to content
SpendTheBits

Agents · 7 min read

AI agent payment checks: what to verify before an agent pays

By , Founder, SpendTheBits ·

In short

A spend cap answers one question: how much. Good AI agent payment checks ask five more before anything is signed: is this a seller I know, is the price normal for them, did the payout address change, is the host a lookalike, and is this a repeat? A sixth check reads how long the signed authorization stays valid.

$1
default per-payment cap in the x402 reference clientSource: x402 Docs

When an AI agent pays for an API over x402, the money question looks simple. The seller replies with a price, the agent signs, the seller gets paid. Most builders protect that loop with one number, a cap per payment. The x402 reference client ships with exactly that: by default it pays only recognized dollar-pegged assets and caps each payment at $1 [2].

A cap is a good start, but it only sees the amount. A payment can be small and still wrong: sent to a stranger, sent to an address the seller never used before, or signed for a site that only looks like the one you meant. This piece walks through six AI agent payment checks that a cap misses, what signal in the payment request gives each one away, and how to decide what happens next.

A magnifying glass over a payment ticket held by a robot, illustrating AI agent payment checks.

What a cap sees, and what it cannot

In x402, a seller that wants payment answers with a list of accepted options. Each option names a scheme, a network, an amount in atomic token units, a token contract called the asset, a payout address called payTo, and a maximum time for payment [3]. A cap reads one of those fields. The other fields carry just as much risk.

The protocol itself leaves this work to you. The x402 specification lists client-side budget management as out of scope [3]. The reference client offers spend controls that run before any custom policy and before the payload is signed, and it points builders to a hook that runs before a payment is created for anything interactive, such as asking a person [2]. That hook is where the checks below belong.

Think of the checks as questions about context. The amount is a number in the request. Whether that number is normal, whether the address belongs to this seller, and whether you already paid for this exact thing are facts about history. A cap has no history, so it cannot answer them.

Checks one and two: a new seller, an odd price

The first check is the simplest. Has the owner, or this agent, ever paid this seller before? A first payment is not wrong, but it is where most mistakes happen, because there is nothing to compare against. A sensible policy treats a first-time seller as something to show a person, or at least to log, rather than something to pay in silence.

The second check compares the price with that seller's own history. Agents often call the same endpoint many times. If a call that usually costs a cent suddenly asks for fifty cents, the cap may still allow it, yet the jump is the signal. Keep a running record of what each seller normally asks for, and flag any request far above its usual level.

Both checks need memory, which is why they live outside the protocol. The request tells you the amount and the payout address [3]. Your own records tell you whether either one is new.

Check three: the payout address changed

This is the check that saves real money. A seller you trust is identified in your head by its web address. The payment, though, goes to payTo, the address inside the request [3]. If that field quietly changes, every later payment goes to someone else while the site still looks familiar.

The x402 docs say this plainly for retries: when terms such as the scheme, network, amount, asset or payTo change, re-run your payment policy checks or ask the user for approval [1]. Apply the same rule every day, not only on a retry. Store the payout address you last paid for each seller. If a new request names a different one, stop and ask.

There can be honest reasons for a change, such as a seller moving to a new wallet. That is fine. The point is that a person sees it once and agrees, instead of an agent following it without a word. For more on spending limits that sit on the chain itself, see our guide to agent wallet spending limits.

Checks four and five: lookalike hosts and repeats

A lookalike host is a web address built to pass a quick glance. The Unicode security standard explains the problem: a machine can tell any two character strings apart, but people can struggle when an application allows characters that look the same, so they may think they are dealing with one service when another is spoofing it [5]. An agent that reads a link from a web page or an email is exposed to the same trick, often with even less judgement.

The payment request names the resource it is for in its resource field [3]. Compare that host with the host the agent meant to call, and flag mixed scripts or characters that are easy to confuse. If the names do not match, do not sign.

Repeats are the fifth check. Each EIP-3009 authorization carries a unique random nonce, and the token contract refuses to use the same nonce twice [4]. That stops the same signature being spent twice. It does not stop your agent from signing a second, fresh payment for something it already bought. The x402 docs warn that after a payment header has been sent, the outcome should be treated as unknown and a second payment should not be created automatically [1]. A duplicate check, keyed on the seller, the resource and a short time window, catches the agent that loops.

Check six: how long the signature lives

Under EIP-3009, a payer signs a transfer that someone else submits. The signature carries two times, validAfter and validBefore, so the payer controls the window in which it can be used [4]. Inside that window, anyone holding the signature can submit it. Outside it, the token contract refuses.

The seller suggests the window through maxTimeoutSeconds, the maximum time allowed for payment [3]. The specification's own example uses 60 seconds [3]. A seller that asks for an hour or a day is asking for a signature that stays useful long after the call is done. The specification lists time windows as one of its defences against replay, because they limit how long an authorization lives [3].

A good rule is to set validBefore yourself, close to now, whatever the seller asks for. If a seller insists on a long window, treat that as a reason to pause. For the full anatomy of the signature, read our EIP-3009 explainer.

Turning checks into a decision

Each of these AI agent payment checks gives you a reason, not a verdict. The useful design is three outcomes: allow, ask a person, or block. A known seller at a normal price with an unchanged address and a short window can pass. A first-time seller might go to a person. A lookalike host or a changed payout address on a large payment might be blocked outright. Write down which outcome each reason leads to, so the agent behaves the same way every time.

Record every decision, including refusals. When something goes wrong, the question is never only what was paid but also what the agent was told and why. A log of refused requests also shows you when an agent is being targeted, because a burst of blocks is itself a signal.

Finally, remember the cap still matters. The checks above reduce mistakes inside the limit. The limit decides the worst case when every check is fooled. Keep both, and test them the way you test any other code.

How SpendTheBits runs these checks

SpendTheBits is a self-custody wallet, and it runs the six checks above for agents that ask it first. Before an agent's request reaches the owner, SpendTheBits checks it for a seller the owner has never paid, a price far above that seller's usual price, a payout address that changed, a lookalike web address, a duplicate request and a payment authorization that stays valid too long. The owner chooses whether an unusual request is shown to them or blocked. Owners can also block sellers and set a limit per seller for each agent.

Every answer is written to the owner's Agent activity record, allowed, waiting for the owner, or blocked, with the rule that decided, and refused requests are recorded too. Be clear about the limits. The budget rules are cooperative: they apply when the agent checks a payment with SpendTheBits first, and an agent that skips the check is limited only by the USDC at its address. That balance is the hard limit, because each agent has its own key and only the USDC the owner chose to put there.

If you are setting up a first agent, start with the agents page, then read how to let an AI agent buy a gift card for a worked example with an approval step.

SpendTheBits approval screen for a gift card an agent wants above its per-card limit
A request above the agent's limit waits for the owner to approve or decline.

In the app · 3 steps

Put an agent's payments behind checks in SpendTheBits

Agent budgets live in Settings. Here is the path from a new agent to seeing every decision it got.

  1. Create an agent budget

    Open Settings, then Agent budgets, and tap New. The agent gets its own key and only the USDC you put at its address.

    The Agent budgets screen in SpendTheBits with one agent and its balance
  2. Decide what unusual means

    Choose whether an unusual request, such as a new seller or a changed payout address, is shown to you or blocked. Add a limit per seller if you want one.

    An approval screen for an agent request above its limit
  3. Read what the agent was told

    Agent activity lists every answer: allowed, waiting for you or blocked, with the rule that decided. Orders show what the agent actually paid for.

    A list of orders with their status, including ones paid by an agent

Hold your own keys, keep the yield, skip the middleman.

SpendTheBits is a fully non-custodial wallet for 13 chains, free on iOS and Android.

Frequently asked

No. A cap limits the amount of each payment, but it cannot tell whether the seller is new, the price is unusual, the payout address changed or the host is a lookalike. Use the cap as the worst case and add checks for the rest.

On the client, before the payment is signed. The x402 specification leaves client-side budget management out of scope, and the reference client runs spend controls before signing and offers a hook for approval flows [2][3].

Stop and ask a person. The x402 docs say to re-run policy checks or request approval when terms such as payTo change [1].

They stop the same signature being used twice, because the contract refuses a used nonce [4]. They do not stop an agent from signing a new payment for something it already bought, so you still need a duplicate check.

Sources

  1. 1.Client / Server - x402 · x402 Docs · accessed 2026-11-12
  2. 2.Quickstart for Buyers - x402 · x402 Docs · accessed 2026-11-12
  3. 3.x402 Protocol Specification, version 2 · GitHub (Coinbase) · accessed 2026-11-12
  4. 4.ERC-3009: Transfer With Authorization · Ethereum Improvement Proposals · accessed 2026-11-12
  5. 5.UTS #39: Unicode Security Mechanisms · Unicode Consortium · accessed 2026-11-12

This article is educational and reflects observed data and public sources on the date shown. It is not financial, legal or tax advice. Digital assets can lose value; yields shown are observed, not promised.

STB Weekly, every tuesday

The short version of pieces like this one, plus what moved in AI in finance and agent payments. What you get

Product updates and release notes. No price calls, no spam, unsubscribe in one click. We email you once to confirm before anything else is sent.