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 -m walletcap: status, set, freeze, unfreeze, history, holds, void <id>, void --all-unknown --older-than 24h and settle <id> --tx <hash>.

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.4.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.4.0
File Size Uploaded Provenance Actions
walletcap-0.4.0.tar.gz 51.7 kB With provenance Details for walletcap-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 107.9 kB

Release files / walletcap-0.4.0.tar.gz

Download URL walletcap-0.4.0.tar.gz
Size 51.7 kB
Tags Source
SHA-256 checksum
How to use checksums
584cd41aee556fbd615dd80b51445395175f9b2838db09615836c0ac3df0da78
BLAKE2b-256 checksum
How to use checksums
debcefa4576589da295e61bfee2f3e17ea362edf992179b023b88080a9d65ede
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 7, 2026.

Transparency log

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

Download URL walletcap-0.4.0-py3-none-any.whl
Size 56.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f400a9d979a655bdec457c57d11709cba5f4e35e6e491d196439a742c65d4fe9
BLAKE2b-256 checksum
How to use checksums
b19d89fcc5c94c6af3f0a4475a4f93dbcae9e9c4ef5f4455463af24c02684a73
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 7, 2026.

Transparency log

Security for walletcap 0.4.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.4.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 7, 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