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.

已驗證STDIO僅桌面開發者工具安全與監控

概覽

AI 產生的概覽

PrufGate 提供十個唯讀 MCP 工具,用來檢查程式碼以及聲稱其可用的測試是否真實,而非偽造或被削弱。

可以做什麼
  • 對儲存庫或變更差異執行確定性檢查,找出偽造的成功回傳、樁程式碼與範例資料
  • 稽核測試完整性:缺少斷言、不可能失敗的斷言、mock 受測單元、被刪除或弱化的測試
  • 標記差異層面的取巧:新增的 skip、抑制註解、假退出以及被調降的覆蓋率或 CI 設定
  • 檢查契約:未宣告的相依套件匯入、未記錄的環境變數、前端呼叫不存在的 API 路由
  • 辨識依用戶端傳入 ID 讀取紀錄卻缺少歸屬檢查的 BOLA/IDOR 式路由處理
  • 離線解釋規則與發現項目,並可選擇性對低信心發現啟用 AI 裁定
適用情境
適合在審查 AI 產生或倉促提交的拉取請求時使用,讓助理找出能編譯、看似完成但實際未完成任務的程式碼。它用來搭配而非取代 linter 與 SAST 工具。
執行需求
以 Python 套件(prufgate,可透過 uvx 或 pipx 啟動)在本機以 stdio 執行;需要 Python 3.9 或更新版本以及 Git。未宣告任何驗證、環境變數或標頭。單一檔案 zipapp 不含 MCP 伺服器。
安裝前請注意
工具本身標為唯讀,但整套工具提供需明確開啟的模式:會執行儲存庫測試,或把少量程式碼行傳送給 AI 供應商,需相應參數及 OPENAI_API_KEY、ANTHROPIC_API_KEY 等憑證。以啟發式為主的分析會漏報,也會誤報正確程式碼,發現項目應人工複核。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 PrufGate,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[PrufGate logo]

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 catch block 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-ignore or 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

#EngineWhat it catches
1Anti-fabrication (prufgate/anti_fabrication)Canned success on error paths, simulated return values, MOCK_*/SAMPLE_* data in production code, stub UI handlers, fake "fresh" timestamps, unimplemented stubs, LLM prompts that ask for a verdict without passing any evidence, documentation addresses in production.
2Test integrity (prufgate/anti_reward_hacking)Tests with no assertions, assertions that cannot fail, tests that mock the unit under test, swallowed exceptions, assertions deleted or weakened in a diff, test files deleted or test cases removed in a diff, production code special-casing a test's literal input.
3Diff guard (prufgate/diff_guard)Skips and focus (.skip, .only, xit, pytest.mark.skip, t.Skip(), #[ignore], @Disabled) added without an issue reference, fake exits (sys.exit(0), process.exit(0), module-level SkipTest) added to tests or test setup, bare suppressions (@ts-ignore, # noqa, // nolint, #[allow]), as unknown as T casts, weakened linter/CI/coverage settings, and new exemptions in PrufGate's own config.
4Contract guard (prufgate/contract_guard)Imports not declared in package.json, pyproject.toml/requirements*.txt, go.mod or Cargo.toml; environment variables read without a default and missing from .env.example; frontend calls to API routes that do not exist.
5BOLA / IDOR (prufgate/bola)Route handlers that look up a record by a client-supplied ID with no auth guard or no tenant/owner scoping, across Express, Next.js, NestJS, FastAPI, Flask, Django, Go (net/http, Gin, Echo, Chi), Spring, Rails and Laravel. Optional live two-token probing of a running service you own.
6Diff reviewer (prufgate/review)High-precision rules on changed lines (SQL built from strings, shell injection, disabled TLS verification, hard-coded credentials, unsanitised HTML, ignored Go errors, credential logging), GitHub suggestion blocks, and optional delegation to an AI CLI or API you choose.

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.

bash
pipx install prufgate     # or: pip install prufgate  (the `prufgate` and `prufgate-mcp` commands)prufgate --self-check     # every engine against its built-in fixturesuvx prufgate --version    # or run it without installing, with uv

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:

bash
curl -LO https://github.com/GuardianVigil-Labs/Prufgate/releases/latest/download/prufgate.pyzcurl -LO https://github.com/GuardianVigil-Labs/Prufgate/releases/latest/download/SHA256SUMSsha256sum -c --ignore-missing SHA256SUMSgh attestation verify prufgate.pyz --repo GuardianVigil-Labs/Prufgatepython3 prufgate.pyz --self-checkpython3 prufgate.pyz check .

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:

bash
docker run --rm -v "$PWD:/workspace" ghcr.io/guardianvigil-labs/prufgate:1.3.0          # the fast gate on this repositorydocker run --rm -v "$PWD:/workspace" ghcr.io/guardianvigil-labs/prufgate:1.3.0 prufgate check .

Or add the GitHub Action to a pull-request workflow, pinned to the commit SHA of the v1.3.0 tag (full example):

yaml
- uses: actions/checkout@<commit-sha>  with: { fetch-depth: 0, persist-credentials: false }- run: python3 -m pip install "PyYAML>=6.0"- uses: GuardianVigil-Labs/Prufgate@<commit-sha-of-v1.3.0>

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):

