Skip to main content

exitzero

An agent saying “done” is not evidence. Run the policy, check the exit code, and keep the receipt.

English | 한국어

exitzero is a small developer tool that runs a repository's policy. The same TOML policy drives the local CLI, Git hooks, and CI, and every run leaves a JSON receipt. You use one command; inside, a small core and plugins do the work. This MVP checks Python code and agent configuration. Explicit command checks can run your existing tools for any language.

Install

Python 3.11 or newer is required. Runtime and tests use only the standard library.

pip install exitzero

Then, inside any repository:

exitzero init
exitzero check
exitzero lint-config
exitzero report --format json

Without installing, prefix every command with uvx (or pipx run):

uvx exitzero init
uvx exitzero check

init creates a starter TOML policy, a managed section in AGENTS.md, and ignore entries for local receipts and Python caches. In an empty repository it also creates a tiny Python sample. It preserves existing policy files. The starter policy checks syntax only: add project-specific checks before using it as a merge gate. A syntax pass is not a claim that your application works.

To run it from a source checkout instead — no package installation or build tools needed:

git clone https://github.com/ictechgy/exitzero.git
cd exitzero
export PATH="$PWD/bin:$PATH"

For a conventional source install, use a virtual environment and python -m pip install .. Building uses setuptools. If setuptools and wheel are already available, an offline editable install is python -m pip install --no-index --no-build-isolation --no-deps -e .. The checkout launcher above needs no build tools.

Generate checks for a Python repository

init can write the common static checks and your existing test/review commands in one step. Run this instead of the bare init above: init never overwrites an existing policy and exits 2 if one is present — in that case edit the policy directly, then run exitzero init --sync. Each command is parsed into argv and later runs with shell=False; {python} means the Python interpreter running exitzero.

exitzero init --profile python \
  --source-root src --source-root tests \
  --allow-module numpy --allow-module pytest \
  --test-command '{python} -m pytest' \
  --review-command '{python} scripts/review_contract.py'

--source-root, --allow-module, and --review-command can be repeated. Quote literal arguments that contain punctuation; shell pipelines, redirects, and other control operators are rejected. init only records commands, so it does not execute them. Keep credentials out of command arguments because the policy stores the resulting argv. Existing policies are never overwritten, and generation options cannot be combined with init --sync. Without --profile python, init remains the syntax-only compatibility starter. Generated command checks fingerprint Python files for the receipt. If a test or review command depends on JSON, YAML, Markdown, or another non-Python input, edit that check's paths in the policy to include those files.

From a checkout, the included example exercises all four check types:

./bin/exitzero --root examples/sample check
./bin/exitzero --root examples/sample lint-config

Put review requirements in the policy

version = 1
plugins = ["exitzero_verify", "exitzero_harness"]

[[checks]]
id = "syntax"
kind = "python.syntax"
paths = ["src/**/*.py", "tests/**/*.py"]

[[checks]]
id = "imports"
kind = "python.imports"
paths = ["src/**/*.py", "tests/**/*.py"]
[checks.options]
roots = ["src", "."]
allow_modules = []

[[checks]]
id = "test-quality"
kind = "python.test-quality"
paths = ["tests/test_*.py"]

[[checks]]
id = "review-contracts"
kind = "command"
paths = ["src/**/*.py", "tests/**/*.py"]
[checks.options]
argv = ["{python}", "-m", "unittest", "discover", "-s", "tests", "-v"]
timeout = 30

[harness]
config_files = []
rules = [{id = "error-text", value = "Tests assert the exact public error text."}]

After editing the policy, run exitzero init --sync. Only the generated section of AGENTS.md changes. Its fingerprint covers the complete parsed policy, so changing check options also creates detectable drift. Text outside the section stays yours. Harness rules are documentation and conflict detection, not semantic enforcement: express exact messages, types and result ordering in executable tests. See the sample.

Check What v1 detects
python.syntax Python that cannot be parsed
python.imports Unresolved modules and missing statically declared local module symbols
python.test-quality No test cases, empty tests, obvious constant-only assertions
command A configured test/lint command fails or exceeds its timeout
Harness lint Generated AGENTS drift, installed-hook drift, JSON/TOML config shape errors (Cursor and Claude hook documents, MCP server tables), repeated/conflicting rule IDs

Import analysis does not execute imported code. It is intentionally conservative and does not prove arbitrary dynamic exports, package loading or third-party API signatures. allow_modules explicitly trusts listed external module names. Test-quality analysis detects obvious problems; run real tests as well. Natural language contradictions in arbitrary AGENTS prose or Cursor rule files are not understood by v1.

Commands and outcomes

exitzero init
exitzero init --sync
exitzero check --format json
exitzero lint-config --format json
exitzero hooks install --adapter cursor
exitzero hooks install --adapter pre-commit
exitzero hooks run --slot CI --format json
exitzero report --format json
exitzero plugin harness-eval --scenario examples/eval-repair   # opt-in bounded eval
exitzero plugin mcp-gateway --config gateway.toml              # stdio MCP proxy
exitzero plugin ledger-publish                                 # aggregate run record

