MandateGuard
MandateGuard
자율 AI 에이전트를 위한 결정적이고 감사 가능한 결제 정책.
MandateGuard는 에이전트와 그 도구/지갑 사이에 위치하는 사전 실행 강제 계층입니다. 돈을 움직이는 모든 도구 호출은 실제 실행 전에 순수하고 결정적인 엔진 — 예산, 허용 목록, 차단 목록, 레이트 리미트, 서명된 위임 — 에 의해 평가됩니다. 의사 결정 경로에는 LLM이 전혀 개입하지 않으며, 이것이 모든 판정을 재현 가능하게 하고 모든 원장 항목을 검증 가능하게 만드는 이유입니다.
MCP 서버를 포함하고 있어 모든 에이전트(Claude, Cursor, 또는 자체 하네스)가 몇 분 안에 이를 가드레일로 장착할 수 있습니다.
왜
2026년 에이전트 경제의 현실:
OWASP LLM08 — Excessive Agency는 최고 수준의 LLM 앱 위험 중 하나입니다. 지갑을 부여받은 에이전트들이 자금을 탈취당하고 있습니다: 에이전트 상거래에 관한 SoK는 4,000만 달러 이상의 실질 손실(자금 탈취 공격, 메모리 중독, 도구 남용)을 기록하고 있습니다.
결제 표준(Google AP2의 Intent/Cart/Payment 위임, Coinbase x402, ERC-8004)은 위임이 무엇인지 정의하지만, 그중 어느 것도 에이전트를 실행 중에 실제로 차단하는 집행 계층을 제공하지 않습니다.
Gartner: **기업 앱의 40%**가 2026년 말까지 에이전트를 내장할 것입니다. 그 에이전트들은 돈을 움직일 것입니다. 그들에게는 레일이 필요합니다.
시장의 공백: 결정적인(비-LLM) 정책 엔진 + 감사 추적 + MCP 배포. 바로 이 저장소입니다.
Related MCP server: gov-mcp
기능
결정적 엔진 — 동일한 입력, 동일한 판정, 항상. 재생을 통한 감사 가능, 결정에 모델 샘플링 없음.
행위자별 범위 — 허용 도구, 허용 대상, 호출당 최대 한도, 통화, 기간별 호출 제한.
전역 가드 — 총 예산 상한, 대상 허용 목록/차단 목록.
서명된 위임(Ed25519) — AP2 / x402 스타일의 단기 유효, nonce 바인딩, 발행자 서명 인증. 에이전트는 자신의 범위를 확장할 수 없습니다.
변조 방지 원장 — 모든 결정은 추가 전용이며 SHA-256으로 체이닝됩니다. 어떤 편집, 재정렬, 삭제도 선형 스캔으로 감지됩니다.
MCP 서버 — 가드레일로 장착; 정책, 승인, 위임 발급, 원장 상태를 위한 도구.
결정 경로에 제로 의존성 —
cryptography는 위임에만 사용; 핵심 규칙은 표준 라이브러리만으로 실행됩니다.
설치
# from this repo (works today; also on the official MCP Registry)
git clone https://github.com/ezequiellich44-cmd/MandateGuard.git
cd MandateGuard
python -m pip install -e .
# or directly from the source:
python -m pip install "git+https://github.com/ezequiellich44-cmd/MandateGuard.git"참고: PyPI의
mandateguard는 Trusted Publisher 설정을 기다리는 중입니다. 그때까지는 저장소 URL이 정식 설치 경로입니다. MCP 번들은 공식 MCP Registry(io.github.ezequiellich44-cmd/mandateguard)에 게시되어 있으므로, MCP를 인식하는 클라이언트는 Python 단계 없이 설치할 수 있습니다.
빠른 시작
from mandateguard import Intent, Policy, PolicyEngine, Scope
policy = Policy(
scopes={
"wallet-agent": Scope(
tools=("pay",),
destinations=("0xGOOD",),
max_amount=1000, # per call
currency="usd",
max_calls_per_window=5,
)
},
global_max_amount=2000, # per actor
allowlist=("0xGOOD",),
denylist=("0xSCAM",),
)
engine = PolicyEngine(policy)
decision = engine.authorize(
Intent(tool="pay", destination="0xGOOD", amount=800, actor="wallet-agent")
)
print(decision.status) # DecisionStatus.APPROVED거부된 호출은 구조화된 사유와 함께 차단됩니다. 상태(지출/레이트)는 승인 시에만 커밋되므로 재생이 결정적입니다.
MCP 서버
이 패키지는 설치 가능한 MCP 서버 진입점을 제공합니다:
python -m pip install -e ".[mcp]"
mandateguard-mcp # stdio server, ready for Claude/Cursor/harnessClaude Code의 경우:
claude mcp add mandateguard -- mandateguard-mcpMandateGuard는 공식 MCP Registry에 게시되어 있습니다: io.github.ezequiellich44-cmd/mandateguard(버전 1.0.0, mcpb 번들, 활성 상태). 레지스트리를 동기화하는 MCP 인식 클라이언트는 이를 직접 검색하고 설치할 수 있습니다. 이 번들은 동일한 stdio 서버와 14개 도구 표면을 제공합니다.
노출된 도구: set_scope, set_global_policy, authorize, init_ledger, ledger_status, create_mandate_signer, issue_mandate, check_mandate, activate_license, license_status, reset_state, 그리고 서명된 Pro 라이선스 뒤에 있는 Pro 전용 revoke_mandate 및 persist_state(USDT 구매 — 구매 섹션 참조).
위임
from mandateguard import Mandate, MandateSigner, verify_mandate
issuer = MandateSigner()
m = Mandate(actor="wallet-agent", max_amount=500, currency="usd",
tools=("pay",), destinations=("0xGOOD",),
not_before="2026-01-01T00:00:00+00:00",
not_after="2099-01-01T00:00:00+00:00", nonce="abc", issuer="you")
sig = issuer.sign(m)
verify_mandate(issuer.public_key_bytes, m, sig) # True아키텍처
결정 흐름과 상태 모델은 docs/ARCHITECTURE.md를, 이 도구가 보호하는 것과 보호하지 않는 것은 docs/THREAT_MODEL.md를, 상업적 제안과 시장 진출 키트는 docs/LAUNCH.md를 참조하세요.
Agent intent ──> authorize(intent) ──> PolicyEngine
│ scope? allowlist? denylist?
│ budget? rate limit? mandate?
▼
APPROVED / DENIED / REQUIRES_APPROVAL
│
▼
append-only SHA-256 ledger (audit)테스트
python -m pytest -q라이선스
MIT. LICENSE를 참조하세요.
This server cannot be deployed
Maintenance
Related MCP Connectors
Agent-native MCP for governed commerce, x402 payments, paid capabilities, and verifiable receipts.
Compliance MCP for AI agents: sanctions & KYT screening on 50+ chains, stablecoin-freeze, oracle.
Pre-spend firewall for AI agents. Approves, blocks, flags transactions against policy rules.
Zero-secret MCP gateway for AI agents: risk-scored, audited calls with human-in-the-loop approval.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceBudget & cost control for AI agents: hard per-agent spend caps, rate limits, idempotency, and human-in-the-loop approval — enforced before each LLM call, not after the invoice. One hosted MCP endpoint (no proxy or self-hosting), settled via x402 (USDC on Base).MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enforces runtime governance on AI agent actions — file access, command execution, delegation chains, and permission escalation.MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that enables AI agents to propose USDC payments on the Soroban blockchain with deterministic policy enforcement and injection protection, while providing payment status and attestation tools.MIT
- FlicenseNot gradedqualityBmaintenanceAn MCP server that enables AI agents to safely interact with a double-entry payments ledger, enforcing idempotency, policy-based access control, and human-in-the-loop approval for high-value actions.-