
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 分