LIMPAY v0.1.0

x402 spend gate · mainnet opt-in

Agents spend.
You stay in control.

LimPay is a local gate that decides — atomically — whether an agent may pay. A per-transaction cap, host and payee allowlists, per-agent and team daily budgets, and a human above a threshold. All of it before anything is signed.

How a decision is made
  • Python 3.11+
  • stdlib only
  • SQLite reservations
  • MIT
POST /check · 127.0.0.1:8402 sample
  1. url https://api.example.com/search · amount 0.03 ← allow · remaining 0.07 · reservation c8a95f…
  2. url https://api.example.com/quote · amount 0.02 ← allow · remaining 0.05 · reservation 71b42e…
  3. url https://api.example.com/search · amount 0.04 ← approval · above threshold 0.03 · pending, budget held
  4. url https://api.example.com/search · amount 0.05 ← deny · agent daily budget exhausted (0.09/0.09) · nothing signed
agent/day 0.09 / 0.09 USDC
illustrative log · field names from README
Pauses the generated glyph scene behind the hero: the portal, the cap line and the drifting characters. The transcript and the page content stay visible.
  • 20 × 0.10

    concurrent payments against a $1.00 budget: exactly 10 pass. There is a test for that.

    source · repo test suite

  • 7 rules

    amount, per-tx cap, host, payee, agent, team, approval — first failure wins and every evaluation is logged.

    source · POLICY.md

  • 0 funds

    held. LimPay is not a wallet: it never holds money, and mainnet stays off until you opt in.

    source · README, POLICY.md

01 — rationale

The balance is not a budget.

A facilitator answers one question: can this wallet cover the payment? It has no idea what an agent is allowed to spend today, on which host, or for what.

Settlement is not policy

The facilitator checks the wallet and moves the money. Per-agent budgets, allowlists and approvals have to be decided somewhere else — outside the model and outside the SDK.

A prompt can spend fast

A prompt-injected agent does not need a big balance to do damage. Thousands of tiny payments clear a wallet in seconds, and a system prompt is not a control.

Concurrency breaks checks

Twenty parallel calls can all read the same free budget. LimPay reserves inside one BEGIN IMMEDIATE transaction, so budget and row commit together.

02 — the rule

Seven checks. First failure wins.

The order is normative, encoded in tests, and logged at every step — allowed or not. Each evaluation writes an audit row.

  1. 01

    amount parses and is > 0

    Decimal strings, stored as integer micro-units. Floats are never used for money.

    deny
  2. 02

    amount ≤ per_tx_max

    The ceiling that survives a prompt injection.

    deny
  3. 03

    host ∈ allow_hosts

    Checked locally before the first request, so an off-policy URL is never fetched.

    deny
  4. 04

    pay_to ∈ allow_pay_to

    Chain-aware case rules: EVM ignores case, Solana does not.

    deny
  5. 05

    agent spent + amount ≤ agent_daily_max

    Reservations count while reserved, pending or committed. Released ones do not.

    deny
  6. 06

    team spent + amount ≤ team_daily_max

    One shared cap across every agent, including in-flight payments.

    deny
  7. 07

    amount ≤ approval_threshold

    Otherwise the request waits for a human — and the budget stays held while it waits.

    approval

03 — policy lab

Move the caps. Watch the decision.

This runs the v0.1 decision order in your browser against the values below. It is a model, not the gate: no key, no signature, no network.

policy.toml
$0.05
$0.03
$0.10
$0.50
Destination host
today · utc
$0.04
$0.08
$0.04

Tip: push team daily below agent daily to see rule 06 take the blame, or drop the host out of the allowlist to stop the call before any request is made.

decision

APPROVAL

above approval threshold ($0.04 > $0.03) — pending, budget held until a human answers.

remaining
$0.02
held
$0.04
reservation
c8a95f…

decision trace

  1. amount > 0 0.04
  2. per-tx cap ≤ 0.05
  3. host allowlist listed
  4. pay_to allowlist not simulated
  5. agent daily 0.08 / 0.10
  6. team daily 0.12 / 0.50
  7. approval threshold 0.04 > 0.03

Rule 04 is described in POLICY.md and left out of this model. Nothing here signs or settles.

04 — surfaces

A gate, a ledger, and a queue.

Three local services, one config file. The dashboard reads the gate; approvals live in a directory outside it.

limpay dashboard 127.0.0.1:8404

agent

research-bot

agent/day 0.07 / 0.10
team/day 0.31 / 2.00

pending · 1

0.12api.example.comhold

audit · last 5

  • allow0.03api.example.com
  • allow0.02api.example.com
  • approval0.12data.example.com
  • deny0.09api.example.com
  • allow0.01docs.example.com

every decision logged, allowed or not

