● the buyer-side runtime for x402

Your AI agent works.
You stay in control of every cent.

Agents can already pay their own way across the machine-to-machine economy — x402 moved 75 million payments last month, most under half a dollar. What's missing is the trust layer between you and the wallet. Wallie is an open-source allowance: fund your agent once, let it pay any x402 API autonomously, inside hard rails you define — budget caps, per-call limits, runaway-loop circuit breakers, a kill switch, and an audit ledger built for regulators.

Get started in 2 minutes $ npm run demo zero dependencies · Node ≥ 24 · MIT
75.4M
x402 payments / 30 days
$0.32
average payment size
120M
AI-initiated payments, Alipay / week
$8,400
typical runaway-agent bill, prevented

Protocol metrics: x402.org & public ecosystem reports, August 2026.

The rail exists. The trust layer doesn't.

Sellers got middleware. Facilitators verify payments are valid. Nobody checks whether they're sane. Three verified gaps:

🔥

Runaway agents are real

A research agent hit a retry bug on a Friday. By Monday its wallet was drained $8,400 in an infinite loop. Facilitators settle anything signed — even call #10,000 of the same mistake.

🧩

No install-and-go

Ecosystem operators report users abandoning x402 because setup means reading protocol specs, configuring wallets and facilitators by hand. "No single package handles everything."

⚖️

The law just changed

EU AI Act Art. 26 (in force Aug 2, 2026): deployers of spending agents need tamper-evident logs and human oversight — or face fines up to 3% of global turnover.

> "We're watching users choose an inferior protocol because it has a better first-5-minutes experience." — top-x402 operator, issue #1759 (still open)

How Wallie works

Three moves. One-time funding, then fully autonomous fine-grained pay-per-use — every call authorized against policy before money moves.

1

Fund the allowance once

Provision a dedicated agent wallet and load it with a fixed allowance. The agent can never touch more than this — by construction, not by promise.

terminal — human, one timeshell
$ npx wallie init            # provisions agent wallet
$ npx wallie topup 5.00     # loads the $5.00 allowance
$ npx wallie policy perCallMaxUsd 0.50
$ npx wallie policy allowHostSuffixes '["localhost","api.weather.example"]'
2

The agent pays its own way

Swap fetch for payingFetch. Wallie speaks the full x402 wire protocol — 402 challenge, price discovery, signed payment, settlement receipt — and authorizes each price through your policy before signing anything.

before — raw fetchagent code
import { payingFetch } from "wallie";

// ❌ fails with HTTP 402,
// or worse: works but uncontrolled
const res = await fetch(url);
after — wallieagent code
import { payingFetch } from "wallie";

// ✅ 402 → policy check → sign →
// pay → retry → receipt → ledger
const r = await payingFetch(ctx, url);
// r.txHash · r.costMicro · r.blockedBy
3

Watch everything. Intervene anytime.

A live dashboard shows balance, spend by destination, and every blocked attempt. Flip the kill switch and all spending freezes instantly — mid-flight. Underneath, an append-only ledger records every authorization, payment, and block with rule, reason, and tx hash: your Article 26 evidence trail.

.allowance/ledger.jsonl — append-only audit logEU AI Act Art. 26 §5
{"t":"payment","at":"2026-08-25T09:41:02Z","url":"…/weather?city=lisbon","amountMicro":"1000","txHash":"0xcddcb9a6…"}
{"t":"payment","at":"2026-08-25T09:43:57Z","url":"…/research?topic=agent-payments","amountMicro":"250000","txHash":"0x4e5bc352…"}
{"t":"blocked","at":"2026-08-25T09:44:31Z","rule":"velocity_circuit_breaker","detail":"rolling 12s spend would exceed $2.00 limit","attemptedMicro":"10000"}

Six rails. All enforced before money moves.

Policies live in a hot-reloaded config file. Change them any time — the next call uses them. Five rules block outright; one escalates to a human.

kill_switch

Instant freeze

One click pauses every payment for the agent — even mid-loop. Flips back just as fast.

host_not_allowlisted

Destination allowlist

Default-deny. If a prompt injection redirects your agent to evil-api.example, nothing leaves the wallet.

per_call_cap

Price ceiling

An endpoint repricing itself to $5.00 gets declined pre-auth — the agent never signs it.

velocity_circuit_breaker

Loop breaker

Rolling-window spend limit. A retry bug burns pennies, not thousands, before the breaker trips.

budget_exhausted

Hard total cap

The allowance is the ceiling. There is no overdraft, no credit, no surprise invoice.

human_approval_required

Escalation gate

Above your threshold, purchases pend for explicit human approval instead of auto-executing.

  npm run demo — actual output