Global --root and --policy options go before the subcommand. check runs configuration linters and verification checks. lint-config never executes verification commands. plugin harness-eval replays a scripted multi-turn scenario against the gate inside a temporary copy; each turn's expectations are scored, skipped scenarios are reported separately, and the report lands under .exitzero/evals/. See the eval example. plugin mcp-gateway spawns one upstream MCP server and proxies stdio JSON-RPC; tools/call is authorized against TOML allow/deny patterns (deny-by-default) and every decision lands in .exitzero/mcp-gateway/ audit logs. See the plugin contract for the config schema. plugin ledger-publish rolls receipts into a run record with rollback hints under .exitzero/ledger/; --pr N posts it via gh — explicitly, and only then.

Gate commands — check, lint-config, and hooks run — report outcomes through exit codes:

Exit code Meaning
0 All configured checks passed
1 A check found a violation, including a command that fails, times out, or cannot start
2 Invalid policy, missing plugin, internal execution error, or a receipt that could not be written

init and report are not gates. init exits 2 on invalid options or an existing policy; report prints the latest stored receipt and exits 2 only when that receipt itself recorded an execution error.

Every check, lint-config, and hook gate writes a unique JSON receipt under .exitzero/runs/, including failures and malformed policies. If storage fails, the command exits 2 and reports receipt: null; it cannot claim success. --format json prints the same machine-readable result, and --format sarif emits findings as a SARIF 2.1.0 run for code-scanning integrations. report reads the latest receipt; it does not run a fresh check. See receipt schema.

Receipts include check IDs, findings, exit code, policy hash, hashes of selected inputs, plugin names and timing. They do not contain source code, environment variables, hook input, command arguments or command output. Command output is discarded; rerun a failing command directly to debug it. Receipts identify the declared input selection, not every dependency of arbitrary commands. They are local evidence, not signed or tamper-proof attestations.

Local hooks and CI

See hook setup. Cursor uses a stop hook by default: failures request one follow-up repair turn. This is feedback, not a merge barrier. Git pre-commit and CI enforce exit codes. The generic hook command has the same 0/1/2 contract as check; Cursor translates results to its JSON protocol.

From the exitzero checkout root, run the repository's automated milestone runner:

python3 scripts/ci.py

It runs the repository gate, config lint, sample gate and the manifest-scored fixtures, and writes .exitzero/ci-results.json plus logs. The GitHub workflow runs this same script and uploads .exitzero/ evidence even on failure. Configure the CI job as a required branch check in your hosting service; this repository does not change branch protection settings.

The riskgate pilot applies the same gate to a pinned real repository. It checks a passing baseline and four independent faults, including an empty test that the upstream test runner still accepts. Its runner preserves the original checkout and records all gate receipts. The vecdiff pilot adds external NumPy dependencies and independent numeric review contracts. Both pilots use isolated source copies.

Trust and scope

Policies, selected plugins and command checks are trusted executable configuration. Review them before running an unfamiliar repository. Static checks and config lint make no network requests. Command checks can run arbitrary local programs; choose offline commands to keep the whole gate offline. This is not an execution sandbox; the MCP gateway only authorizes tool names, never arguments. Config files listed under harness.config_files are read only when explicitly selected; an installed Cursor hooks file is fingerprinted automatically so drift is detectable. Do not include credential files. Known credential-like paths and symlink targets are rejected. Path filtering is not a universal secret detector.

There is no cloud service, model hosting, model training, full agent evaluation or automatic rollback. The MCP gateway stays a local stdio proxy; ledger-publish writes to GitHub only through an explicit --pr flag.

Structure and contributing

packages/core              policy, CLI, hook slots, plugin loader, receipts
packages/plugin-verify     verification rules and command checks
packages/plugin-harness    configuration lint; bounded eval command
packages/plugin-mcp-gateway  stdio MCP proxy with a TOML tool allowlist
packages/plugin-ledger       run-record aggregation and rollback hints
fixtures/                  manifest-scored cases (one declared live-only skip)
examples/sample/           runnable error-text/type/order contract example
examples/eval-repair/      scripted multi-turn eval scenario

Read Plugin API, roadmap, and design references. No project code was copied from prior art. Run focused regression tests with python3 scripts/run_tests.py; run the complete local acceptance sequence with python3 scripts/ci.py; measure gate latency with python3 scripts/bench.py (synthetic tree by default, --root PATH for a real repository). Verify a built package and real Git-hook behavior with the offline release runner. See release notes. License: MIT.

Metadata

Release files for exitzero 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for exitzero 0.2.0
File Size Uploaded Provenance Actions
exitzero-0.2.0.tar.gz 55.7 kB With provenance Details for exitzero-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for exitzero 0.2.0
File Interpreter ABI Platform Actions
exitzero-0.2.0-py3-none-any.whl Python 3 none any Details for exitzero-0.2.0-py3-none-any.whl

Total release size: 100.4 kB

Release files / exitzero-0.2.0.tar.gz

Download URL exitzero-0.2.0.tar.gz
Size 55.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9248bd874639359c126731003570d77fd3ed2700ce91c3be15e7ca5822aa6d02
BLAKE2b-256 checksum
How to use checksums
ea6074a8c6cc34b5d8e82a53ea57df246b9390e71b4c6661c36f2e63cc406292
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / exitzero-0.2.0-py3-none-any.whl

Download URL exitzero-0.2.0-py3-none-any.whl
Size 44.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d792916d54d0e41668eddce0762b08ed4503c316078f4457d3bb9efe986feec
BLAKE2b-256 checksum
How to use checksums
f3e484e7cf2e01e3ac780687155c4784f68f57613f922a9367e947ceb29b5975
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Security for exitzero 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for exitzero-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page