
Boundra — Payment Approval Gateway for AI Agents
io.github.gobeyondfj-cmd由 GitHub 账号 gobeyondfj-cmd 发布v0.1.0更新于 Nov 1, 2026
Policy decision point for agent payments — allow, ask, or veto before signing
概览
Boundra 是一个本地 MCP 支付审批网关,在签名前按已签名策略评估智能体的支付意图,返回允许、询问人工或否决。
- 可以做什么
- 在签名前评估支付意图,得到 ALLOW、DENY 或需人工签名的 ASK 挑战
- 提交、版本化并撤销已签名策略,查看策略版本历史与旧版回退策略
- 查询当日支出与剩余预算,读取审批审计记录
- 由智能体请求策略变更,并列出或渲染策略模板
- 适用场景
- 当智能体可通过 x402 类支付花钱,而你希望用用户签名的策略决定每笔支付是放行、转人工确认还是拦截,并保留审计记录时使用。
- 运行要求
- 以本地 stdio 进程运行,从 boundra-mcp 的 PyPI 包或通过 uvx 从项目仓库安装,需要 Python 与 uv。boundra-init 向导会在本地创建或导入 Base 钱包密钥,boundra-approve 用于签署 ASK 挑战。也提供托管端点作为替代。清单未声明任何账号或 API 密钥。
安装
在 SourceWeft 中
- 打开 控制台中的 Boundra — Payment Approval Gateway for AI Agents,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Boundra · Payment approval gateway for AI agents
[Boundra on mcprush — Grade A, Trust 95/100]
Boundra (boundra.io) — Boundaries for agent payments. The boundary layer for agent payments: before any money moves, answer "should this payment happen at all?"
Our thesis: the opportunity in agent payments is not "how to pay" (protocols solved that) but "whether to pay."
One natural-language rule → compiled into a policy → every payment the agent attempts is genuinely evaluated → allow / ask a human / veto, with a full audit trail.
Two run modes:
- Offline simulation (
demo.py): stdlib only, self-contained mock merchant and wallets, zero dependencies, zero network - Real protocol (
demo/demo_real.py): standard MCP server + real x402 SDK + Base Sepolia testnet
Data flow
Policies and keys stay with the user; the gateway is read-only; only hash commitments go on-chain. Revocation is free — forever, no exceptions.
Integrating Boundra into your agent? See docs/INTEGRATION.md — hosted API, x402 SDK hook, and MCP paths with tested code.
See it run in 60 seconds
The complete flow, step by step
Zero to a signed, enforced policy in ~10 minutes. No accounts, no dashboards — your wallet key is your identity.
0 · Try the hosted API (30 seconds, nothing to install)
1 · Bind your identity — the wallet is the account
Creates or imports a Base wallet. No signup, no email — the private key never leaves your device, and your address is your identity everywhere in the system.
2 · Set your policy
The wizard offers templates (personal assistant / travel / dev API / procurement) or lets you write your own rule in plain English, then compiles it and shows you exactly what will be enforced — before anything is signed.
3 · Sign & publish
You sign the policy document with your wallet key (EIP-191). It is published as a versioned document and a hash commitment is anchored on-chain. From this moment the gateway is read-only for every agent — changing the policy without your key is impossible.
4 · Mount the MCP server into your agent
Hosted (zero install, multi-tenant, default-deny until you publish a signed policy):
Or self-hosted:
5 · Every payment gets a verdict before signing
Your agent calls evaluate_payment; the 5-stage pipeline answers
ALLOW (sign & settle) / DENY (aborted pre-signature, zero on-chain
trace) / ASK (a challenge bound to this exact payment).
6 · When the agent asks, you decide
Paste the ASK challenge, sign it on your device — the agent retries with the signed approval token. Forged, rebound, or replayed tokens are rejected.
7 · Watch, update, revoke
get_spend_report / get_audit_trail / get_policy_versions keep you in
control day to day. Every policy change is a new signed version
(set_policy); revoke_policy is instant default-deny and free forever.
Quick start (from source)
Architecture: where the gateway stands
Key finding: x402 SDK v2 natively provides the on_before_payment_creation
hook plus register_policy / set_spend_controls — the policy layer is not a
bolt-on; it is the slot the official protocol stack reserves. This validates
the wedge.
File map
Signed policies: the root of trust is the user's key, not the gateway's database (v2)
A policy is a document signed by the user's wallet, not a row in the gateway's configuration:
- Read-only for agents: without the user's private key,
set_policyalways fails — impersonation, unsigned, and tampered submissions are all blocked (seven scenarios indemo/demo_policy.py) - Two stacked scopes: user-level (rules for all agents) × agent-level (per-agent rules); the strictest verdict wins
- Every version bump is a signature: v2 must reference v1's hash; tampering with any historical version → signature invalid + chain broken
- Privacy shape: only hash commitments go on-chain; policy plaintext never leaves the device unless the user chooses to disclose
Run: .venv/bin/python demo/demo_policy.py
Verdict credentials: every decision comes with a signed receipt (v4)
Every evaluate_payment response carries a credential — a
boundra.verdict/v1 receipt signed by the platform key (EIP-191). It answers
"who can prove this ALLOW / DENY / ASK actually happened, under this policy,
for this exact payment intent?"
- Binds the intent:
intent_hash= sha256 over the canonical {amount, recipient, purpose} — a credential cannot be re-attached to a different payment - Binds the policy:
policy_refslists the policy version hashes used, comparable against on-chain anchors - Binds the audit log:
audit_idlinks to the server-side audit entry - Verifiable offline, by anyone: strip
proof, canonicalize the payload (sorted keys, compact separators), recover the EIP-191 signer — it must equalissuerand the platform address0xF30955B6Be768370Da13fca237A5f252F6081d1C(the same address that receives x402 revenue — one identity for signing and settlement). Published atGET https://api.boundra.io/verdict-key.
Self-hosted gateways attach no credential unless BOUNDRA_VERDICT_KEY is set —
unsigned mode stays fully backward compatible.
MCP server tools
Mount into Claude Desktop
One line — uvx resolves dependencies and starts the server:
On first run, use the boundra-init wizard (same package): create/import a
wallet → pick a policy template → sign → publish via MCP, about 2 minutes.
When your agent hits ASK, run boundra-approve and paste the challenge to
produce a signed approval token.
⚠️ Known trust-boundary simplifications (must fix for production)
solved (v3): human approval is now a signed approval token (approval.py) — ASK returns a challenge bound to the exact payment intent; the user's device signs it; the gateway verifies signature + field-by-field intent match + nonce replay protection. The legacy self-attested path remains but is taggedhuman_approvedself-attested by the agentapprove(legacy-deprecated).- MCP-level interception is advisory — an agent framework can bypass the
gateway and talk to the wallet directly. Mitigation: pair with x402's
native hook (demonstrated in
demo/demo_real.py; the hook fires inside the SDK, before signing). Endgame: compile the deterministic parts of policy into a smart-contract wallet module, enforced at the settlement layer. - Semantic detection is regex-based — production should swap in LLM evaluation + intent anchoring.
- Anchoring defaults to a local log — the real contract
(
contracts/PolicyAnchor.sol) and web3 client (chain_anchor.BaseSepoliaAnchor) are ready; setchain_config.jsonto switch to the real chain (deploy via Remix with test ETH).
Economic model: the evaluation API is itself an x402 merchant
Tiered pricing:
Open core: the client, evaluation engine, and demos in this repo are
Apache-2.0. The hosted evaluation service (tiered pricing, free-quota
accounting, revenue ledger) runs from the private boundra-ops repo.
Verified / not yet verified
Verified (all of test_product.py 22 assertions + test_mcp_client.py pass):
4-layer policy stacking (platform red lines × user × agent × Mandate) with
strictest-wins; signed approval tokens (valid passes, forged rejected,
intent-rebinding rejected, replay rejected); Mandate single-use; revocation
defaults to deny and a signed v2 restores; template render+compile; all MCP
tools over the wire; gateway blocks an injection attack inside the real x402
402 round-trip before the SDK signs; the full tiered-pricing loop — first
proven on Base Sepolia (2026-10-16), then on Base mainnet (2026-10-21):
free tier passes, paid tier settles $0.003 USDC for real (buyer 1.010 → 1.007,
platform address credited 0.003), dogfood hook self-evaluates, semantic layer
blocks the injection, /revenue ledger entry.
The mainnet settlement tx is publicly verifiable: 0xf04d3497…4eac7e5
— the live API now settles on Base mainnet via Coinbase's CDP facilitator.
Earlier testnet proof: 0x5ad8ef4b…c474bbe
(the hosted service code is closed by design — the chain is the receipt).
Not yet verified: real on-chain anchoring (contract ready, needs test ETH to deploy); real user demand; semantic layer false-positive rate under real LLM behavior distributions.
来源:README.md,提交 f06b13b
工具
0版本历史
1- v0.1.0最新Oct 18, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分