
PrufGate
io.github.GuardianVigil-Labs由 GitHub 账号 GuardianVigil-Labs 发布v1.1.0更新于 Oct 29, 2026
Read-only tools that check whether code, and the tests that claim it works, are real.
概览
PrufGate 提供十个只读 MCP 工具,用于检查代码以及声称其可用的测试是否真实,而非伪造或被削弱。
- 可以做什么
- 对仓库或变更差异运行确定性检查,发现伪造的成功返回、桩代码和示例数据
- 审计测试完整性:缺少断言、不可能失败的断言、mock 被测单元、被删除或弱化的测试
- 标记差异层面的取巧:新增的 skip、抑制注释、假退出以及被下调的覆盖率或 CI 设置
- 检查契约:未声明的依赖导入、未记录的环境变量、前端调用不存在的 API 路由
- 识别按客户端传入 ID 读取记录却缺少归属校验的 BOLA/IDOR 式路由处理
- 离线解释规则与发现项,并可选择性对低置信度发现启用 AI 裁定
- 适用场景
- 适合在审查 AI 生成或匆忙提交的拉取请求时使用,让助手找出能编译、看似完成但实际未完成任务的代码。它用于配合而非替代 linter 和 SAST 工具。
- 运行要求
- 以 Python 包(prufgate,可通过 uvx 或 pipx 启动)在本地通过 stdio 运行;需要 Python 3.9 或更高版本以及 Git。未声明任何认证、环境变量或请求头。单文件 zipapp 不包含 MCP 服务器。
安装
在 SourceWeft 中
- 打开 控制台中的 PrufGate,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
PrufGate
Checks whether code, and the tests that claim it works, are real.
[License: Apache 2.0] [PyPI version] [Python 3.9+] [OpenSSF Scorecard] [OpenSSF Best Practices]
Linters check that code compiles. PrufGate looks for code that compiles, passes review at a glance and still does not do the job. This is the kind of code an AI coding agent (or a hurried human) writes to make a task look finished:
- a
catchblock that returns a hard-coded success object; - a click handler that does nothing;
- a test that asserts
true, or mocks the very function it tests; - a
.skip,@ts-ignoreor lowered coverage threshold slipped into a diff; - an import of a package that is not declared anywhere;
- an API route that loads a record by ID without checking who owns it.
PrufGate is deterministic: plain Python, no network calls and no LLM unless you ask for one. It runs in seconds on a pull request, and writes SARIF for code scanning and Markdown for humans. It is meant to sit next to your linters and SAST tools, not replace them.
The six engines
Details, rule IDs, supported languages and known limits for each engine: docs/ENGINES.md.
PrufGate uses pattern and structure heuristics, not a full parser for every language. It will miss things and it will sometimes flag correct code. Every finding names its rule, and inline prufgate-ignore: rule -- reason comments, exemptions and baselines let you record why.
Quick start
PrufGate needs Python 3.9 or newer and Git.
Or download one file, prufgate.pyz, from the latest release (releases after 1.0.0). It is a zipapp with PyYAML (pure Python) inside, so it needs nothing but Python 3.9 or newer:
The hooks that prufgate init --hooks writes call prufgate on PATH, so for them install the file as a command: install -m 755 prufgate.pyz ~/.local/bin/prufgate. The zipapp runs every command a pip install has except mcp (use pipx install prufgate for the MCP server). Like a pip install, it does not include the shell batteries (./prufgate.sh fast / full with ast-grep, gitleaks and zizmor); prufgate.pyz fast and full run the Python engines only. For the full battery use the container image or a checkout. There are no native per-OS binaries: they would need a build on three operating systems for every release, and the zipapp covers the same need. python3 scripts/build_pyz.py builds the same file from a checkout; it downloads the hash-locked PyYAML sdist from PyPI and refuses one that does not match requirements.txt.
Or run the signed container image, which adds the full gate with ast-grep, gitleaks and zizmor:
Or add the GitHub Action to a pull-request workflow, pinned to the commit SHA of the v1.3.0 tag (full example):
Every release is signed and carries build provenance and an SBOM: Verify a release.
Or add it to your pre-commit configuration, .pre-commit-config.yaml (details):
Then, in your project:
Exit codes are the same everywhere: 0 clean, 1 blocking findings (P0/P1), 2 PrufGate could not run (bad config, bad base ref, unreadable file, engine crash). A crash never reads as a pass.
Ways to run it
The full command and option reference is in docs/GETTING_STARTED.md, and every configuration key is in docs/CONFIGURATION.md.
Configuration in one look
PrufGate works without configuration. To tune it, add .prufgate/config.yaml:
In a pull request (any run with a base ref) PrufGate reads this file as it is on the base branch, so configuration changes take effect after merge: a change cannot exempt its own findings.
AI adjudication
PrufGate is deterministic by default and sends nothing anywhere. Two opt-in modes use an AI provider you choose (a claude CLI, OPENAI_API_KEY, ANTHROPIC_API_KEY or OLLAMA_HOST; --ai-provider names another):
prufgate review --aiasks the model to review the whole diff.ai_adjudicate: truein the configuration (read at the base ref in a pull request, byprufgate checkand theprufgate.shgate;--ai-adjudicatealone does nothing without it) asks one yes/no question per low-confidence finding (mediumtoo if configured): is this real? The prompt holds the rule, the finding message and a few redacted lines around it, never whole files.
An adjudication verdict can only hide noise. A finding judged not real stops blocking and moves to an "AI-dismissed" list with the model's reason: a section of prufgate check output and of the Markdown report, and a SARIF suppressions entry of kind external (AI-dismissed: <reason>). High-confidence findings are never sent; nothing is ever added or raised. A provider error, a timeout, a reply that is not exactly {"real": true|false, "reason": "..."}, a run over its budget, or code that addresses the judge (a comment naming the AI, LLM, judge, reviewer or PrufGate) keeps the finding as it would be without AI. Verdicts are cached outside the repository. Settings: docs/CONFIGURATION.md.
Documentation
- Getting started: install, commands, reports, exit codes
- Configuration reference: every key, suppressions, environment variables
- The engines: rules, languages and limits
- CI and agent integration: GitHub Action, other CI, agent hooks, MCP, REST API
- Custom rules: your own ast-grep rules and hooks
- Architecture
- Benchmark: measured precision and recall on a labelled corpus, and how to add a case
- Changelog
Contributing and security
Contributions are welcome: see CONTRIBUTING.md and the maintainer guide AGENTS.md. Please report vulnerabilities privately, as described in SECURITY.md.
PrufGate is published by GuardianVigil under the Apache License 2.0. The name and logo are trademarks: see TRADEMARKS.md.
来源:README.md,提交 91faf70
工具
0版本历史
1- v1.1.0最新Oct 29, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分