Skip to content

Agentic Payments Development and x402 Integration for Agents With Spending Limits

Protofire builds agentic payments for firms whose software agents pay with stablecoins. The firm keeps the keys and gets spending limits in a Safe it controls, a payment client, and refund and ledger records. We deployed Safe on 120+ EVM networks, and Safe's registry lists our allowance module deployments.

Luis Medeiros

Reviewed by Luis Medeiros, Field CTO at ProtofireLast reviewed: November 2026

On this page
  1. Overview
  2. Why it matters
  3. What you get
  4. Keys and kill switch
  5. Where the limit is stored
  6. Why Protofire
  7. How the work goes
  8. How work starts
  9. Not the right fit
  10. Related guides and services
  11. FAQ

Work shipped for 60+ networks and 95+ protocols, including

  • Chainlink
  • Ethereum
  • Solana
  • Safe
  • Ripple
  • Aave

Payment code and spending limits for your firm's agents

An agent that pays on your firm's behalf needs a spending limit written as a rule in code that the agent cannot edit. A sentence in the agent's instructions is no such rule. For example, your finance lead asks one thing before an agent pays its first invoice: what stops the agent from spending the whole balance?

Protofire's agentic payments development builds the spending limit and the parts around it. For your agents, we build the wallet limits and the payment client. We also build the paywall on your API, the refund path and the ledger entries. A wallet product built around a user's account falls under wallet development. Our guide compares the agent payment protocols.

Who holds, sets, builds and settles each part of an agent payment

Your firm holds the keys and writes the spending policy. Protofire builds the code that enforces the policy. The facilitator or payment provider settles each payment.

Your firm

Keys and signers

The owners of the Safe, or the user of an MPC wallet, hold the keys the agent spends from.

Spending policy

The written design sets caps per payment, day and payee, and a payee allowlist. It also sets the expiry and the approval threshold.

Approval step and kill switch

A person approves each payment over the threshold the policy sets. The signers revoke the agent's allowance to stop it.
Protofire builds

Limits code

The allowance module setup or the wallet policy enforces the written policy.

Payment client and paywall

The client answers 402 requests for your agents, or the paywall takes payment on your API.

Refunds and ledger entries

Protofire builds the refund path and an indexer that ties each settlement to its order.
Your provider

Facilitator or payment provider

The provider verifies and settles each payment. Your firm picks it, and Protofire integrates it.

Agentic payments need a spending limit the agent cannot change

An agent that pays by itself spends from a wallet, and the payment protocol does not decide how much.The x402 specification lists "Client-side budget management" as out of scope. TRM Labs describes the result in its analysis of 9 September 2026: "No human approves the payment. The agent signs and a facilitator broadcasts, with no review in between."

An instruction to the agent does not supply the missing budget control. Coinbase's documentation says that an instruction to the agent "is not a server-enforced session spending limit". The same documentation says that settled x402 payments are irreversible. Coinbase's x402 SDK keeps the cumulative spend ledger in memory by default. So the count is lost on a restart unless you provide a persistent store.

Cards expose the firm too. The Visa Rules make the cardholder responsible for what an agentic payment provider does in an agentic transaction (Rule 4.1.23.10, October 2026 edition). The cardholder answers for it "as if the Cardholder initiated the Transaction". If the limit is left in the prompt, a wrong x402 payment cannot be taken back once it settles.

You have KYC and KYB and AML checks. We've got KYA, which is know your agents.
Gareth Christian-Lim, Director of Growth, Midnight Foundation, Guest on The Protocol Roundtable · The Protocol Roundtable, Credit markets on demand

What Protofire builds for agent payments

Agents spend inside a budget they cannot rewrite

The limits are caps per payment, day and payee, a payee allowlist and an expiry. They are stored in a wallet that the agent does not control. Protofire builds them in a Safe, with the Safe's allowance module and the policy code around it. On accounts built with account abstraction, the limits run as session rules.

Your agents can answer a payment request

Protofire's payment client reads the price in a 402 response and checks it against the limits. The client then signs the payment and retries the request. It logs each payment with the request that led to it. x402 works over HTTP, MCP and agent-to-agent calls.

Your API gets paid by agents that hold no account

Protofire adds an x402 or MPP payment step to your API, data or inference endpoint. Payments go through the facilitator or provider you pick. Prices of less than a cent settle in batches under x402's batch-settlement scheme.

Shoppers' agents reach your checkout through your payment provider

Protofire connects your catalog and checkout to agent checkout in the ACP and UCP style. The connection goes through the payment provider you already use. Where an agent buys without the shopper present, we add AP2 mandates, which record what the user approved. For cards, Visa's 2 July 2026 release says its Trusted Agent Protocol and Agent Directory are "designed to help merchants to securely recognise and work with verified AI agents".

