Skip to main content

agentic-preflight

CI Coverage Python License

Check your coding agent's work before a push.

Agentic Preflight checks a coding agent's work before the agent pushes a commit. It works with Codex, Claude Code, Cursor, OpenCode, and Amp. It guides your coding agent through review, documentation, lint, and test stages. It records the results for the exact commit. The pre-push hook blocks a normal push if this evidence is missing or no longer valid.

  • Use your current agent. The core CLI calls no model and needs no model API key.
  • 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.

The author merged 408 pull requests across four repositories from August 3 to September 6, 2026. Of these pull requests, 323 record an Agentic Preflight run. The dogfooding case study describes this evidence and its limits.

The hook blocks a push. Review finds an unguarded division. A verified fix passes the gate, which shows the publication target.

Quickstart

You need Git 2.38+, Python 3.11 through 3.13, and uv.

  1. 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.

  2. 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"
    

    init writes a configuration file with comments and installs an advisory pre-push hook. Pass --no-hook to write only the configuration file.

  3. Review the generated configuration before you start a run.

    Setup, lint, test, and optional command-review entries execute with your user privileges.

  4. Make and commit your product change.

  5. Ask your coding agent to invoke $agentic-preflight in Codex or /agentic-preflight in 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.

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. 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. The retired [ci] and [reuse] sections cause a warning and have no effect.

When you upgrade from 0.6.0, remove those sections and [hook] enabled. See the 0.7 upgrade guide. 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.

Architecture, evaluation, and evidence

Design records, executable tests, and published evaluations support this workflow. Use this table to find more information:

Question Design or evidence
How does this workflow compare with its inspiration? Prior art and differentiation
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
What repository context reaches review, and how is untrusted content bounded? Grounded context
When can evidence survive a rebase or restack? Fingerprint contract
How are attestations enforced in CI? CI enforcement
What does a second reviewer add, and how are reviewers compared? Independent review and agreement
What public evidence supports the project, and what does it not prove? Dogfooding case study and public regression eval
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 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

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.

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 proves what the configured stages reported. It does not prove that the reviewer understood the change. 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.

Requirements

  • A supported macOS, Linux, or Windows and Python combination from the compatibility policy
  • Git 2.38+
  • A POSIX shell if a configured command needs shell interpretation or its program cannot be resolved directly
  • gh if the agent will create pull requests, inspect hosted checks, or verify merges

Git for Windows supplies a POSIX shell on Windows.

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.8.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 agentic-preflight 0.8.0
File Size Uploaded Provenance Actions
agentic_preflight-0.8.0.tar.gz 612.4 kB With provenance Details for agentic_preflight-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agentic-preflight 0.8.0
File Interpreter ABI Platform Actions
agentic_preflight-0.8.0-py3-none-any.whl Python 3 none any Details for agentic_preflight-0.8.0-py3-none-any.whl

Total release size: 918.0 kB

Release files / agentic_preflight-0.8.0.tar.gz

Download URL agentic_preflight-0.8.0.tar.gz
Size 612.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4d0256e2546fd160120a0e50b202b15917dbeb7963a2e5da3388b3dfde720d95
BLAKE2b-256 checksum
How to use checksums
5c3220891a42d08d36f76fd9d94e187d241dfaad28e0666beace3dfd93d9d538
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 Oct 23, 2026.

Transparency log

Release files / agentic_preflight-0.8.0-py3-none-any.whl

Download URL agentic_preflight-0.8.0-py3-none-any.whl
Size 305.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40f835c245b43751043064e58c82118f14a47444e52e912f63be2dc01245ee01
BLAKE2b-256 checksum
How to use checksums
4dbc231f8a354e23bd3c62fd7d39575631478c1478eba5844051abf664a2c318
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 Oct 23, 2026.

Transparency log

Security for agentic-preflight 0.8.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 agentic_preflight-0.8.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 Oct 23, 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