MandatePay
MandatePay
面向代理支付(agentic payments)的授权防火墙
身份 · 意图 · 策略 · 人工审批 · 密码学证明
自主代理可以发起支付提案,但不应被授予无限的财务权限。MandatePay 会在每笔机器发起的支付执行之前,依据经签名的人类授权令(mandate)对其进行验证。
为什么需要它
代理商务(agentic commerce)引入了一个新的控制问题:支付服务商如何证明某个 AI 代理的行为是在人类或组织所委托的权限范围内? 传统结账流程假定有真人到场。API 密钥只能确立应用访问权限,却无法界定用途、限额、地域、商户范围,或委托意图的确切边界。
MandatePay 是一个研究级控制平面,位于代理与支付通道之间。它不持有或转移资金。
Related MCP server: dingdawg-agent-wallet
它的独特之处
签名授权令: 权限可机器验证且防篡改。
策略即代码: 对金额、累计支出、币种、国家、商户、用途、有效期和频次设定确定性限制。
人工挑战: 高风险意图会暂停,等待与具体支付绑定的审批。
代理身份绑定: 授权令不能被其他代理复用。
重放安全: 幂等键返回原始决策。
可验证事件: 每项决策都会进入哈希链式日志。
MCP 工具: 代理可通过受限的工具接口请求授权。
默认拒绝(fail closed): 无效签名、畸形金额、过期权限和越界行为一律拒绝。
授权生命周期
sequenceDiagram
participant H as Human / Organization
participant A as AI Agent
participant M as MandatePay
participant P as Payment Provider
H->>M: Sign bounded mandate
A->>M: Submit payment intent
M->>M: Verify identity + signature + policy + state
alt within authority
M-->>A: Single-use authorization
A->>P: Execute with authorization proof
else approval threshold
M-->>H: Challenge exact intent
else policy violation
M-->>A: Deny with reason codes
end
M->>M: Append decision to audit chain快速开始
git clone https://github.com/muhammadashir0/mandatepay.git
cd mandatepay
python -m unittest discover -s tests -v
python app.py打开 http://localhost:8080。
在控制台中尝试四种场景:
€299 / software / DE→ 授权€400 / software / DE→ 人工挑战€900 / software / DE→ 拒绝:超出支付限额€100 / travel / GB→ 拒绝:用途和国家不符
切换场景时请使用新的幂等键。
MCP 服务器
python -m mandatepay.mcp_server这个零依赖的 JSON-RPC 服务器只暴露一个刻意收窄的工具:request_payment_authorization。该工具返回的是决策,而非资金划转。
威胁模型
MandatePay 的设计针对以下威胁:
被盗用或权限过高的代理凭证;
提示注入导致非预期购买;
授权令篡改与权限升级;
重复执行与重放;
频次滥用与累计超支;
模糊的人工审批;
取证证据不完整。
信任边界、非目标与生产环境控制措施,请参阅 docs/THREAT_MODEL.md。
仓库架构
mandatepay/
├── mandatepay/
│ ├── core.py # signed mandate + deterministic policy engine
│ ├── store.py # state, idempotency, tamper-evident journal
│ └── mcp_server.py # constrained MCP-compatible tool server
├── web/index.html # premium operator console
├── tests/ # policy and adversarial scenarios
├── docs/ # protocol, threat model, product direction
└── app.py # sandbox HTTP API不只是演示,而是评估
测试覆盖了授权、审批挑战、身份不匹配、越界、频次限制以及签名授权令篡改。下一层基准将衡量对抗性场景下的误授权、误拒绝、重放抵抗、策略覆盖率、决策延迟和审批负担。
路线图
Ed25519/JWS 生产级签名与密钥轮换
OAuth 认证的代理身份与工作负载身份
绑定意图哈希的审批仪式
面向支付服务商的单次使用授权令牌
具备并发保证的持久化 SQL 账本
OpenTelemetry 决策追踪与签名审计导出
面向代理支付攻击的对抗性评估语料库
执行接口背后的 Stripe/Adyen 沙箱适配器
多币种十进制与 FX 策略
负责任使用边界
本仓库是一个安全与金融科技研究 MVP,使用合成身份,不涉及真实资金。HMAC 仅用于让演示保持零依赖。生产部署需要经过评审的非对称密码学、加固的身份体系、持久化事务存储、认证与授权、监管分析、隐私控制、独立安全测试以及支付服务商认证。
战略背景
代理支付系统需要基于授权令的授权、决策与执行分离、代理身份、可编程控制、审计追踪和分级人工监督。MandatePay 将这些设计要求转化为一个可检视的开源原型。
许可证
Apache License 2.0。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
AlicenseAqualityCmaintenanceEnables AI agents to make payments with strict spending limits enforced by signed mandates, preventing unauthorized fund movement beyond predefined caps and allowlists.422MIT- FlicenseNot gradedqualityCmaintenanceProvides MCP tools to enforce spend policies (allow, deny, step-up, allowlist) on agent wallets with an immutable audit trail.
- AlicenseNot gradedqualityDmaintenanceEnables verification of AI agent identity, authority, and integrity at transaction time, returning signed verdicts for allow, step-up, review, or block.MIT
- AlicenseAqualityCmaintenanceDeterministically evaluates whether a proposed agent spend action matches a supplied policy, returning ELIGIBLE, DENY, or STEP_UP with stable reason codes. Provides local policy evidence only, not payment authorization.1347MIT
Related MCP Connectors
Agent payments, API key vaulting, and governed mandates. Agents spend within user-defined limits.
Pre-action allow/deny for AI agents. 24 statutes, 13 jurisdictions: EU AI Act, GDPR, DPDP.
Secure agent purchasing with human-approved virtual cards, receipts, and audit trails.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/muhammadashir0/mandatepay'
If you have feedback or need assistance with the MCP directory API, please join our Discord server