A refund path and ledger entries exist before the first payment

Protofire builds the refund path and an indexer that ties each settlement to its order in your ledger. The indexer makes that match with x402's idempotency key and receipts. Screening results are passed into your stack through compliance integration.

Alerts and a log show what the agent bought

Each payment is tied to the agent action that caused it. Monitoring runs on your side, or under a written scope as managed onchain operations.

Who holds the keys, sets the policy and stops the agent

The agent spends from keys your firm holds, under a policy your firm wrote.Protofire holds no keys and no client funds. Safe's own quickstart for an AI agent with a spending limit describes the mechanism. Once the allowance module is active on a Safe, "you can set an allowance per token for a spender". The allowance is one-time, or it "resets after a certain time interval (for example, 100 USDC every day)".

Your firm sets the spending policy in a written design. The design names the caps, the payees and the expiry, and the amount over which a person approves a payment. Protofire's code enforces the policy in a place that the agent's client cannot change.

To stop the agent, your signers remove its allowance with a Safe transaction. The Safe itself calls the module's deleteAllowance function, for one delegate and one token. So the agent cannot call it, and Protofire cannot either. If your firm already holds its keys on a custody platform such as Fireblocks, Protofire integrates that platform.

Where the agent's spending limit is stored and who can change it

Where a limit is stored decides who can change it and what a restart does to it.

Where it is stored

Spend ledger in Coinbase's x402 SDK: In memory by default. A persistent store is an option.

Allowance in your Safe: Onchain, in a module on a Safe that your owners control.

After a restart

Spend ledger in Coinbase's x402 SDK: The default store is process-local, so the cumulative count is lost unless you provide a persistent one.

Allowance in your Safe: The allowance is stored onchain and resets on the interval you set, such as 100 USDC a day.

Who changes it

Spend ledger in Coinbase's x402 SDK: Whoever writes and deploys the agent's client.

Allowance in your Safe: The Safe's signers, who set an allowance and delete it.

Our Safe record: networks, allowance modules and Plasma

120+
EVM networks where we deployed Safe
$2B+
secured in Safes on those networks
10
pull requests merged into Safe's modules registry

Protofire builds an agent's budget as a spending limit in a Safe.We deployed Safe on 120+ EVM networks, where it secures $2B+.

Safe's modules registry lists our allowance deployments

Between October 2025 and April 2026, Safe merged 10 pull requests from Protofire engineers. The pull requests added allowance, ERC-4337 and passkey module deployments for networks including Chiliz, Morph, Shape, Sei, Moonbeam and Ethereal. Six of them are Allowance Module deployments, for Ethereal, Chiliz, Morph, Shape, Boba and Hoodi. Safe's docs use the Allowance Module for an agent's spending limit.

Plasma's documentation lists Protofire Safe

Plasma's account abstraction page lists Protofire Safe on Plasma Mainnet and Testnet. The page says: "Protofire Safe provides modular smart account infrastructure and account abstraction stack."

The Safe Ecosystem Foundation dates our Safe work to 2018

In May 2026 the Safe Ecosystem Foundation's forum stated that Protofire "has been contributing to Safe since 2018". Our Safe deployment work is described on the Safe multisig deployment page.

Solhint and the Wirex card partnership

Protofire maintains Solhint, its open-source Solidity linter. Solhint has been downloaded 25M+ times from npm. Protofire announced a card partnership with Wirex on 26 June 2026.

How an agent payments project with Protofire runs

  1. Step 1

    A written policy for one flow

    Protofire settles with you who pays whom and where each key is held. We also settle the caps, payees, expiry and approval amount. The design names the facilitator or provider and the rail.
  2. Step 2

    Limits code and payment client on a testnet

    Protofire builds the limits code and the payment client. We test them on a testnet with attempts to exceed each cap.
  3. Step 3

    Provider integration, refund path and settlement indexer

    Protofire integrates the facilitator or payment provider you picked. We also build the refund path and the settlement indexer.
  4. Step 4

    Your signers activate the module

    Your signers activate the module on your Safe and set the first allowance from your keys. The first payments run with low caps, and a person approves each payment over the threshold.
  5. Step 5

    Contract audit before mainnet

    An audit firm you pick reviews the contracts before mainnet. Protofire prepares the code for the audit and fixes what the auditors find. An audit lowers risk but does not guarantee the absence of bugs. You receive the code, the policy design and the runbooks.

How work with Protofire starts

