AgentGate
AgentGate
一个为 AI 智能体构建的受治理工具调用网关,基于 Terminal 3 的 ADK 构建。
给 LLM 智能体一个 API 密钥,它就能调用任何东西、花费任何东西、泄露任何东西——而你事后才从它自己写的日志里发现。
AgentGate 在智能体与外部世界之间放置了一个硬件隔离的飞地。智能体指定的是端点,而不是 URL。它从不持有凭证,也从不看到用户的个人数据。它所做的每一次尝试——无论允许还是拒绝——都会落入一个它无法编辑的账本中。
它以 MCP server 的形式发布,因此任何 MCP 客户端(Claude Code、Claude Desktop、Cursor、SDK 智能体)只需添加一条配置项即可获得受治理的工具调用。无需框架,无需重写。
MCP client (Claude / Cursor / your agent)
│ call_endpoint { endpoint: "resend", path: "/emails",
│ body: { to: ["{{profile.verified_contacts.email.value}}"] } }
▼
AgentGate MCP server ← holds the T3N session; the model holds nothing
│
▼
┌─ z:<tid>:agentgate — TEE contract (Rust → WASM, Intel TDX) ───────────────┐
│ 1. every {{…}} marker must be profile.* AND on this endpoint's allowlist │
│ 2. path must be one the tenant enumerated — exact match, no globs │
│ 3. credential read from the sealed z:<tid>:secrets map │
│ 4. host substitutes real PII inside the enclave (contract never sees it) │
│ 5. upstream response projected to declared fields only │
│ 6. ledger entry appended — for ALLOWED and DENIED alike │
└───────────────────────────────────────────────────────────────────────────┘
▼
api.resend.com ← reached only if the data owner's grant permits this host它确实有效。这是凭证
在 T3N 测试网上运行 npm run demo——下面的每一次调用都由组织铸造的智能体发出:
🛑 DENIED profile field outside the endpoint's allowlist ({{profile.ssn}})
marker rejected: 'ssn' is not in this endpoint's allowed_placeholders
🛑 DENIED marker reaching for another namespace ({{secret.resend_api_key}})
marker rejected: 'secret.resend_api_key' is not a profile marker
🛑 DENIED path the tenant never enumerated (/domains)
path rejected: '/domains' is not in this endpoint's allowed_paths
🛑 DENIED endpoint that does not exist (stripe)
unknown endpoint
── policy is per-ENDPOINT, not per-host ──────────────────────────────
'resend' and 'resend-notify' share a host AND a credential.
The same marker is allowed on one and refused on the other.
✅ ALLOWED {{profile.first_name}} via 'resend' (allowlisted there)
{"data":{"id":"d7299ce6-668f-47f2-8e22-8f3f96c0f255"},"status":200}
🛑 DENIED {{profile.first_name}} via 'resend-notify' (allowlist is empty)
marker rejected: 'first_name' is not in this endpoint's allowed_placeholders
✅ ALLOWED no markers via 'resend-notify' (allowed, returns nothing)
{"data":{},"status":200}真实邮件已送达。收件人的地址和姓名是在飞地内从数据所有者的资料中解析出来的——它们不会出现在智能体的输入、MCP 传输、合约内存或账本中的任何地方。
最后一行是默认拒绝的响应投影:resend-notify 未声明任何 response_fields,因此成功调用只返回状态码和一个空对象。连上游的消息 ID 也被扣留了。
之后的账本:
denied 0 resend/emails markers=["profile.ssn", …] 'ssn' not allowed here
denied 0 resend/emails markers=["secret.resend_api_key"] not a profile marker
denied 0 resend/domains markers=[] path not enumerated
denied 0 stripe/emails markers=[] unknown endpoint
ok 200 resend/emails markers=["first_name","last_name","verified_contacts.email.value"]
denied 0 resend-notify/emails markers=["profile.first_name", …] 'first_name' not allowed here
ok 200 resend-notify/emails markers=[]标记名称会被记录。标记值从未可供记录。
Related MCP server: Proofpane
快速开始
npm install
cp .env.example .env # add your T3N_API_KEY from terminal3.io/claim-page
npm run test # 9 native policy tests, no network, no credits
npm run build # Rust → wasm32-wasip2
npm run deploy # idempotent — safe to re-run
npm run doctor # pre-flight a deployment you didn't just create
npm run demo # the run shown above添加到任何 MCP 客户端:
{ "mcpServers": {
"agentgate": { "command": "npx", "args": ["tsx", "/path/to/agentgate/mcp/server.ts"] } } }添加端点
一个文件。无需 Rust,无需重新部署合约。
// agentgate.config.json
"endpoints": {
"stripe": {
"base": "https://api.stripe.com",
"secret_key": "stripe_api_key", // key in z:<tid>:secrets
"auth_header": "Authorization",
"auth_prefix": "Bearer ",
"allowed_paths": ["/v1/customers"], // exact match only
"allowed_placeholders": ["first_name", "verified_contacts.email.value"],
"response_fields": ["id"] // everything else is dropped
}
}然后运行 npm run deploy。当 wasm 未变化时,它会跳过合约注册,因此添加一个端点只需约 160 积分,而不是约 1,850 积分。
为什么设计成这个样子
三个决策来自对平台的实测,而非纸上谈兵:
拒绝返回
Ok,绝不返回Err。 合约写入在出错时会回滚,因此在策略拒绝时返回Err会回滚记录该拒绝的审计条目——智能体可以反复触发策略而不留任何痕迹。响应是投影的,而非透传的。
http-with-placeholders只保护出站方向。上游响应会完整返回 WASM,因此一个回显请求的端点会把标记扣留的 PII 交还回去。已在docs/BUGS.md中演示。合约不设置
Content-Type。 宿主会追加自己的而不是替换你的,产生application/json,application/json,严格的上游会拒绝——静默地,返回 HTTP 200 和空响应体。参见docs/BUGS.md#1。
仓库结构
Path | What |
| TEE 合约—— |
| MCP 服务器——3 个工具 |
| 幂等部署;持有 |
| 预检健康检查 |
| 上面展示的运行 |
| 声明式地定义每个端点和授权(2 个端点,对比策略) |
| 已提交的账本,记录所有签发过的 |
| 针对平台的 13 项发现 |
| 为什么飞地边界设在这里 |
| 给下一位运维者的运行手册 |
| 用于绘制占位符表面的临时诊断工具——未随产品发布 |
状态
使用 @terminal3/t3n-sdk@5.2.0 在 T3N 测试网上完成端到端构建与验证,运行了完整的三方身份流程:
Principal | Holds | Role in the run above |
租户 | eth 密钥,已注资 | 拥有合约,封存凭证,枚举策略 |
数据所有者 | 自己的 DID + 资料 | 授权智能体;标记根据其资料解析 |
智能体 | 一个不透明的 bearer token,仅此而已 | 发出上面展示的每一次调用 |
智能体的签名密钥在 TEE 内部铸造,从未离开过。它不持有 API 密钥、URL 或任何个人数据,也无法访问核心合约来查看自己的授权——但它却能将一封个性化邮件送达真实收件箱。
要做到这一点,需要 Terminal 3 手动为智能体 DID 注资:铸造出的智能体从零开始,一次调用会预留 10,000 个代币,且没有自助充值功能(docs/BUGS.md#10)。每个开发者在创建第一个智能体时都会遇到这个问题。
This server cannot be installed
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 Connectors
Security gateway for AI agents: policy, approval, and audited execution, no secrets shared.
Credential broker for AI agents: scoped, revocable API access with policy enforcement and audit.
Zero-trust gateway for AI agents: score tool calls, verify agent cards, enforce policy, audit.
Zero-secret MCP gateway for AI agents: risk-scored, audited calls with human-in-the-loop approval.
Related MCP Servers
- FlicenseNot gradedqualityAmaintenanceProvides a trust and governance layer for AI agents, enabling secure API access, credential vaulting, paid execution with human approval, and automatic call resume.152
- AlicenseBqualityAmaintenanceA governance proxy for AI tools — every MCP/agent tool call is policy-gated, secret-redacted, and written to a hash-chained, offline-verifiable audit trail.13MIT
- AlicenseNot gradedqualityBmaintenanceBounded egress gateway & secret proxy for AI agents and applications, enabling safe credential injection into upstream requests while keeping raw secrets out of LLM prompt contexts.6MIT

evav-gatewayofficial
AlicenseNot gradedqualityBmaintenanceGoverned MCP gateway that lets AI agents call tools with policy enforcement, prompt-injection screening, a kill-switch, and tamper-evident signed audit logs.Apache 2.0
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/Anshv784/agentgate'
If you have feedback or need assistance with the MCP directory API, please join our Discord server