Turn scanner findings into verified fixes, with any model, under your policy.
Quick start · How it works · Policy · Models · GitHub Action · Docs
OpenFix reads the reports your scanners already produce: Semgrep, CodeQL, Snyk, Trivy, OSV-Scanner, Gitleaks, Dependabot, or anything that writes SARIF. A policy file decides which findings may be fixed. The model you choose writes a minimal patch in a throwaway checkout, and OpenFix then checks the patch without trusting the model. A fix only counts when the scanner, your tests and a new regression test all agree.
Every fix comes with a receipt: a signed, re-checkable record of what changed, why it was allowed, which model wrote it and what proved it works.
Models propose. Code verifies. The model writes the patch. Your scanner, your tests and a new regression test prove it, or it doesn't ship.
Demo example from examples/vulnerable-app with docs/demo/record.py. The model's tool calls are replayed so anyone can rerun it without an API key; Snyk Code, Semgrep, the tests and GitHub are real. The pull request in the demo is live: markusweldon/openfix-demo#2. Waiting is sped up.
Why OpenFix
Quick start
pip install "openfix-cli[all]" # or: uv tool install "openfix-cli[all]"
export ANTHROPIC_API_KEY=... # or OPENAI_API_KEY, GEMINI_API_KEY, XAI_API_KEY, ... (openfix providers)
semgrep scan --sarif -o semgrep.sarif # any scanner that writes SARIF or a supported JSON format
openfix plan semgrep.sarif # what the policy will do with each finding; no model calls
openfix fix semgrep.sarif # fix, verify, and write receipts to .openfix/runs/<timestamp>/
Use a different model to write fixes than the one that reviews them, and open draft PRs for the fixes that pass:
openfix fix semgrep.sarif --model openai:gpt-5 --reviewer anthropic:claude-opus-5-5 --open-prs
Try it without an API key
The repository includes a deliberately vulnerable Node app, real Semgrep rules, and a recorded model session:
git clone https://github.com/markusweldon/openfix && cd openfix
pip install -e . semgrep
cd examples/vulnerable-app
openfix fix findings/semgrep.sarif --only path-traversal-path-join-var \
--model scripted:demo/path-traversal.script.yaml --sandbox local
→ [high] path-traversal-path-join-var src/files.js:11 [autofix via rule 'code findings']
verified: all required checks passed (rescan, tests, regression_test)
CI runs this same flow on every push.
How it works
| # | Stage | What happens |
|---|---|---|
| 1 | Ingest | Reports are detected and normalized into one finding model. Secret values are redacted and finding ids are sanitized, because reports are untrusted input. |
| 2 | Policy | The first matching rule in openfix.yaml decides autofix, propose or skip, and guards and budgets are applied. |
| 3 | Reproduce | A fresh scan of the original code must still report the finding. If it doesn't, the finding is dropped. |
| 4 | Fix | The model works in a disposable git worktree through a small set of policy-checked tools. Your checkout is never touched. |
| 5 | Verify | The checks below run independently of the agent. |
| 6 | Ship | OpenFix writes patch.diff, receipt.json and SARIF fixes[]. A verified autofix can become a draft PR. |
The checks
| Check | What it proves |
|---|---|
| Rescan | The scanner reports the finding on the original code, and doesn't report it (or anything new) on the patched code. |
| Tests | Your test suite does no worse on the patched code than on the original. |
| Regression test | The test the agent added fails on the original code and passes with the fix, so it actually exercises the vulnerability. |
| Review (optional) | A second model, ideally from another provider, reads the exact diff, looking for bypasses and behavior changes. |
The receipt
Each receipt is an in-toto statement whose subject is the SHA-256 of patch.diff. It records the finding, the policy decision, the model and token cost, and the evidence for every check. Sign it with --sign (Sigstore cosign), and re-check it at any time:
openfix receipt verify .openfix/runs/<timestamp>/<finding-id> --repo .
Policy as code
# openfix.yaml (the first matching rule wins)
rules:
- match: { category: [secrets] }
action: skip # rotate credentials; don't just delete them from code
- match: { path: ["**/auth/**", "**/payment*/**"] }
action: propose # patch + receipt for a human, no PR
- match: { category: [sast, sca], min_severity: medium }
action: autofix # draft PR when every required check passes
guards:
max_files_changed: 4
max_lines_changed: 200
protected_paths: [".github/workflows/**", "**/.env*"]
models:
author: anthropic:claude-opus-5-5
reviewer: openai:gpt-5
local_only_paths: ["services/payments/**"] # this code is only ever sent to local models
budgets: { max_turns: 40, max_usd_per_fix: 3.0, max_usd_per_run: 25.0 }
verify:
require: [rescan, tests, regression_test]
Run openfix init to write a starter file. Full reference: docs/policy.md.
Bring any model
| Provider | Example --model |
Credential |
|---|---|---|
| Anthropic | anthropic:claude-opus-5-5 |
ANTHROPIC_API_KEY |
| OpenAI | openai:gpt-5 |
OPENAI_API_KEY |
| Google Gemini | gemini:gemini-2.5-pro |
GEMINI_API_KEY |
| xAI Grok | xai:grok-4 |
XAI_API_KEY |
| OpenRouter, Groq, DeepSeek, Mistral, Together, Fireworks | openrouter:<model>, groq:<model>, … |
<PROVIDER>_API_KEY |
| Any OpenAI-compatible gateway | compat:<model> |
OPENFIX_COMPAT_BASE_URL |
| Local: Ollama, vLLM, LM Studio | ollama:qwen2.5-coder:32b |
none |
Run openfix providers to see which credentials are set. Details: docs/providers.md.
GitHub Action
Run it on a schedule
Put OpenFix on a schedule and it works as a remediation factory: your scanners' findings go in, and verified draft PRs come out. Nothing ships without proof, and a person still merges every fix. The workflow below runs every Monday at 06:00 UTC, and you can also start it by hand from the Actions tab. max caps how many findings one run attempts, and max_usd_per_run in openfix.yaml caps what a run can spend on the model.
name: OpenFix
on:
workflow_dispatch:
schedule: [{ cron: "0 6 * * 1" }]
permissions:
contents: write
pull-requests: write
jobs:
fix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pip install semgrep && semgrep scan --config p/default --sarif -o semgrep.sarif || true
- uses: markusweldon/openfix@v0.4.0
with:
reports: semgrep.sarif
model: anthropic:claude-opus-5-5
reviewer: openai:gpt-5
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Each verified autofix becomes a draft PR with an evidence table and the receipt digest. Receipts, summary.md and openfix.sarif are uploaded as a workflow artifact. Your CI still runs on the PR, and a person still merges it.
Supported inputs
| Format | Sources |
|---|---|
| SARIF 2.1.0 | Semgrep, CodeQL, Snyk Code, Trivy, Checkov, Bandit, Gitleaks, … |
| Native JSON | Semgrep, Snyk Open Source, Trivy (vulnerabilities, misconfigurations, secrets), OSV-Scanner, Gitleaks |
| GitHub APIs | Code-scanning alerts, Dependabot alerts |
| OpenFix | Findings JSON, for your own tools |
Formats are detected automatically. Pass several reports at once and duplicate findings are merged.
Commands
| Command | |
|---|---|
openfix findings REPORT... |
Normalize and list findings (--json for OpenFix findings JSON) |
openfix plan REPORT... |
Show the policy decision for each finding |
openfix fix REPORT... |
Fix, verify and write receipts: --model, --reviewer, --only, --max, --require, --sandbox, --open-prs, --sign |
openfix receipt verify DIR |
Re-check a receipt's digests and that its patch still applies |
openfix providers |
Supported providers and credential status |
openfix init |
Write a starter openfix.yaml |
--repo can point at a subdirectory of a monorepo. Findings, tests and scans are resolved relative to it, and patches are written relative to the repository root.
Documentation
- Policy reference
- Providers and models
- Verification and receipts
- Security model: what OpenFix protects against, and what it doesn't
- Findings format
- Brand and diagrams: logo, colours, type, and the script that draws the images
- Roadmap
Status
OpenFix 0.3 is alpha. The core pipeline (ingest, policy, agent, verification, receipts and PRs) is implemented and tested end to end against real scanners and test suites. Next on the roadmap: a public fix-rate benchmark across models, an MCP server, and GitLab support.
Issues and pull requests are welcome; start with CONTRIBUTING.md. To report a vulnerability in OpenFix itself, see SECURITY.md.
License
Brand icons in the diagrams come from Simple Icons (CC0) and the Semgrep repository. All trademarks belong to their owners, and their use here doesn't imply endorsement.
Metadata
Release files for openfix-cli 0.4.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 |
|---|---|---|---|---|
| openfix_cli-0.4.0.tar.gz | 95.8 kB | With provenance | Details for openfix_cli-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| openfix_cli-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for openfix_cli-0.4.0-py3-none-any.whl |
Total release size: 166.5 kB
Release files / openfix_cli-0.4.0.tar.gz
| Download URL | openfix_cli-0.4.0.tar.gz |
|---|---|
| Size | 95.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5441ff8eef2c286eeb3bb9a239bc3dda5f6be4b749d1d0956e058bc75003b0c6
|
|
BLAKE2b-256 checksum How to use checksums |
9f8742d775d4a6341d30bccd51340defe09e675e4ad53a411b5930b62548f917
|
| 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 / openfix_cli-0.4.0-py3-none-any.whl
| Download URL | openfix_cli-0.4.0-py3-none-any.whl |
|---|---|
| Size | 70.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ebe94514487f4fac3cbce9334471f7796ab8a24ccc51f7f794f937d8d390009c
|
|
BLAKE2b-256 checksum How to use checksums |
f32fd747da9bc72e12caa7e56dbd3c1b2c3298c7e84377ae29b44c759203c314
|
| 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 openfix-cli 0.4.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 openfix_cli-0.4.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.