Skip to main content
Glama

MandatePay

에이전트 결제를 위한 인가 방화벽

신원 · 의도 · 정책 · 인간 승인 · 암호학적 증명

CI Python MCP License

자율 에이전트는 결제를 제안할 수 있습니다. 그러나 무제한적인 금융 권한을 부여받아서는 안 됩니다. MandatePay는 실행 전에 모든 기계 주도 결제를 서명된 인간 위임장(mandate)에 대조하여 검증합니다.

왜 필요한가

에이전트 상거래는 새로운 통제 문제를 제기합니다: 결제 제공자가 AI 에이전트가 인간이나 조직이 위임한 권한 범위 내에서 행동했음을 어떻게 증명할 수 있을까요? 기존 결제 흐름은 사람이 현장에 있다고 가정합니다. API 키는 애플리케이션 접근 권한을 설정하지만, 목적, 한도, 지역, 판매자 범위, 또는 위임된 의도의 정확한 경계는 설정하지 못합니다.

MandatePay는 에이전트와 결제 레일 사이에 위치하는 연구용 제어 평면(control plane)입니다. 자금을 보유하거나 이동시키지 않습니다.

Related MCP server: Safe4

차별점

  • 서명된 위임장: 권한은 기계적으로 검증 가능하며 변조가 드러납니다.

  • 정책-as-코드: 금액, 총 지출, 통화, 국가, 판매자, 목적, 만료, 속도에 대한 결정적 한도.

  • 인간 챌린지: 고위험 의도는 정확한 결제에 바인딩된 승인을 위해 일시 중지됩니다.

  • 에이전트 신원 바인딩: 위임장은 다른 에이전트가 재사용할 수 없습니다.

  • 재생 방지: 멱등성 키는 원래 결정을 반환합니다.

  • 검증 가능한 이벤트: 모든 결정은 해시 체인 저널에 기록됩니다.

  • 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을 엽니다.

콘솔에서 네 가지 시나리오를 시도해 보세요:

  1. €299 / software / DE → 승인

  2. €400 / software / DE → 인간 챌린지

  3. €900 / software / DE → 거부: 결제 한도 초과

  4. €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

데모가 아닌 평가

테스트는 인가, 승인 챌린지, 신원 불일치, 범위 이탈, 속도 한도, 서명된 위임장 변조를 검증합니다. 다음 벤치마크 계층은 적대적 시나리오 전반에 걸쳐 오인가(false authorization), 오거부(false denial), 재생 저항, 정책 커버리지, 결정 지연 시간, 승인 부담을 측정할 것입니다.

로드맵

  • Ed25519/JWS 프로덕션 서명 및 키 순환

  • OAuth 증명 에이전트 신원 및 워크로드 신원

  • 의도 해시에 바인딩된 승인 세리머니

  • 결제 제공자를 위한 일회용 인가 토큰

  • 동시성 보장이 있는 영속 SQL 원장

  • OpenTelemetry 결정 추적 및 서명된 감사 내보내기

  • 에이전트 결제 공격에 대한 적대적 평가 코퍼스

  • 실행 인터페이스 뒤의 Stripe/Adyen 샌드박스 어댑터

  • 다중 통화 소수점 및 FX 정책

책임 있는 사용 경계

이 저장소는 합성 신원과 실제 자금을 사용하지 않는 보안 및 핀테크 연구 MVP입니다. HMAC은 데모를 의존성 없이 유지하기 위해서만 사용됩니다. 프로덕션 배포에는 검토된 비대칭 암호화, 강화된 신원, 영속 트랜잭션 저장소, 인증 및 인가, 규제 분석, 개인정보 보호 통제, 독립적인 보안 테스트, 결제 제공자 인증이 필요합니다.

전략적 맥락

에이전트 결제 시스템에는 위임장 기반 인가, 결정과 실행의 분리, 에이전트 신원, 프로그래밍 가능한 통제, 감사 추적, 계층적 인간 감독이 필요합니다. MandatePay는 이러한 설계 요구사항을 검사 가능한 오픈소스 프로토타입으로 전환합니다.

라이선스

Apache License 2.0.

Available Tools

1 tool
request_payment_authorizationA

Evaluate a proposed agent payment against a signed spending mandate. Does not move funds.

NameRequiredDescriptionDefault
amountYes
purposeYes
currencyYes
merchant_idYes
merchant_countryYes

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the burden of behavioral disclosure. The explicit statement 'Does not move funds' is a critical side-effect disclosure that prevents accidental fund transfers. However, it does not describe the output nature (e.g., approval/denial) or any other side effects, leaving some behavioral gaps. The core non-effect is well covered, so a 4 is appropriate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two concise sentences, leading with the core purpose and then a critical safety note. There is no wasted wording, and the most important information (the scrutiny and non-movement) is front-loaded. This is an exemplary level of conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is too brief for a tool with five required parameters and no output schema. It omits the return value (e.g., whether the authorization is granted or denied), any prerequisites like having the mandate document, and does not clarify the 'purpose' field's semantics. An agent lacks critical information to interpret the tool's result and handle errors effectively, making it incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate by explaining the parameters. It does not describe any of the five fields (amount, currency, merchant_id, merchant_country, purpose). The context of a 'proposed agent payment' hints at their role but provides no additional meaning beyond the schema's field names, which is insufficient for a tool with no inline descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Evaluate') and a clear resource ('proposed agent payment against a signed spending mandate'), and explicitly states it does not move funds, which distinguishes it from payment execution tools. Even without siblings, the purpose is precise and unambiguous, leaving no doubt about what the tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly implies the use case: evaluating a payment proposal against a mandate before funds are moved. It does not explicitly state when not to use it or mention alternatives, but the context is strong enough that an agent understands when to invoke it. Since no siblings are present, the lack of exclusions is acceptable.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 1 tool updatev0.1.0
    • First observedrequest_payment_authorization

TDQS

A3.9/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of confusion or overlap between tools. The tool's purpose is clearly defined and singular.

Naming Consistency5/5

A single tool follows a consistent verb_noun pattern ('request_payment_authorization'), which is clear and descriptive. No inconsistencies exist by definition.

Tool Count3/5

The server has only one tool, which feels thin for a system named 'MandatePay'—implying broader mandate management. While the tool itself is well-scoped, the overall surface is borderline minimal.

Completeness2/5

The tool covers only payment authorization, but the domain suggests the need for related operations like mandate creation, listing, updating, or checking status. Without these, agents face significant dead ends when managing mandates.

Maintenance

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI agents to verify proposed payments against their assigned task, budgets, permitted categories, and counterparties, returning an ALLOW or DENY decision with a tamper-evident audit trail.
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents to use payment APIs safely by gating every tool call through deterministic mandates, value checks, and an exactly-once ledger, so they cannot pay twice or exceed authorisation.
    260 npm
    MIT
  • A
    license
    Not graded
    quality
    F
    maintenance
    Enables MCP clients to ask permission before an agent acts, returning allow, deny, or ask_human with receipts, and to monitor agent spend, limits, and recent decisions.
    0
    Functional Source , Version 1.1, ALv2 Future