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.
x402 spend gate · mainnet opt-in
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.
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
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.
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-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.
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
The order is normative, encoded in tests, and logged at every step — allowed or not. Each evaluation writes an audit row.
amount parses and is > 0
Decimal strings, stored as integer micro-units. Floats are never used for money.
amount ≤ per_tx_max
The ceiling that survives a prompt injection.
host ∈ allow_hosts
Checked locally before the first request, so an off-policy URL is never fetched.
pay_to ∈ allow_pay_to
Chain-aware case rules: EVM ignores case, Solana does not.
agent spent + amount ≤ agent_daily_max
Reservations count while reserved, pending or committed. Released ones do not.
team spent + amount ≤ team_daily_max
One shared cap across every agent, including in-flight payments.
amount ≤ approval_threshold
Otherwise the request waits for a human — and the budget stays held while it waits.
03 — policy lab
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.
decision
APPROVAL
above approval threshold ($0.04 > $0.03) — pending, budget held until a human answers.
decision trace
Rule 04 is described in POLICY.md and left out of this model. Nothing here signs or settles.
04 — surfaces
Three local services, one config file. The dashboard reads the gate; approvals live in a directory outside it.
agent
research-bot
pending · 1
0.12api.example.comhold
audit · last 5
every decision logged, allowed or not
gate
POST /check, /commit, /release, plus /status and /audit. Stateless calls are not enough; the reservation is the state.
mcp
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
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
Three ways to stop an agent from overspending. Only one of them decides before a signature exists.
| 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
The boring version, because a payment tool that oversells itself is a liability.
it is
it is not
07 — run it
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.
Three terminals. Testnet policy caps the demo agent at $0.01/day.
limpay gate --policy policy.testnet.toml --port 8402
limpay seller --port 8403 --price 0.01
limpay mcp --policy policy.testnet.toml
Gate URL, policy and key paths come from ~/.limpay/config.toml. The approval wait is opt-in.
{
"mcpServers": {
"limpay": {
"command": "limpay",
"args": ["mcp", "--approval-timeout", "120"]
}
}
}
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
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.
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.
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.
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.
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.
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.