── PHASE 1 · fine-grained pay-per-use ──
  PAID    weather?city=lisbon        $0.001000  0xcddcb9a6…
  PAID    research?topic=agent-pmts  $0.250000  0x4e5bc352…

── PHASE 2 · runaway loop ──
  PAID    loop #1 … #149             $0.010000 each
  BLOCKED loop #150                  velocity_circuit_breaker

── PHASE 3 · attack & mispricing ──
  BLOCKED evil-api.example.com       host_not_allowlisted
  BLOCKED report?id=q3-2026          human_approval_required
  BLOCKED feed?key=pro               per_call_cap

── RESULT ──
  spent $1.99 across 154 settled payments · 5 blocks enforced
  remaining allowance: $3.007 of $5.00

Built on x402. Pluggable settlement.

Wire format follows x402 v1 exactly — HTTP 402 challenges, base64 X-PAYMENT headers, receipts. Settlement ships with a deterministic local ledger so you can develop with zero funds at risk. Going live on Base mainnet means implementing two methods on one interface:

facilitator interface — the only seam that touches a chainTypeScript
interface Facilitator {
  verify(payment: PaymentPayload): Promise<VerifyResult>;
  settle(payment: PaymentPayload): Promise<SettleResult>;
}
// MockChain today · Coinbase CDP facilitator tomorrow · nothing else changes

Open source core. Hosted when you're ready.

The runtime is open source and self-hostable forever — it's the trust anchor, so it must be inspectable. Wallie Cloud adds the operational layer teams ask for within a week of running agents in production.

OSS Core

$0 forever

Everything on this page. Self-host, inspect, fork.

  • Full policy engine & six rails
  • x402 v1 client + seller middleware
  • Append-only audit ledger
  • Local dashboard & kill switch
  • Zero dependencies, Node ≥ 24
Clone the repo
MOST TEAMS

Wallie Cloud

$20/mo workspace + 1% volume*

For orgs running fleets of spending agents.

  • Multi-agent allowances & team roles
  • Block alerts → Slack / webhooks
  • Fiat top-up (card → USDC allowance)
  • Spend analytics & per-agent budgets
  • Managed facilitator routing
  • Free under $25/mo settled volume*
Join waitlist

Compliance Pack

Custom

For EU AI Act scope and regulated industries.

  • Art. 26 evidence exports (signed digests)
  • Policy-version-at-tx-time attestation
  • Configurable retention & WORM storage
  • SSO / SCIM, audit access for counsel
  • DPA & deployment review support
Talk to us

How Wallie Cloud works — same core, a thin control plane

1 · Your agentsSame payingFetch runtime, pointing at your workspace endpoint instead of a local file.
2 · Policy planePolicies, allowances and approvals managed centrally; hot-reload everywhere, versioned per change.
3 · SettlementRouted through managed facilitators (CDP-compatible) to Base/Solana USDC — or your existing provider.
4 · EvidenceLedger streams to tamper-evident storage. Alerts, exports, dashboards. Your keys, your funds.

*1% applies to settled volume beyond the free $25/mo. Non-custodial by default: keys never leave your infrastructure.

Questions engineers actually ask

Is the demo using real money?

No. It ships with a deterministic mock settlement ledger (HMAC-signed payloads, nonce replay protection) so anyone can run the full flow offline with zero funds at risk. Production settlement plugs into a real facilitator — e.g. Coinbase's CDP x402 facilitator for USDC on Base — by implementing two methods. The wire format already matches x402 v1.

Which protocols does it work with?

x402 v1 today — the standard with the broadest institutional backing (Linux Foundation; Visa, Mastercard, Stripe, Google among founding members). The payer/policy split is protocol-shaped, so MPP and L402 adapters slot in behind the same authorization gate without touching your agent's code.

Can my agent see the private key?

In the OSS core the key lives in your local state directory — same threat model as any dev wallet, scoped to a bounded allowance. Wallie Cloud is non-custodial: keys stay in your infrastructure; the cloud only sees policy decisions and public ledger events.

What stops a compromised agent from editing its own policy?

The policy file is owned by the human-side tooling, not the agent process — the agent only ever receives allow/deny verdicts. In Cloud, every policy change is versioned and attributable; the audit log records which policy version was active at transaction time.

Why an allowance instead of an API key with billing?

API-key billing is monthly, per-vendor, and soft-capped — you find out from an invoice. An allowance is pre-funded, per-agent, cross-vendor, and hard-capped at the moment of payment. That's the difference between an alert and a guardrail.

Give your agent its first allowance.

Two minutes, zero dependencies, no wallet, no chain, no risk — the full scenario runs on your laptop.

Get AllowanceKit on GitHub $ git clone … && npm run demo