agentic-preflight
Check your coding agent's work before a push.
A coding agent that reports "tests passed" may be describing a different revision, a different configuration, or a different intent from the commit it is about to push. Nothing in a normal push connects that claim to the exact inputs that produced it.
Agentic Preflight guides your coding agent through review, documentation, lint, and test stages. It records each result with a fingerprint of those inputs. The pre-push hook blocks a normal push if this evidence is missing or no longer matches the commit. It works with Codex, Claude Code, Cursor, OpenCode, and Amp.
- Use your current agent. The workflow commands call no model and need no model API key.
An optional packaged reviewer,
agentic-preflight reviewer run, calls theclaudeorcodexCLI that you install. - Inspect each stage. The run record includes skipped stages, failures, findings, and approvals.
- Keep results with their inputs. A changed commit, configuration, or intent cannot use unrelated evidence.
Agentic Preflight is in beta. The compatibility policy lists the supported platforms and each compatibility change. The changelog lists each release.
Quickstart
You need the following:
- Git 2.38+
- Python 3.11 through 3.14 on a macOS, Linux, or Windows version from the compatibility policy
uvghif the agent will create pull requests, inspect hosted checks, or verify merges- A POSIX shell if a configured command needs shell interpretation or its program cannot be resolved directly. Git for Windows supplies a POSIX shell on Windows.
-
Install the CLI and the integrations for your coding agents:
uv tool install agentic-preflight agentic-preflight integrations install codex claude cursor opencode amp
Remove unused integration names from the command.
-
Initialize each repository that you want to protect:
cd your-repo agentic-preflight init git add .agentic-preflight.toml git commit -m "Configure Agentic Preflight"
initwrites a configuration file with comments and installs an advisory pre-push hook. Pass--no-hookto write only the configuration file. -
Review the generated configuration before you start a run.
Setup, lint, test, and optional command-review entries execute with your user privileges.
-
Make and commit your product change.
-
Ask your coding agent to invoke
$agentic-preflightin Codex or/agentic-preflightin Claude Code.The installed skill controls the run and presents findings. It follows each command that the CLI returns.
The hook stops a push if the changed commit has not passed its run. The hook tells you how to start or resume verification. After the run passes, the agent shows the target remote, branch, commits, and risk.
The agent pushes only with your request or permission from your standing instructions.
See push and pull-request authorization.
Set [gate] mode = "manual" if only a person must run the final Git command.
The installation guide includes source installations, upgrades, project skills, other Agent Skills clients, and removal. If you have an earlier version, see Releases and upgrades.
What Agentic Preflight adds
Agentic Preflight works with prompts, ordinary Git hooks, hosted CI, and human review. It does not replace these checks.
A prompt can ask an agent to review work and run tests. The conversation does not bind those results to a commit. Ordinary hooks run deterministic commands. Hosted CI validates code after publication.
Agentic Preflight puts these checks in an ordered workflow before a push. It records the results for the commit that passed. You can resume an interrupted workflow.
These records help in the following conditions:
- An agent reports a successful command from an earlier revision.
- A fix changes code after review or testing.
- Repository policy requires documentation review or independent review.
- A rebase changes the commit identity.
- A high-risk path requires a specified human-approval mode.
Agentic Preflight is advisory. It shows missing or invalid evidence in the normal workflow.
It is not a security boundary. A person can bypass the local hook with git push --no-verify.
What happens during a run
Agentic Preflight moves the change through this workflow:
review -> documentation -> lint -> test -> merge-back -> gate -> push
At the start, the agent supplies your objective and acceptance criteria.
If origin exists, Agentic Preflight fetches it.
It rebases the validation worktree onto the current base before review.
If a rebase would change the content that the branch introduces, it merges the base instead.
Each agent-facing workflow command returns one JSON object with the next permitted command.
This recorded state lets an interrupted run resume.
Each stage has a specified purpose:
- Review lists changed hunks and non-text files. The reviewer must account for the complete snapshot. The record keeps findings and their dispositions.
- Documentation checks configured documents for claims that the change makes incorrect.
- Lint and test run configured commands and record exit codes and output hashes. Changes that affect only documentation or CI configuration skip the software test command. An explicit transition records the skip. Applicable tests complete locally before publication. Hosted CI separately validates the proposed integration.
- Merge-back and approval check that reviewed content matches the source branch. They calculate risk from repository policy and findings. They show the publication target.
- Push publishes the branch and its Git-note attestation in one atomic operation. An attestation is a record of the checks for a commit. Automatic PR mode lets the agent create or reuse a GitHub pull request and monitor its checks. Manual PR mode returns a compare URL.
A rebase with equivalent content can reuse review and documentation evidence if its inputs still match. Applicable lint and test stages run again in each new run, even for identical trees. Keep the producer and protected verifier on the same version. See the fingerprint contract.
Pull-request merge polling and cleanup after merge are disabled by default.
Set [pr] automated_cleanup = true to enable them.
Run agentic-preflight status in the source worktree to inspect or resume its run.
Use agentic-preflight status --all to list runs across linked worktrees.
Configure repository policy
Commit .agentic-preflight.toml at the repository root.
Each section replaces the complete matching section in the user configuration, ~/.config/agentic-preflight/config.toml.
[telemetry] is the exception: a repository section can only turn telemetry off.
See Local run telemetry.
Use the file to set these options:
- Protected base branch and lint/test commands
- Blocking finding severities and independent command-review policy
- Documentation paths and generated-file exclusions
- Path-based risk and required human-approval mode
- In-place, reusable, or strict validation worktrees
- Automatic or manual push and pull-request behavior
Unknown keys cause errors. Commit configuration changes before you start the affected run. Each run saves its resolved configuration. The configuration reference lists all options and gives a complete example.
Warning: Repository commands execute with your privileges. These commands can include setup, lint, test, and independent review. Run Agentic Preflight only where you are willing to execute the repository's code and build commands.
Choose a validation worktree
The default in_place mode validates the current checkout.
Use a clean worktree with one agent and one pull request.
This mode can reuse dependencies installed in that checkout.
Set [worktree] mode to reusable or strict to validate without changes to the source checkout.
Isolated validation worktrees do not inherit .venv, node_modules, .env, or other ignored files.
Configure setup_command to install dependencies. Configure copy_files for required ignored files.
The worktree-modes guide
explains mode selection, concurrent runs, secrets, and recovery.
Enforce attestations in CI
A successful merge-back writes a versioned JSON attestation as a Git note on the exact commit. The attestation records review coverage, finding dispositions, stage results, and policy. It also records inputs used to check whether evidence remains valid after a history rewrite.
The local hook checks the commit for the push.
A GitHub workflow from the protected base can also verify the attestation.
It can enforce the configured high-risk approval mode before merge.
This requires forge configuration. A committed .agentic-preflight.toml file alone does not change branch protection.
See Portable attestations and CI enforcement
for setup and verification commands.
Limits
Agentic Preflight is an advisory pre-push check. It is not a security boundary.
- A person can bypass the local hook with
git push --no-verify. - The push-confirmation token is not a secret. It prevents an accidental tool-driven push. It does not stop an agent with shell access from a direct Git invocation.
- An attestation is an unsigned record of what the stages reported.
verifychecks it against the commit, a recomputed merge base, and the policy committed on the protected base. It cannot prove that a stage ran, that the reviewer understood the change, or who wrote the note. It does not replace hosted CI or human review. - Git notes can change. Anyone with permission to update the notes ref can replace an attestation.
Set [gate] mode = "manual" if the CLI must refuse to perform the final push.
Read the limits guide
before you use attestations or evidence reuse to enforce policy.
Documentation
Use this table to find the guide for a task:
| Question | Guide |
|---|---|
| How do I install from source, upgrade, use another Agent Skills client, or remove the tool? | Installation |
| Which options can I set, and what does a complete configuration look like? | Configuration reference |
| Which validation worktree mode fits my repository? | Worktree modes |
| What does the pre-push hook check, and what does it not check? | Pre-push hook |
| When does a run skip the software test command? | Change scope and the test-skip exception |
| How are attestations enforced in CI? | Portable attestations and CI enforcement |
| What does a second reviewer add, and how are reviewers compared? | Independent review and agreement |
| What does the tool record about my own runs, and where? | Local run telemetry |
| How do I summarize my runs across repositories? | Read the report |
| Which pushes did the pre-push hook allow or block, and why? | Hook decisions |
| What can attestations and evidence reuse not prove? | Limits |
| Does it work in a shallow or partial clone, a sparse checkout, a monorepo, or with submodules or Git LFS? | Repository shapes |
| Which platforms are supported, and what changed between versions? | Compatibility policy |
Design and evidence
Design records, executable tests, and published evaluations support this workflow.
How it fits together
flowchart LR
A[Coding agent] --> S[Skill]
S --> C[JSON-envelope CLI<br/>and state machine]
C --> R[(Run store)]
R --> N[Git-note attestation]
N --> H[Pre-push hook]
H --> V[CI verifier]
Design records
| Question | Design or evidence |
|---|---|
| Which inputs is a result bound to, and when can evidence survive a rebase or restack? | Fingerprint contract |
| Which stages and transitions exist, and when may a run publish? | State machine |
| What repository context reaches review, and how is untrusted content bounded? | Grounded context |
| Where does responsibility pass between the coding agent, CLI, and shell commands? | ADR 0001: orchestration boundaries |
| How can linked worktrees run independently and safely? | ADR 0002: worktree-scoped run ownership |
| Why does the package ship a reviewer, and which model dependencies does it allow? | ADR 0003: packaged command reviewer |
| How does this workflow compare with its inspiration? | Prior art and differentiation |
| Which scripted cases guard workflow behavior? | Public regression eval |
| Where are the pre-registered evaluation results and the immutable evidence ledgers published? | elanthus/preflight-eval-results |
| What did real Claude and Codex smoke runs measure? | Opus 5.5 and GPT-6.1 Sol at low effort: runtime, findings, states, and tokens (2026-10-17) |
| What public evidence supports the project, and what does it not prove? | Dogfooding case study |
Dogfooding
The dogfooding case study found the same failure in three independent codebases: a green result stayed valid after an input that shaped it changed. Green evidence must bind every decision-making input, including code, configuration, intent, model, and prompts. The study also describes the limits of its evidence.
As of 2026-10-30, across three public repositories, 442 of 665 merged pull requests record Preflight use, with 110 containing concrete finding records. These are one owner's PR records, not a measure of external adoption or distinct defects fixed.
Tests
Integration tests use real Git repositories. They do not simulate Git behavior.
CI rejects overall test coverage below 85%.
It also installs the built wheel as a uv tool before it invokes the CLI.
The contributor guide
describes local development.
Releases and upgrades
Releases publish to PyPI from GitHub Actions with Trusted Publishing. Each release distribution has a CycloneDX SBOM. Each release also has GitHub artifact attestations for build provenance and for the SBOM. To verify a distribution that you downloaded from PyPI, run this command:
gh attestation verify <file> -R elanthus/agentic-preflight
An attestation does not establish that an artifact is free of vulnerabilities. See the security policy.
Before you upgrade, read the steps for your current version:
- From 0.8: follow the 0.8 to 0.9 upgrade steps. Upgrade the protected CI verifier before, or together with, the local CLI: a 0.8 verifier rejects a note that 0.9.0 writes.
- From 0.7: follow the 0.7 to 0.8 upgrade steps to align shared-clone machines, copied skills, and the protected CI verifier before you enable new settings. Then follow the 0.8 to 0.9 upgrade steps.
- From 0.6.0: remove the retired
[ci]and[reuse]sections and[hook] enabled. The retired sections cause a warning and have no effect. See the 0.7 upgrade guide. That guide installs 0.7.0. Then follow the 0.7 to 0.8 and the 0.8 to 0.9 upgrade steps. Do not skip to 0.9.0: it does not read run records that 0.6.0 wrote.
Help and development
Use the support guide for help and security reports. Contributors should start with the contributor guide.
Agentic Preflight uses the Apache 2.0 license. @elanthus created it with development contributions from OpenAI Codex and Anthropic Claude.
Metadata
Release files for agentic-preflight 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agentic_preflight-0.9.0.tar.gz | 967.9 kB | With provenance | Details for agentic_preflight-0.9.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agentic_preflight-0.9.0-py3-none-any.whl | Python 3 | none | any | Details for agentic_preflight-0.9.0-py3-none-any.whl |
Total release size: 1.4 MB
Release files / agentic_preflight-0.9.0.tar.gz
| Download URL | agentic_preflight-0.9.0.tar.gz |
|---|---|
| Size | 967.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d260871656e9cd231033901230fdeef5ec32735762def850b3987a020bf3b931
|
|
BLAKE2b-256 checksum How to use checksums |
cdaf6414c01925a31eac716beba1aee075e5411db0b1b9c4b42201fd1a1c1aff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 18, 2026.
Transparency logRelease files / agentic_preflight-0.9.0-py3-none-any.whl
| Download URL | agentic_preflight-0.9.0-py3-none-any.whl |
|---|---|
| Size | 455.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
51115a186f890729712d24a2179ae7894e35574bf5b626394b523b6b9bfc198c
|
|
BLAKE2b-256 checksum How to use checksums |
535b5d7c8ab845338efc33bd1af20f29abede0818a9270a7c787b804ad8d8f1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 18, 2026.
Transparency logSecurity for agentic-preflight 0.9.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.
Attestation for agentic_preflight-0.9.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 Nov 18, 2026.
Transparency logA 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.