AGA-mcp-server
AGA - 认证治理工件 (Attested Governance Artifacts)
用于 AI 代理和自主系统的加密运行时治理。
# Try it now
pip install aga-governance
python -m aga demo
python -m aga verify demo-bundle.json功能概述
AI 代理进行的每个工具调用都会通过 AGA 网关。每个调用都会根据策略进行评估,决策(允许或拒绝)将作为已签名的哈希链接治理收据记录下来。收据被收集到证据包中,任何第三方都可以使用标准加密技术进行离线验证。
记录。证明。验证。
Related MCP server: contextboundary-gw
在 Claude Desktop 中使用
添加到您的 Claude Desktop MCP 配置 (claude_desktop_config.json) 中:
{
"mcpServers": {
"aga": {
"command": "npx",
"args": ["-y", "@attested-intelligence/aga-mcp-server"]
}
}
}Claude 随后可以通过自然语言密封工件、度量完整性、生成证据包并验证合规性。
MCP 工具 (20)
类别 | 工具 |
身份 |
|
生命周期 |
|
执行 |
|
证据 |
|
隐私 |
|
委托 |
|
审计 |
|
快速入门
验证证据包(3 条命令)
pip install aga-governance
curl -s https://aga-mcp-gateway.attestedintelligence.workers.dev/bundle -o evidence-bundle.json
python -m aga verify evidence-bundle.json或在浏览器中验证
前往 attestedintelligence.com/verify 并点击“运行验证”。无需安装任何软件。
工作原理
AI Agent AGA Gateway Verifier
| | |
|-- tools/call ----------->| |
| [Evaluate Policy] |
| [Sign Receipt] |
| [Chain to Previous] |
|<-- PERMITTED/DENIED -----| |
| | |
| [Export Bundle] |
| |--------- evidence.json ----->|
| | [Verify Signatures]
| | [Verify Chain]
| | [Verify Merkle Tree]
| | [PASS / FAIL]MCP 治理代理
将 AGA 作为任何 MCP 客户端和任何 MCP 服务器之间的透明代理运行。每个工具调用都会根据策略进行评估并生成签名收据。
# Start the proxy with an upstream MCP server
npx tsx src/proxy/index.ts start --upstream "npx -y @modelcontextprotocol/server-filesystem /tmp/test" --profile standard
# Export the evidence bundle
npx tsx src/proxy/index.ts export --output evidence.json
# Verify
npx tsx src/proxy/index.ts verify evidence.json该代理拦截 tools/call 请求,根据密封的策略工件对其进行评估,并生成签名收据。被允许的调用将转发到下游服务器。被拒绝的调用将返回 MCP 错误。每个决策都通过哈希链接到一个防篡改链中。
内置三种策略配置文件:
permissive - 记录所有内容,不拦截任何内容(默认)
standard - 速率限制 + 拦截破坏性操作
restrictive - 明确的工具允许列表,拒绝所有未知工具
验证(5 个步骤)
算法检查 - 证据包声明使用 Ed25519-SHA256-JCS,其他任何算法均会导致失败
收据签名 - 基于 RFC 8785 规范化 JSON 的 Ed25519 签名(排除签名字段)
链完整性 - 每个收据的
previous_receipt_hash= 前一个收据的 SHA-256 哈希值Merkle 证明 - 遍历兄弟节点/方向至根节点,与证据包根节点进行比较
证据包一致性 - 证明计数 = 收据计数,叶子哈希与收据哈希匹配
加密原语
原语 | 用途 |
Ed25519 | 收据签名 |
SHA-256 | 哈希链、Merkle 树、叶子计算 |
RFC 8785 (JCS) | 用于确定性签名的规范化 JSON |
Merkle 树 | 将所有收据绑定到单个可验证的根 |
实时网关
演示网关部署在 Cloudflare Workers 上:
# Check status
curl https://aga-mcp-gateway.attestedintelligence.workers.dev/health
# Export evidence bundle
curl https://aga-mcp-gateway.attestedintelligence.workers.dev/bundle -o evidence-bundle.jsonPython SDK
pip install aga-governancefrom aga import AgentSession
with AgentSession(gateway_id="my-gateway") as session:
session.record_tool_call(
tool_name="search_web",
decision="PERMITTED",
reason="tool in allowlist",
request_id="req-1",
)
bundle = session.export_bundle()
result = session.verify()
assert result["overall_valid"]测试套件
TypeScript 和 Python 中超过 355 个自动化测试:
TypeScript MCP 服务器: 218 个测试 (vitest)
Python SDK: 137 个测试 (pytest)
跨语言测试向量: 9 个类别中的 37 个向量
npm test # TypeScript tests对于 Python SDK,请从 PyPI 安装 aga-governance:https://pypi.org/project/aga-governance/
项目结构
src/ # Core protocol: artifacts, receipts, chain, Merkle, crypto, portal state machine
core/ # Governance primitives (artifact, receipt, chain, portal, bundle)
crypto/ # Ed25519, SHA-256, BLAKE2b, Merkle, JCS canonicalization
proxy/ # MCP governance proxy (transparent interception + policy enforcement)
tools/ # MCP tool handlers (20 tools)
middleware/ # Zero-trust governance enforcement wrapper
independent-verifier/ # Standalone verifier with zero AGA imports
scenarios/ # Deployment scenarios (SCADA, drone, AI agent)
tests/ # TypeScript test suite (218 tests)链接
安全性
请参阅 SECURITY.md 以了解漏洞报告。
贡献
请参阅 CONTRIBUTING.md 以了解开发设置和指南。
许可证
Attested Intelligence Holdings LLC
Available Tools
15 toolsattest_subjectC
Attest subject, generate sealed Policy Artifact. Auto-loads into portal.
Inputs: subject_content (required), subject_metadata (required), evidence_items, behavioral_baseline.
delegate_to_subagentB
Derive a constrained policy artifact for a sub-agent. Scope can only diminish, never expand. (NCCoE constrained delegation)
Inputs: measurement_types (required), delegation_purpose (required), enforcement_triggers (required), requested_ttl_seconds (required).
generate_evidence_bundleA
Export the canonical SEP evidence bundle: signed PERMITTED/DENIED tool-call receipts + Merkle proofs + a mandatory signed checkpoint, for offline third-party verification (verify_bundle_offline, aga-verify, or aga-receipt-spec/verify/verify-sep.mjs). Pin gateway_public_key to prove provenance.
Inputs: no named parameters.
get_chain_eventsC
Get continuity chain events.
Inputs: end_seq, start_seq.
get_portal_stateA
Get current portal state, loaded artifact info, and enforcement status.
Inputs: no named parameters.
get_receiptsC
Get all signed receipts, optionally filtered by artifact.
Inputs: artifact_hash.
get_server_infoA
Get AGA server info, public keys, and portal state.
Inputs: no named parameters.
init_chainC
Initialize continuity chain with genesis event.
Inputs: specification_hash.
list_claimsA
List available claims with sensitivity levels.
Inputs: no named parameters.
measure_behaviorA
Measure behavioral patterns (unauthorized tools, rate violations, forbidden sequences). DETECTIVE-ONLY by default: it records and PROVES drift but does not block. Pass enforce=true to also trip the portal into phantom quarantine on drift (opt-in; off by default). (NIST-2025-0035)
Inputs: enforce.
measure_integrityB
Measure subject state, compare to sealed reference. Generates signed receipt for every measurement.
Inputs: subject_content (required), subject_metadata (required).
request_claimC
Request disclosure of a claim. Auto-substitutes if denied.
Inputs: claim_id (required), mode, requester_id.
revoke_artifactA
Revoke an active policy artifact mid-session. Portal terminates on next measurement. (NCCoE Phase 3b)
Inputs: reason (required), sealed_hash (required).
verify_bundle_offlineA
Verify a canonical SEP evidence bundle offline (full §6 algorithm: structural floor, receipt signatures, chain+ordering, leaf-recompute + Merkle bijection, signed checkpoint). Pass pinned_public_key to also prove provenance.
Inputs: bundle, pinned_public_key.
verify_chainC
Verify continuity chain integrity.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Each tool has a unique purpose with no overlapping functionality. For example, measure_behavior and measure_integrity measure different aspects, and verify_chain vs. get_chain_events are distinct operations. The descriptions clearly differentiate them.
All tool names follow a consistent verb_noun pattern in snake_case (e.g., attest_subject, delegate_to_subagent, verify_chain). There is no mixing of conventions or irregular naming.
With 15 tools, the server is well-scoped for its attestation and policy domain. Each tool earns its place, covering setup, measurement, verification, and revocation without being excessively numerous.
The tool surface appears complete for the server's purpose, covering artifact creation, delegation, evidence export, chain initialization, state querying, claims handling, behavioral and integrity measurement, revocation, and offline verification. No obvious gaps in the core workflow.
Maintenance
Related MCP Connectors
Zero-trust gateway for AI agents: score tool calls, verify agent cards, enforce policy, audit.
Free hosted notary: make any AI agent's actions provable in one call. Verify signed agent logs.
Free hosted notary: make any AI agent's actions provable in one call. Verify signed agent logs.
Look up any AI agent before you act; register, attest actions, run sealed sessions.
Related MCP Servers
- AlicenseAqualityCmaintenanceLocal zero-trust permission gateway for AI agents. Enforces policy-based tool authorization, human approvals, scoped permissions, and cryptographically verifiable audit logs.4115 PyPI5Apache 2.0
- AlicenseNot gradedqualityCmaintenanceSelf-hosted MCP gateway that applies deterministic, compiled policy to tool discovery, invocation, and outbound data flow, with no model in the enforcement path. Every decision emits a hash-chained receipt sealed with Ed25519 and verifiable using public keys only.Apache 2.0
- AlicenseNot gradedqualityCmaintenanceProvides permission gates and tamper-evident audit logging for AI agent tool executions, with declarative policies, consent ladders, and hash-chained verification.MIT
- AlicenseAqualityAmaintenanceGates every AI agent tool call against your policy before it runs, then writes a hash-chained, tamper-evident record of what was decided and what happened. Anyone can verify that record offline, without your software, your systems or any key you hold.415AGPL 3.0