技能潮 SkillTide 提交收录
官方说明2 个来源开源项目7 天前
Knox-mgk/aibank

Knox-mgk/aibank

Double-entry banking and payments backend for autonomous agents. Policy-bounded spending, idempotent payouts, concurrency-tested. Zero dependencies.
在 GitHub 查看 ↗直链 · 无中转页
★ 数取值
0 ★ · Knox-mgk/aibank · 取自该仓库的 GitHub 页面 · (2026-10-16 20:00:20 核对)
来源明细
从该仓库的 GitHub 页面直接读取 · 条目类型:开源项目
收录与活跃
收录于 2026-10-10 · 最近见到 2026-10-10 · 共见到 5 次 · 被 2 个来源列出
评分构成
综合分 203 · 2 个来源 · repo
安装
pip install aibank
常见问题(答案都来自我们的记录)
怎么安装?
该仓库给出的安装命令是 pip install aibank。我们的记录里它是仓库自己提供的;不保证在你的客户端上直接可用。
它适合谁 / 用来做什么?
我们把它归在这些标签下: 开源项目。标签来自条目自身,不是我们强加的分类。
谁维护它、还在更新吗?
仓库 Knox-mgk/aibank;我们收录于 2026-10-10;最近见到 2026-10-10。这里没有"官方认证"或"质量评级"——我们只记录来源与时间。
第三方质量标记

aibank

以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →

A double-entry banking backend where **humans hold the money and AI agents
spend it under limits they cannot reach.** An account holder signs in, funds a
wallet, allocates money to their agents, and sets each agent's ceilings from a
dashboard. The agent gets an API key that can do exactly one thing with money:
request a payout that the server either allows, holds for approval, or denies.
**You self-host it against your own payment credentials.** aibank never holds
your money and never touches a balance you do not own, so there is no custody
and no payment licence in the picture — the deployment is yours. One command
gets you a running service with TLS, a sweeper, and verified backups.
**Zero third-party dependencies.** Python standard library only, by design.
It ships both ends of that: a **dashboard** for the human and an **MCP server**
so the agent spends through typed tools instead of hand-rolled HTTP.
---
Why
An autonomous agent that can spend money is a liability unless four things are
true: its balance is always correct, its spending is bounded by policy it
cannot bypass, a retried request never moves money twice, and a **human** —
not the agent — decides what the bounds are. The first three are ledger
problems. The fourth is an authorisation problem, and it is the one that makes
this a banking service rather than a wallet library.
The central invariant
> The human sets the limits. The agent operates under them and can never reach
> them.
This is enforced structurally, not by convention. There are three separate
trust domains, and the HTTP layer keeps them apart:
| domain | credential | may do |
|---|---|---|
| **Agent** | Authorization: Bearer sk_agent_… | request payouts, read own balance, add payees |
| **User** | Authorization: Bearer sess_… | set policy, fund wallets, approve/reject/refund, rotate keys |
| **Admin** | X-Admin-Key | pricing, settlement deposits, sweeper, cross-tenant reads |
An agent key presented to a user-domain route is rejected before any handler
runs. POST /v1/agents/ /policy is reachable only with a session token, so
**no sequence of agent API calls can raise an agent's own ceiling.** A test
asserts this against the router's source, and the HTTP smoke test proves it
against a live socket:
The ledger
A general ledger with invariants enforced in code, not convention:
1. **Postings within an entry sum to exactly zero.** An unbalanced entry is
rejected, not corrected.
2. **Postings are immutable.** Corrections are new reversing entries
(ledger.reverse_entry), so history is append-only and auditable. A refund
leaves both the original and its mirror on the books; reversing twice is
refused.
3. **balance = SUM(postings)**, and **available = balance − active holds**.
Balances are never stored, only derived — they cannot drift.
4. **An idempotency key produces at most one entry, ever**, enforced by a
UNIQUE constraint rather than an application check.
Money is integer minor units throughout. No floats touch a balance. Fees use
floor division on basis points, so the same inputs always produce the same fee.
Money flow
A user cannot credit their own wallet (that is the admin/collection path), and
an agent cannot be funded from nothing — allocation debits a real user balance.
Money committed to an in-flight payout is held, so a user cannot withdraw funds
their agent has already promised.
Spend policy
Evaluated server-side before funds are held, deny-by-default:
- per-transaction ceiling
- rolling daily and monthly caps (accumulate across transactions)
- **daily payout count ceiling** — catches a retry loop making a thousand
individually-legal payments, which an amount cap cannot
- **timezone-correct daily reset** — a "daily" cap resetting at UTC midnight
resets at 01:00 in Lagos, handing the agent a second allowance in that hour
- payee allowlist, and the payee's currency must match the payout's
- approval threshold above a configurable amount
- freeze: a frozen agent cannot spend at all
- **suspending the human immediately stops all of their agents**
- **no limits means no spending** — the default is deny, not allow. An agent
needs at least one of the three amount ceilings or an approval threshold;
with none set, every payout is refused rather than permitted. This was a real
bug, not just a design note: create_agent always wrote a policy row, so the
"no policy" deny branch was unreachable and an agent created without limits
could move its entire wallet in one unapproved payout
Payout lifecycle
Funds are held against available balance before the provider is called, so a
来源
github · https://github.com/Knox-mgk/aibank
按领域浏览
开源项目
收录于
7 天前

更多开源项目

查看开源项目全部 731 条 →

所属领域与标签

每个标签都能点进去看同类的全部条目。数字是当前库里的真实条数。

浏览全部领域 →

← 返回索引