Static illustration of the local dashboard — not a screenshot, and the numbers are an example day.

gate

127.0.0.1:8402

POST /check, /commit, /release, plus /status and /audit. Stateless calls are not enough; the reservation is the state.

mcp

pay_and_fetch

One tool over stdio. On a 402 it asks the gate, and signs only after allow. A deny returns isError: true so the agent stops instead of retrying.

approvals

~/.limpay/approvals

A filesystem queue, not a database. Answer from the CLI, the dashboard or Telegram. Anyone who can write a decision file can approve — so guard that directory.

05 — comparison

Where does the decision live?

Three ways to stop an agent from overspending. Only one of them decides before a signature exists.

Comparison of LimPay, a facilitator balance check, and a hand-written agent script
Criterion LimPay local gate Facilitator balance check Ad-hoc script inside the agent
Decides before signing yes — the gate answers first no — it only knows the wallet only if the prompt and code hold
Per-agent daily budget yes — SQLite, per day, UTC no — one balance for everyone usually not, and racy
Concurrent calls yes — one BEGIN IMMEDIATE not its job a read-then-write race
Human above a threshold yes — CLI, dashboard, Telegram no custom code, custom trust
Audit of refusals yes — every decision, allow or not no whatever you remembered to log
Holds funds or keys no — mainnet is opt-in, untested settles, custody varies depends on the agent
Setup Python 3.11+, no dependencies, localhost SDK + facilitator account one more thing in the prompt

06 — limits

What it is. What it is not.

The boring version, because a payment tool that oversells itself is a liability.

it is

  • An allow / approval / deny decision with an audit trail.
  • An atomic reservation ledger in SQLite, scoped per agent and per team.
  • An MCP tool and an HTTP API you can call from anything local.
  • Chain-agnostic: it decides an amount, then your client signs.
  • MIT licensed, Python 3.11+, no runtime dependencies.

it is not

  • A wallet. It holds no funds and does no custody.
  • Mainnet-verified. --allow-mainnet is an explicit opt-in, Solana only, and not verified with real funds.
  • A chain verifier by default. A settlement document is treated as an untrusted claim.
  • An authenticator. The approval queue is a filesystem authority.
  • Published on PyPI. Install it from a checkout for now.

07 — run it

Localhost, no account.

The demo needs no wallet, no key and no chain. The gate starts on 127.0.0.1:8402; the dashboard on :8404.

From a source checkout. Nothing is installed, nothing is signed.

python -m limpay demo

Four acts against a local gate and a local x402 seller: a free resource, two payments that fit the cap, then the same payment refused — with the reason and the proof that nothing was signed.

packaging note

The repository is private and there is no PyPI release yet. The uvx … git+https and pipx … git+https lines in the README only resolve for someone with access. From a checkout, the canonical commands are python -m limpay ….

08 — questions

The ones that matter.

Why not just put the budget in the system prompt?

Because the prompt is inside the thing being attacked. The recommendation in the October 2026 advisory is to enforce spend limits outside the model and outside the SDK. LimPay is that outside: a separate process with its own state.

What happens if the network dies after signing?

The result is unknown and the reservation is kept. A signed authorization can stay redeemable until its deadline, so LimPay does not guess. Keep the reservation_id, check the chain or the facilitator, then commit or release by hand. Do not retry automatically.

Does it hold my funds or my keys?

No. LimPay is not a wallet. It reads a throwaway testnet key file when a client signs, and the gate itself never signs or settles. Mainnet is off by default; --allow-mainnet is an explicit opt-in, Solana only, and it is not verified with real funds.

Can two agents together blow the team budget?

Not through the gate. Budget check and reservation insert share one BEGIN IMMEDIATE transaction, so a second check blocks until the first commits. The invariant is sum(active reservations) ≤ team_daily_max, including in-flight payments.

Is approving from my phone safe?

It is convenient, not magic. The queue is a directory of files: any local process that can write a decision file can approve. Pair Telegram if you want the convenience, then protect ~/.limpay/approvals like the authority it is.

Is it on PyPI?

Not yet. pyproject.toml is ready, the version is 0.1.0, and the project is MIT licensed — but the source is private for now and there is no published distribution. Install from a checkout.

end of the line

The agent still pays.
You just get a say.

Read the commands

access

The source is private, for now.

There is no public release and no PyPI package. Here is the honest path:

  1. 01

    Ask the maintainer for access to github.com/nonamect/limpay. There is no self-serve signup, because there is no hosted service.

  2. 02

    In a checkout, run python -m limpay demo. Python 3.11+, no dependencies, no wallet, no network.

  3. 03

    Read POLICY.md before pointing an agent at it: the decision order, the trust boundaries and the mainnet opt-in are all written down.

no email collected · no form submitted