v0.4 Open source · MIT · alpha
Scanner findings in.
Verified fixes out.
OpenFix reads the reports your scanners already write, has the model you choose patch each finding in a throwaway checkout, then checks the patch without trusting the model. A fix only counts when the scanner, your tests and a new regression test all agree.
pip install "openfix-cli[all]"uv tool install "openfix-cli[all]"npx openfix-cli --helpuses: markusweldon/openfix@v0.4.1- Ingest normalize · redact
- Policy openfix.yaml
- Fix any model
- Verify rescantestsregression
- Ship receipt · draft PR
An illustrative run: five example findings and how the pipeline treats each one. The receipt and terminal below come from the real demo.
Reads the reports you already have
How it works
Six steps. Only one of them involves a model.
-
01
Ingest
Reports are detected and normalized into one finding model. Secrets are redacted, because reports are untrusted input.
-
02
Policy
The first matching rule in
openfix.yamldecidesautofix,proposeorskip. Guards and budgets apply. -
03
Reproduce
A fresh scan of the original code must still report the finding. If it doesn't, it's dropped before any model is called.
-
04
Fix
The model edits a disposable git worktree through a few policy-checked tools. Vulnerable direct dependencies are bumped with no model at all.
-
05
Verify
Rescan, tests and a differential regression test run independently of the agent. The model is never asked if it worked.
-
06
Ship
patch.diff, a signedreceipt.json, SARIFfixes[]and, for verified autofixes, a draft PR. It never merges.
Proof, not prose
The regression test has to fail first.
Anyone can write a test that passes. OpenFix runs the agent's new test against the original code and requires it to fail, then requires it to pass with the fix. That's how you know the test actually exercises the bug.
From examples/vulnerable-app in the repo. Run it yourself without an API key.
8function readUserFile(userPath) {
9 var base = path.join(__dirname, "..", "data");
10 var target = path.join(base, userPath);
9 var base = path.resolve(__dirname, "..", "data");
10 var target = path.resolve(base, String(userPath));
11 if (target !== base && !target.startsWith(base + path.sep)) {
12 throw new Error("Path escapes the data directory");
13 }
11 return fs.readFileSync(target, "utf8");Semgrep · path-traversal-path-join-var
12}
1var test = require("node:test");
2var assert = require("node:assert/strict");
3var files = require("../src/files");
4
5test("rejects paths outside the data directory", () => {
6 assert.throws(() => files.readUserFile("../package.json"),
7 /escapes the data directory/);
8});
Bring any model
Models propose. Code verifies.
--model
Claude, GPT, Gemini, Grok, OpenRouter, Groq, DeepSeek, Mistral, any OpenAI-compatible gateway, or a local model through Ollama, vLLM or LM Studio. One flag.
Keep sensitive paths on local models only with local_only_paths.
verify.require
- rescan
- tests
- regression_test
- review by a second model, optional
Swap the model as often as you like. The checks don't move. Use a reviewer from another provider to look for bypasses in the exact diff.
Policy as code
You decide what a model may touch.
One YAML file. The first matching rule wins. Pick a finding to see where it lands.
# openfix.yaml (the first matching rule wins)
rules:
- match: { category: [secrets] }
action: skip # rotate, don't just delete
- match: { path: ["**/auth/**", "**/payment*/**"] }
action: propose # patch + receipt, no PR
- match: { category: [sast, sca], min_severity: medium }
action: autofix # draft PR when verified
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/ledger/**"]
budgets: { max_turns: 40, max_usd_per_fix: 3.0, max_usd_per_run: 25.0 }
A contained blast radius
Nothing trusted. Everything checked.
Scanner reports, repository code and model output are all untrusted. The agent gets no shell, no network and no git. It can read, search and edit files, run your tests and rescan, and every write is checked against your policy. Tests run in Docker with networking off.
- Fresh container per command. All capabilities dropped, no-new-privileges, memory, CPU and process limits, your user id rather than root.
- Secrets stay outside. API keys never enter the sandbox, the prompts or the receipts.
- The only way out is a draft PR for a verified autofix, and a person merges it.
One command
Two scanners in. Two verified fixes out.
Replayed from the demo in the repo: Snyk Code, Semgrep and the tests are real, the model's tool calls are recorded. The draft PR it opened is live at markusweldon/openfix-demo#2.
predicate.status
VERIFIED
3 of 3 required checks passed
signed
subject · sha256(patch.diff)
36cd2f68…
patch.diff +5 −2 · receipt.sigstore.json
Receipts
Every fix comes with a receipt.
A signed, re-checkable record of what changed, why the policy allowed it, which model wrote it, what it
cost, and the evidence for every check. It's an in-toto statement whose
subject is the SHA-256 of patch.diff. Sign it with Sigstore using --sign.
Checks that it's a valid statement, that patch.diff matches the digest, that the base commit exists, and that the patch still applies. Example values from docs/receipts.md.
GitHub Action
Put it on a schedule. Review PRs on Monday.
Findings go in, verified draft PRs come out. Every PR has an evidence table and the receipt digest. Your CI still runs, and a person still merges.
- 06:00Schedulecron, or run it by hand
- 06:01ScanSnyk, Semgrep, CodeQL, Trivy
- 06:04Fix & verifywithin
max_usd_per_run - 06:19Draft PRsone per verified fix
- 09:30You mergeor you don't
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.1
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 }}
Know what to fix first
Pair it with CVErdict.
OpenFix fixes what your scanners find. CVErdict tells you which CVEs actually matter today, from public exploit evidence, with no model in the scoring. Same rule in both: every answer comes with receipts.
Open cverdict.dev →Try it in a minute, without an API key.
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