
Agent Gate
io.github.Jott2121由 GitHub 账号 Jott2121 发布v0.1.1更新于 Oct 27, 2026
Fail-closed quality gate and hash-chained receipt ledger for AI agent workflows.
概览
一个本地 MCP 服务器,为 AI 智能体提供“失败即拦截”的完工检查清单,以及防篡改、哈希链式的回执账本。
- 可以做什么
- 获取智能体在宣称完成前必须满足的检查清单
- 对提交的证据按失败即拦截原则评估,返回是否通过及阻塞项
- 把决策、指标、取值与结论作为回执追加到哈希链账本
- 读取全部回执并查看哈希链是否完整
- 适用场景
- 适合希望智能体在宣布完成前先证明工作、并留下可审计决策记录的场景。适用于担心静默失败、未经验证的结论或日志被篡改的智能体工作流。
- 运行要求
- 以 Python 包(mcp-agent-gate)形式通过 stdio 在本地运行,用 pip 安装并以 Python 模块启动。未声明需要账号、API 密钥或请求头。回执写入用户主目录下的账本文件,可用环境变量 AGENT_GATE_LEDGER 覆盖路径。
安装
在 SourceWeft 中
- 打开 控制台中的 Agent Gate,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
agent-gate
[ci] [CodeQL] [Coverage] [License: MIT] [Python] [MCP]
An MCP server that lets an AI agent gate its own work before it claims "done": deterministic checks, then an independent refute-first review, then a tamper-evident honest receipt.
Agents that grade their own homework ship low-quality output. agent-gate turns that discipline into tools an agent must actually pass: a fail-closed checklist and an append-only, hash-chained receipts ledger. It is Fleet Mode, an agent-orchestration doctrine, made into a runnable tool. Receipts over hype, enforced by the data structures.
🧩 One layer of a five-repo cost-governance stack for operating AI agents cost-efficiently; bow is the flagship that runs every layer in production.
Why
The expensive failures in agent systems are the silent ones: a model update degrades output, a change quietly breaks a workflow, an agent declares success while the work is wrong. The fix is not a smarter model. It is a gate the agent cannot talk its way past:
- Fail-closed. A check counts as satisfied only if it is explicitly true. Missing proof is not proof. (Mirrors a promotion gate, not an informal check.)
- Tamper-evident receipts. Every decision is recorded as
(decision, metric, value, verdict)linked into a sha256 chain. Edit or delete any past receipt andverify_chain()returns false. The honest log is enforced by the structure, not by good intentions. - Human-gated by default. "Any irreversible/outward act got human approval" is a required check. Agents draft, humans approve.
Tools (over MCP)
The default ship gate encodes Fleet Mode: deterministic_checks_pass, independent_refute_review, no_secrets, human_gated_if_irreversible, honest_receipt_logged.
Install & wire into an MCP client
Add it to your MCP client (Claude Desktop / Claude Code) config:
Now your agent can call verify_gate(...) before it tells you it is finished, and you get a tamper-evident trail of what it decided. Receipts persist to ~/.agent-gate/receipts.jsonl (override with AGENT_GATE_LEDGER).
Use it directly (no MCP client needed)
Design
- Tested, stdlib-only core.
agent_gate/gate.py(fail-closed checklist) andagent_gate/ledger.py(hash-chained receipts) are pure stdlib: fast to read, fast to trust.agent_gate/server.pyis a thin MCP adapter over them (the one runtime dependency:mcp). - Tests pass on Python 3.11-3.13 (see CI). The MCP tools are tested by calling them, not just importing.
Tests
Demo
Run it yourself: PYTHONPATH=. python3 examples/demo.py
This repo gates itself
agent-gate is about not shipping unverified work, so the repository holds itself to the same bar:
- Coverage-gated test matrix —
ci.ymlruns pytest on Python 3.11–3.13 and fails the build if line coverage drops below the threshold (currently 97% covered). - CodeQL — static analysis (
security-extended) runs on every push, PR, and weekly; findings surface in the Security tab. - Pinned supply chain — every GitHub Action is pinned to a full commit SHA; Dependabot keeps those pins and the Python deps current.
- Branch protection —
mainrequires the CI and CodeQL checks to pass before a merge. - Disclosure policy — see SECURITY.md.
Contributing
See CONTRIBUTING.md.
About
Built by Jeff Otterson (Jott2121). agent-gate operationalizes the gating discipline from bow (an autonomous all-Claude chief-of-staff agent) and the Fleet Mode doctrine. Siblings in the same line: rag-guard and agent-cost-attribution. MIT licensed.
Companion instrument
sabot is the measurement side of this idea. agent-gate adds a fail-closed gate to an agent workflow; sabot plants controlled faults inside running LangGraph, CrewAI and AutoGen pipelines and measures whether gates and reviewer stages like these actually fire. Median own-check detection across three production frameworks: 16.7%, with a pre-registered spec, an Apache-2.0 harness, and every raw trace published.
来源:README.md,提交 ef91c37
工具
0版本历史
1- v0.1.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分