
What know your agent means for onchain lending
Gareth Christian-Lim, Midnight Foundation
Moment at 1:00:10Episode 3 · Credit Markets on Demand
For an agent that pays, we build the wallet, the limits it cannot override and the client that answers payment requests. For an API, store or platform that agents pay, we build the x402 or MPP paywall or the ACP or UCP checkout. Settlement, reconciliation, screening, refunds and monitoring come with either side. Agent payment volume is still small, so a first build covers one flow you can measure.

Reviewed by Luis Medeiros, Field CTO at ProtofireLast reviewed: October 2026
Agentic payments are payments an AI agent makes or receives on someone's behalf: an agent paying an API per call, a shopping assistant checking out inside Copilot or Gemini, a service billing other machines by the request. Protofire builds agentic payment integrations on both sides of that transaction: agents that pay within limits you set, and APIs, merchants and platforms that get paid by agents.
For each flow we pick the protocol that fits: x402 or MPP when an agent pays per request, ACP or UCP when it checks out inside an AI assistant, AP2 mandates when you need proof of what the user approved, and the Visa and Mastercard agent programs when it pays by card. Our comparison of agentic payment protocols sets out how they differ.
The x402 v2 specification lists "client-side budget management" as out of scope, so an agent's caps across many payments belong in its wallet. Under the Visa Rules, the cardholder answers for an agent's purchase as if they had made it.
A stablecoin payment has no chargeback, so refunds need their own path. We build those parts for the protocol you choose, starting with the smart account or wallet that holds the agent's limits.
Every agent payment crosses these layers, from the authority a person grants the agent to the ledger entry that records the payment. Protofire can build one of them or all seven, and run monitoring and operations after launch.
x402 sets no budget of its own, so the agent's limits go where the agent cannot change them. The plainest form is an allowance: the agent may spend a set amount of one token, and the allowance resets on an interval. Safe's Allowance Module works this way for a Safe, and Coinbase's Spend Permissions for a Coinbase smart account.
Around the allowance we add caps per payee, allowlists and an expiry, so the agent pays only the services you approved, until a date you set.
Both are smart accounts, contract wallets whose rules run onchain. The same limits can run as session keys or delegated permissions on ERC-4337 accounts (Final since June 2026, EntryPoint v0.9), on existing addresses given smart-account features through EIP-7702, or through ERC-7710 and ERC-7715 delegations (both still Drafts, as in MetaMask's Smart Accounts Kit).
Where keys should not sit in a contract, we integrate MPC, enclave and embedded agent wallets and set the policy they check before signing: Circle's Agent Wallets (2-of-2 MPC with caps over a rolling window), Coinbase's Agentic Wallet, Turnkey's enclave policy engine, Privy or Fireblocks. The wider practice sits in our account abstraction and wallet development work.
If you sell an API, data, inference or content, we add a payment step an agent can complete without an account or an API key. x402 is governed by the x402 Foundation, which the Linux Foundation declared operational on 14 July 2026, and its v2 HTTP transport carries a payment in three messages:
1. Your server answers an unpaid request with HTTP 402 and a PAYMENT-REQUIRED header whose accepts list gives the scheme, network, amount, asset and payTo, the address that receives the payment.
2. The agent signs an authorization for that amount and payee, then retries the same request with the signed payload in a PAYMENT-SIGNATURE header.
3. A facilitator (the service that checks the signature and submits the payment onchain) settles it, and your server returns 200 with the resource and a PAYMENT-RESPONSE header holding the settlement result and the onchain transaction hash.
We pick the facilitator for your rails: Coinbase's CDP facilitator, Circle's, Fireblocks' white-label facilitator for payment providers, or Stripe, which settles to your Stripe balance in fiat. The mppx library serves MPP and x402 clients from one endpoint, so cards and stablecoins can share a route.
For sub-cent prices we batch settlement (x402's batch-settlement scheme, Circle's Nanopayments or MPP sessions) and plan around each provider's floor: on Stripe, 0.01 USDC for stablecoins and 0.50 USD for cards.
If you build agents, we make them able to pay. The client reads the price in the 402 response, checks it against the agent's limits, signs an authorization for that amount and payee, resends the request and stores the settlement result. The signature format follows the chain and the account: EIP-3009 or Permit2 for ERC-20 tokens on EVM chains, an ERC-7710 delegation from a smart account, or an SPL transfer on Solana.
x402 defines transports for HTTP, MCP and agent-to-agent (A2A) calls, so the same client works inside MCP tool calls and between agents, and we can run it on Amazon Bedrock AgentCore Payments, which supports x402 and MPP with wallets from Coinbase and Stripe's Privy. Every payment is logged with the request that triggered it, so a person can audit what the agent bought and why.
If you sell goods or subscriptions, we connect your catalog and checkout to the AI assistants your customers shop in. We integrate the feeds, checkout endpoints and delegated payment tokens through the payment provider you already use, such as Stripe's Agentic Commerce Suite, PayPal Agent Ready, Adyen or Checkout.com, so you stay merchant of record and keep your dispute process.
Where an agent buys without the shopper present, we add AP2 mandates or Mastercard's Verifiable Intent so you hold signed evidence of what was approved. Where you accept cards, we wire in Visa Intelligent Commerce and Mastercard Agent Pay, including agent recognition through Visa's Trusted Agent Protocol and Web Bot Auth verification of Mastercard Agent Pay agents at the CDN.
Agent payments still have to land in your books. On stablecoin rails we settle in USDC, which carried 99.6% of x402 value according to a September 2026 analysis by TRM Labs, or another stablecoin you hold, such as OUSD, the default stablecoin on Stripe since 30 September 2026, and convert to fiat through Stripe or a ramp where you need it.
We map every settlement to the order, API call or invoice it pays for, using x402's payment-identifier and receipt extensions and the indexing practice we built on The Graph, so finance sees each agent payment as a ledger entry tied to its order. When value moves between chains we use Circle's CCTP for native USDC or Chainlink CCIP. Our crypto payments work covers the wider rails.
Whichever protocol carries the payment, these are the controls we design and build into the integration.
Caps per payment, per day and per payee, token and network allowlists, and expiry, enforced in the smart account or at signing. Coinbase's own documentation says an instruction to the agent "is not a server-enforced session spending limit", and its CDP SDK keeps its default spend ledger in memory, so we put limits where a restart or a prompt cannot reset them. Ran Wei of Pharos Network described the gap on The Protocol Roundtable: "We need to redesign all these policies and execution rules according to what the agent needs, and how much authority we should authorize them to do."
The person or business that delegated authority is the payer, under every framework we checked. The Visa Rules make a cardholder responsible for an agent's actions "as if the Cardholder initiated the Transaction", and in the US, for debit and bank-account payments, Regulation E does not treat a transfer as unauthorized when the consumer gave the access device to the person who made it, until the consumer tells the financial institution that transfers by that person are no longer authorized. We design the consent capture (signed mandates, passkey-approved instructions) and, where you act as the agentic payment provider, make order confirmations available to the cardholder for the 120 days the Visa Rules require.
A stablecoin transfer has no chargeback, so a refund path has to exist before launch: x402's auth-capture scheme (hold, capture, void, refund), Coinbase Payment Acceptance's authorize, capture and refund flow, an escrow contract modelled on Circle's open-source Refund Protocol (an unaudited reference design, not a product), or a card leg where chargebacks already apply. Visa also forbids merchants from making cardholders waive their dispute rights on agentic transactions.
Sanctions screening and KYT (monitoring where funds come from and go) at the facilitator or the wallet (Coinbase's facilitator and Circle's Agent Wallets both screen), plus Travel Rule data where it applies. Under the EU Transfer of Funds Regulation there is no low-value exemption for crypto transfers, and above EUR 1,000 to or from a self-hosted wallet, one no provider controls, the provider must assess ownership or control (Articles 14(5) and 16(2)); the US rule applies at $3,000 or more, and FATF lets countries set a de minimis threshold of up to USD or EUR 1,000. Batching cuts the number of onchain transfers, but the regulated provider's data duties stay the same. We build these hooks into your existing stack through compliance integration.
Sellers need to tell an approved agent from a bot, and the card networks now require agents to register. We implement signed agent requests (HTTP Message Signatures as used by Web Bot Auth, now an IETF working-group draft, and by Visa's Trusted Agent Protocol), card-network agent registration, and onchain identity through ERC-8004, a Draft standard whose identity registry has been live on Ethereum mainnet since 29 January 2026. Gareth Christian-Lim of the Midnight Foundation said on The Protocol Roundtable: "You have KYC and KYB and AML checks. We've got KYA, which is know your agents."
Spend dashboards, anomaly alerts, a log that ties every payment to the agent action behind it, and a kill switch that revokes a session key or pauses a module in one step. Reuters reported in October 2026, citing people familiar with the matter, that the OCC, FDIC and Federal Reserve are asking banks what limits their AI agents run under, how their actions are monitored, approved and audited, and how the systems can be shut down. We can run this around the clock through managed onchain operations, with the guardrails, logging and human approval gates of our AI automation work.
Agentic payments are payments an AI agent initiates for a person or business that authorized it, and that person or business stays the legal payer. They run over pay-per-request protocols (x402 and MPP), checkout protocols inside AI assistants (ACP and UCP, with AP2 mandates as proof of consent) and the card networks' agent programs.
Visa and Artemis counted about $15.0 million in adjusted x402 volume across 109.6 million transactions up to 21 April 2026, after excluding identified wash and test activity, and about $25,000 for MPP in its first weeks. TRM Labs estimated in September 2026 that between 0.6% and 7.5% of screened x402 value is agentic, and Visa's chief executive described agentic commerce as being in "very early stages" in July 2026.
Several of the rails are live or in beta: Coinbase and Circle settle x402 on mainnet, Stripe accepts it in its Frontier release phase, Amazon Bedrock AgentCore Payments lets agents pay x402 and MPP endpoints, Cloudflare runs x402 in a closed beta, and Visa reports live agent purchases in Europe with more than 30 issuers. At this volume, a first integration should be narrow enough to measure: one paid API, or one agent paying for its tools.
Luis Medeiros, our Field CTO, said on The Protocol Roundtable: "In the short term, we're not prepared yet to hand over the keys to the agents end to end, right?" The Launch phase below is built on that view.
The keys, the spending limits and the reconciliation carry most of the risk in an agent payment system, and each maps to work we do in production. Keys and limits sit in smart accounts and wallets: we deployed Safe across EVM networks, and we build account abstraction and wallets.
Reconciliation rests on indexing: we have built and open-sourced subgraphs on The Graph since 2019. We maintain Solhint, the Solidity linter, and we build AI agents for operations with guardrails, logging and human approval gates.
“Every payment is logged with the request that triggered it, so a person can audit what the agent bought and why.”
We deployed Safe smart accounts with the contracts, indexing and interface on each of those networks. With its Allowance Module, a Safe is a direct way to cap what an agent can spend.
We authored and open-sourced subgraphs for protocols including Maker, Curve, Compound governance, UMA and Lens. An x402 payment settles as an onchain transaction, so the same kind of indexing joins each settlement to the order, API call or invoice it pays for.
| Build in-house | With Protofire | |
|---|---|---|
| Protocol coverage | You track x402, MPP, ACP, UCP and AP2 as each ships new versions | x402 or MPP for per-request flows, ACP or UCP for checkout, chosen per flow in design and integrated by us |
| Spending limits | You design and enforce limits in your own wallet code | Caps per payment, per day and per payee, enforced onchain (Safe Allowance Module, session keys) or by a wallet policy engine at signing |
| Liability and refunds | You design consent capture, refunds and dispute evidence | A signed mandate or passkey-approved instruction as the consent record, a refund path chosen per rail, and 120-day order confirmations where you act as the agentic payment provider |
| Compliance | You wire screening and Travel Rule data into each rail | Sanctions and KYT screening at the facilitator or wallet, with Travel Rule data passed into your existing compliance stack |
| Reconciliation | You build the mapping from settlement to ledger | Each settlement joined to its order, call or invoice through x402's payment-identifier extension and an indexer |
| After launch | Your team runs monitoring and incident response | Spend dashboards, anomaly alerts and a one-step kill switch, run 24/7 by us or by your team from our runbooks |

Gareth Christian-Lim, Midnight Foundation
Moment at 1:00:10Episode 3 · Credit Markets on Demand
Tell us what you are building. An engineer reads it, we have a short call, and the written proposal follows within one business day.
Budget
An NDA is available from the first message and can cover anything you share. How it works