Work with Protofire starts with the first flow you want to measure.You tell us who pays whom, on which rail, and who in your firm signs for the agent. Commercial terms are on our how we work page.

Proposal
In writing, one business day after the discovery call: findings, a plan in phases and the first step we recommend.
Price
Fixed per phase when you commission it, against written acceptance criteria. Overruns inside them are ours to absorb, invoices follow delivered milestones, and you can stop at any phase boundary. Anything we operate after launch is priced in the proposal as its own recurring line, with the notice to end it.
Ownership
Code we write for you, contracts, the keys and credentials this work creates and the accounts your infrastructure runs in are yours by contract, within the license of any third-party software involved. Keys that a custody platform or a staking provider holds under its own key model stay with it under your contract; every other custody key stays with you or the custodian you appoint. Where the scope places something on servers we rent, it says what moves to you and when. An NDA is available from your first message, and we sign a data processing agreement (DPA) together with it.
After launch
Delivery closes with a hypercare window and a defect warranty, with their terms written into the proposal. A service we operate continues under its written scope until that scope ends.
Access
Read-only by default. A role that can start requests only if your written scope names one; never a signer, approver, administrator, key holder or recovery role on your contracts, wallets or custody platform. Services we build call each platform on credentials your staff issue and keep in your vault. Anything that approves or moves funds runs in your environment, and a scope under which we operate a service lists every write call it makes. Where the scope has us operate nodes, validators, monitors, explorers or indexers, it names the role and any key we hold on those servers, and in your own cloud account you can remove it.
Licenses
Protofire is an engineering firm and holds no financial or crypto-asset license; licensed activity stays with you and your providers.

How we work shows a worked proposal.

When agent payments with Protofire do not fit

A plain API key or a provider's own wallet is sometimes enough.

  • Your flow works as well with an API key and a monthly invoice. We say so in the design.
  • You want Protofire to hold keys, run the facilitator or take on a license. Protofire is an engineering firm with no financial or crypto-asset license. Licensed activity remains with you and your providers.
  • The asset or rail needs a licensed provider. Protofire integrates the provider you contract with.

FAQ

What is agentic payments development, and what does Protofire build?
Agentic payments development builds the parts that let AI agents pay with stablecoins on a firm's behalf. Those parts are the wallet limits, the payment client and the refund and ledger layer. Protofire builds them and integrates the facilitator or payment provider your firm picks. Your firm writes the spending policy.
Who can build agent payments for a company that wants its software agents to pay for things?
Protofire builds agent payments for companies whose software agents pay for things. We build the spending limits, the payment client and the integration with the provider the company chooses. Protofire's record is in Safe, where the spending limits are stored. Agents that pay suppliers are covered on our stablecoin treasury payments page.
How do you stop an AI agent from overspending?
A limit stored where the agent cannot edit it stops an AI agent from overspending. On a Safe, the allowance module gives a spender an allowance per token that can reset on an interval. In AWS's Bedrock AgentCore Payments, each payment session has a budget limit and an expiry. Further requests are denied once either is reached.
Who is liable when an agent makes a wrong payment?
For card payments, the Visa Rules put the responsibility on the cardholder. The stablecoin protocols do not answer the question. According to TRM Labs, "Who is responsible for this payment?" is a question that x402 was not built to answer. Your firm and its counsel decide who answers for an agent's payment and which payment rules apply to it. Protofire gives no legal opinion.
Can a stablecoin payment made by an agent be refunded?
Not by default, because Coinbase's docs call settled x402 payments irreversible. So the refund path is built before launch. The x402 specification lists an auth-capture scheme with authorize, capture, void and refund operations. An escrow contract is the other route. For cards, the Visa Rules bar a merchant from making a cardholder waive the right to dispute an agentic transaction.
What is x402, and does my API need it?
x402 is an open payment standard over HTTP. Your server answers an unpaid request with a 402 status and a price. The agent signs a payment and retries the request, and a facilitator settles the payment. Your API may not need x402 if your customers are content with an API key and a monthly invoice. Protofire says so in the design.
Is it too early to build agentic payments?
Agent payment volume is small, but the payment rails are live. In September 2026, TRM Labs put the share of screened x402 commerce that appears to be agentic at between 0.6% and 7.5%. Visa said on 2 July 2026 that it supports live agentic commerce transactions in Europe, working with over 30 European issuers. Protofire suggests one flow you can measure, with limits in place from the first payment.

Discussed on The Protocol Roundtable

All episodes

Get a proposal

Tell us what you are building. An engineer reads it, we have a short call, and the written proposal follows within one business day.

Luis MedeirosField CTO, reads every request · LinkedIn

A demo or repository link also works.