Skip to main content

walletcap

Spend limits for AI agent wallets: a per-payment cap and a rolling budget (say $150 in any 24 hours) per wallet, counted in one SQLite file that every process on the host opens. A restart, a second replica or another key doesn't start the count again, and the npm package walletcap counts in the same file, by the same SQL.

$ pip install walletcap                                         # Python 3.11+, no dependencies
$ walletcap set --wallet 0xYourAgentWallet --per-payment 50 --per-day 150
from walletcap import open_budget

budget = open_budget(agent_address)

with budget.pay("$12.50") as payment:  # refused past $150 in any 24 hours
    payment.tx = send_usdc(payee, "12.50")
  • The owner creates the budget once with walletcap set, or open_owner().set_limits(...). Opening never creates one unless create=True is passed, which is for demos.
  • If the block raises, the payment may still have left, so it stays held, noted unknown, until its owner checks the chain and voids it. raise NotSent(...) inside the block says it never left.
  • budget.hold(amount, id=..., settles_within=timedelta(minutes=5)) returns a Hold to settle(tx=...), void() or note() yourself. One id is one payment, and only the hold that took it can move it; a voided id can't be held again.
  • Errors: BudgetRefused (code, brief), BudgetUnavailable, UsageError, and PaymentNotRecorded, which shares no base with the others: don't pay again. None is a ValueError.
  • async with budget.pay(...) and acheck, ahold, astatus, aholds and ahistory wait for another process's lock in a worker thread, not on the event loop. If the task is cancelled while it waits, the hold the thread takes is voided.
  • Amounts are dollars: strings ("$12.50"), Decimals, floats and ints (whole dollars). What comes back is Micros, a micro-dollar amount that to_micros reads as micro-dollars. Its arithmetic returns a Micros or raises TypeError: remaining // 2 works, remaining + 1 doesn't, since a bare number would be read as dollars.
  • The owner's command, walletcap (or python -P -m walletcap; without -P, Python imports from the folder you run it in, which an agent may be able to write): status, set, freeze, unfreeze, history, holds, void <id>, void --all-unknown --older-than 24h and settle <id> --tx <hash>. Two more only read: check <dollars> says whether a payment would be paid right now, and doctor checks the budget file before you rely on it.

The ledger's rule is SQL that ships inside the package (walletcap/spec/schema.sql), the same file the npm package runs. Source, docs and the threat model: https://github.com/coriolislabs/WalletCap

Apache-2.0. Copyright 2026 Coriolis Labs Inc.

Metadata

Release files for walletcap 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for walletcap 0.5.0
File Size Uploaded Provenance Actions
walletcap-0.5.0.tar.gz 58.6 kB With provenance Details for walletcap-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for walletcap 0.5.0
File Interpreter ABI Platform Actions
walletcap-0.5.0-py3-none-any.whl Python 3 none any Details for walletcap-0.5.0-py3-none-any.whl

Total release size: 122.3 kB

Release files / walletcap-0.5.0.tar.gz

Download URL walletcap-0.5.0.tar.gz
Size 58.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9bd2388c9deeb69c5bebe0472cf7cdf844a72a6d39f3516ac69ebd50c727d4f5
BLAKE2b-256 checksum
How to use checksums
173a0d004ce8cb8d5e6b1ba1a4b6336d604e8a01bac4ccb51fd76f7f48c0a5ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / walletcap-0.5.0-py3-none-any.whl

Download URL walletcap-0.5.0-py3-none-any.whl
Size 63.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a612c48193847923e7658952a05c56095bb0596177b0fd14be05e0364c14356b
BLAKE2b-256 checksum
How to use checksums
1f8c52b5954611bd310b373e7a2cd512fbfb3a42bc56f08599682f7e6dc15f81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for walletcap 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for walletcap-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page