Skip to main content

zairo

Git-diff-aware security impact analysis. zairo diffs a repository, builds a dependency subgraph (via Trailmark) around whatever changed, and can run an LLM vulnerability scan limited to just that changed code — instead of re-scanning the whole codebase on every change.

Output is a report.json (raw graph data), a self-contained report.html (interactive dependency graph viewer), and — when --llm is used — a report.sarif for tools that consume SARIF (e.g. GitHub code scanning).

Install

pip install zairo

For local development:

python -m venv venv
source venv/bin/activate
pip install -e ".[dev]"

Usage

# Analyze uncommitted changes in a repo
zairo analyze /path/to/repo

# Diff two refs, traverse 2 hops out from changed nodes, run an LLM scan
zairo analyze /path/to/repo --base main --target HEAD --depth 2 --llm

Run zairo --help / zairo analyze --help for the full option list.

Try it on a sample repo

python examples/generate_sample_repos.py
zairo analyze examples/sample-repos/cmd-injection-app --base HEAD~1 --target HEAD --llm

Generates a few small repos under examples/sample-repos/, each with one commit introducing a distinct, LLM-findable vulnerability (command injection, SQL injection, path traversal) — good for a first run, and for giving fleet (below) genuinely different repos to scan instead of one repo copied twice.

Scanning multiple repos (fleet)

For a security team that owns many repos, not just one: zairo fleet scans several repos with the same settings and rolls the results up into one fleet.json/fleet.html/fleet.sarif, alongside each repo's own reports under <output>/<repo-slug>/. --base/--target are applied uniformly to every repo, so this fits best when they share a diffing convention (e.g. all diffing against main).

# From positional paths
zairo fleet /path/to/repo-a /path/to/repo-b --base main --target HEAD --llm

# Or from a file, one repo path per line ('#' comments allowed)
zairo fleet --repos-file repos.txt --base main --target HEAD --llm --fail-on high

By default a failing repo doesn't stop the rest of the fleet from being scanned (--stop-on-error to change that); any repo that failed still fails the overall run's exit code. --fail-on gates on the worst finding across all repos combined.

Run zairo fleet --help for the full option list.

CI / PR gating

--fail-on <low|medium|high|critical> (on both analyze and fleet) exits non-zero if any finding at or above that severity is found, so a CI step can block a merge on it. It requires --llm, and doesn't suppress the SARIF output — it's still written even on a failed gate (including a clean, empty one on a passing scan), so a scanning UI reflects the current state either way.

zairo analyze . --base "$BASE_REF" --target HEAD --llm --fail-on high -o zairo_out

See examples/github-actions/zairo-pr-scan.yml for a full PR-scan workflow: it runs zairo on the PR diff, uploads report.sarif to GitHub's code scanning, and fails the job if the gate fails.

Development

pytest

License

MIT — see LICENSE.

Metadata

Release files for zairo 0.3.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 zairo 0.3.0
File Size Uploaded Provenance Actions
zairo-0.3.0.tar.gz 36.6 kB With provenance Details for zairo-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 70.6 kB

Release files / zairo-0.3.0.tar.gz

Download URL zairo-0.3.0.tar.gz
Size 36.6 kB
Tags Source
SHA-256 checksum
How to use checksums
63b053996fffa157d696d3f142b24b41cbd76d3b463edd6efbdef711dd5a244b
BLAKE2b-256 checksum
How to use checksums
eb32a7e8036e8937530b3834994a0512cc93b4e9936b0c36861bce7defab036c
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 Aug 29, 2026.

Transparency log

Release files / zairo-0.3.0-py3-none-any.whl

Download URL zairo-0.3.0-py3-none-any.whl
Size 34.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0bc08c186b3970e91261338b84fd8fb3b1f8e5603b37f5ab0d1322a1a3e95092
BLAKE2b-256 checksum
How to use checksums
e9ce640a1661a51a26f736765604f638014f63a14d3e7368fb561dd3cd762f53
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 Aug 29, 2026.

Transparency log

Security for zairo 0.3.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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for zairo-0.3.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 Aug 29, 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