yaml
repos:  - repo: https://github.com/GuardianVigil-Labs/Prufgate    rev: v1.3.0    hooks:      - id: prufgate          # changed files, on every commit      - id: prufgate-full     # whole repository, before a push (pre-commit install --hook-type pre-push)

Then, in your project:

bash
prufgate check .                          # engines 1-5 on the whole repositoryprufgate check --changed --base origin/main   # only what this branch changedprufgate init --hooks                     # starter config + coding-agent hooksprufgate baseline                         # record existing findings; only new ones are reported

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

WantUse
A quick check while codingprufgate check --changed
What a finding means and how to fix itprufgate explain <rule> (or --list for every rule): works offline
Adopt it on a codebase that already has findingsprufgate baseline, then commit .prufgate/baseline.yaml: existing findings are recorded and only new ones are reported (details)
Findings inline in VS CodeThe VS Code extension (source): runs prufgate check --changed on save, trusted workspaces only (install from a .vsix for now)
One engineprufgate test-audit, prufgate bola, prufgate review
The full gate with SARIF and Markdown reports./prufgate.sh fast (changed files) or ./prufgate.sh full, from a checkout. Reports go to reports/prufgate.sarif, reports/prufgate-review.md, reports/gl-code-quality-report.json (GitLab Code Quality) and reports/prufgate-junit.xml.
A pull-request gate on GitHubThe composite action in this repository: docs/CI_INTEGRATION.md
The result where reviewers lookThe action writes a short summary (verdict, top findings, what the change touched) to the job summary, and with pr_comment: 'true' keeps it as one pull request comment: details
A coding agent sent back to fix its findings before it stopsprufgate init --hooks (Claude Code Stop hook, which asks once; Cursor rule; the pre-commit hook and the CI gate enforce)
A coding agent stopped from skipping hooks, force-pushing or deleting tests and CI configprufgate init --hooks (Claude Code, Cursor) or --agent copilot|codex|gemini: fail-closed hooks running prufgate hook <agent> <event> (support table)
Base-branch tests run against the head code (executes repository tests: sandbox or CI only, opt-in)prufgate verify --differential --allow-run-tests
Mutation smoke test on the changed lines with an installed mutmut, Stryker, PIT, gremlins, go-mutesting or cargo-mutants (executes repository tests: opt-in)prufgate verify --mutation --allow-run-tests
PrufGate as a Claude Code plugin (hooks plus a /prufgate:prufgate-check skill)pipx install prufgate, then in Claude Code /plugin marketplace add GuardianVigil-Labs/Prufgate and /plugin install prufgate@prufgate (details)
Other agents and AI reviewers (Cursor Bugbot, Copilot review) told to use PrufGate's findingsprufgate init --agents-md (AGENTS.md) and --bugbot (.cursor/BUGBOT.md): a marked section, updated in place on rerun (details)
An AI second opinion on PrufGate's own low-confidence findings only (opt-in, sends a few lines of code to a provider you choose)ai_adjudicate: true in the configuration: see AI adjudication
Tools for an agent over MCPprufgate mcp: ten read-only tools, including prufgate_explain
A service that scans on webhookprufgate api: bearer token, loopback by default

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:

yaml
version: 1packs: [core, web-ui, ai-safety]      # cti is an opt-in domain packexclude: ["dist/**", "vendor/**"]auth_guards: [requireUser, get_current_user]tenant_keys: [organization_id, account_id]exempt:  src/legacy/adapter.ts:    route-canned-fallback: "#104: legacy fallback until the payments API migration"known_debt:  stub-click-handler: 0                # a ceiling that can only go down

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 --ai asks the model to review the whole diff.
  • ai_adjudicate: true in the configuration (read at the base ref in a pull request, by prufgate check and the prufgate.sh gate; --ai-adjudicate alone does nothing without it) asks one yes/no question per low-confidence finding (medium too 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

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
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.1.0最新Oct 29, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分