walletbrake (Python)
Pay from a WalletBrake vault from a bot or AI agent, in Python. It works with LangChain, CrewAI, or plain scripts.
WalletBrake checks every payment against the vault's rules: limits, a trusted-address list, and asking the owner on Telegram. The vault contract enforces the result on chain. A payment needs WalletBrake's signature and the spending wallet's transaction, so neither one can move money alone. There's no API key: each request is signed with the spending wallet's key.
Test networks only for now (Base Sepolia, BNB testnet, Ethereum Sepolia). Mainnet comes after the security audit.
Install
pip install walletbrake
Python 3.10 or newer; web3 7 or 8.
Pay
import os
from walletbrake import WalletBrake
wb = WalletBrake(
url="https://app.walletbrake.com/c/84532/v/0xYourVault", # the vault's WalletBrake address
private_key=os.environ["AGENT_KEY"], # the vault's spending wallet
rpc_url="https://sepolia.base.org",
)
paid = wb.pay("0x…", "10") # 10 USDC
print(paid.tx_hash)
amountis in coin units, as a string orDecimal("10.5"). Ints and floats are refused, because10could mean 10 USDC or 10 base units, and floats lose cents. For base units, useamount_base_units=10_500_000.tokenis a symbol ("USDC","ETH") or a token address. The default is"USDC".
When the owner has to approve
On the AI agent plan, the vault pays only trusted addresses: the ones listed when the vault was created, or added later from the Safety tab. A payment to any other address goes to the owner on Telegram, with Approve and Reject buttons. Until they answer, pay raises DeniedError and is_awaiting_approval(err) returns true. Asking again with the same coin, address and amount goes through once they tap Approve. pay_and_wait does the asking again for you:
paid = wb.pay_and_wait("0x…", "10", on_waiting=lambda _: print("Asked the owner on Telegram…"))
Each approval covers one payment, for 15 minutes. It doesn't make the address trusted.
Tasks
Before an agent starts a job, before it reads any web page, email or file, tell WalletBrake what the job is. Payments in that task can't go past it, even to addresses you trust:
task = wb.open_task(
"Pay the March hosting invoice",
"100", # USDC, for the whole task
pay_only=["0xHostingCompany…"], # optional
minutes=60, # optional, up to 1440
)
wb.pay_and_wait("0xHostingCompany…", "60", task=task, note="invoice 1042")
A payment over what's left of the budget, to an address the task didn't
list, or after the task ends, is refused with rule "task". When the
server's intent check is on, a payment that doesn't clearly fit the task's
description goes to the owner on Telegram first, with the reason.
Refusals
from walletbrake import DeniedError, WalletBrakeError
try:
wb.pay(to, "5000")
except DeniedError as err:
print(err.rule, err.reason) # e.g. "per-tx-cap", why
err.verdict == "freeze" means the request looked like an attack and WalletBrake froze the vault. Only the owner can unfreeze it. Other problems raise:
WalletBrakeError: unreachable, wrong key (status401)VaultError: the vault contract refused, e.g.NotReady
Held payments
The vault holds a large payment to an address it doesn't trust for an hour, so the owner can cancel it. In that case pay returns queued=True and a queue_id. Run it once the hour has passed:
if paid.queued:
wb.execute_queued(paid.queue_id)
Also
wb.info(): the vault's coins, balances, limits, and whether it's frozen.wb.request_approval(...)thenwb.send(approval): the two halves ofpay. Before sending, the SDK checks that WalletBrake's approval matches the payment you asked for.
Docs
Quickstart, every refusal reason, the networks and addresses, and the HTTP API for other languages: https://walletbrake.com/docs
Questions: support@walletbrake.com. Security issues: security@walletbrake.com.
License
MIT
Metadata
Release files for walletbrake 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| walletbrake-0.1.0.tar.gz | 13.6 kB | Without provenance | Details for walletbrake-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| walletbrake-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for walletbrake-0.1.0-py3-none-any.whl |
Total release size: 24.5 kB
Release files / walletbrake-0.1.0.tar.gz
| Download URL | walletbrake-0.1.0.tar.gz |
|---|---|
| Size | 13.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
abb3ca4c4f665f5d6ad668b619969454f725a0cc052d5c22896047f272da2d5e
|
|
BLAKE2b-256 checksum How to use checksums |
3d9dcd59ae487b07189a518ca06c899707f1b39cfb93fcb55e80722d5b85cc3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / walletbrake-0.1.0-py3-none-any.whl
| Download URL | walletbrake-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2bf798ab726e4d264e072395f536114632b38a54f5d482638889a2929d25cb45
|
|
BLAKE2b-256 checksum How to use checksums |
1ffb95a6d5d71854d477e0b8e6ace6778a152a67093cc5f948bcc320c9f8b6f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for walletbrake 0.1.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.