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]"
openfix fix snyk.sarif semgrep.sarif gitleaks.json
Semgrep high path-traversal-path-join-var src/files.js:11
  1. Ingest normalize · redact
  2. Policy openfix.yaml
  3. Fix any model
  4. Verify rescantestsregression
  5. 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

Snyk CodeSnyk Open SourceSemgrepGitHub CodeQLDependabotTrivyOSV-ScannerGitleaksCheckovBanditAny SARIF 2.1.0
anthropic:claude-opus-5-5openai:gpt-5gemini:gemini-2.5-proxai:grok-4ollama:qwen2.5-coder:32bopenrouter:*groq:*deepseek:*mistral:*compat:* (any OpenAI-compatible gateway)

How it works

Six steps. Only one of them involves a model.

  1. 01

    Ingest

    Reports are detected and normalized into one finding model. Secrets are redacted, because reports are untrusted input.

  2. 02

    Policy

    The first matching rule in openfix.yaml decides autofix, propose or skip. Guards and budgets apply.

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

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

  5. 05

    Verify

    Rescan, tests and a differential regression test run independently of the agent. The model is never asked if it worked.

  6. 06

    Ship

    patch.diff, a signed receipt.json, SARIF fixes[] 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.

src/files.js test/files-traversal.test.js new
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});
original codepatched code
rescan 1 finding 0 findings, 0 new
tests baseline: pass pass
regression test fails ✔ expected passes
verified all required checks passed

Bring any model

Models propose. Code verifies.

--model

anthropic:claude-opus-5-5 openai:gpt-5 gemini:gemini-2.5-pro xai:grok-4 ollama:qwen2.5-coder:32b deepseek:deepseek-chat anthropic:claude-opus-5-5

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.
Read the security model →
docker sandbox · network off
disposable git worktree
agent
read_filesearchedit_filewrite_filerun_testsrescansubmitgive_up

One command

Two scanners in. Two verified fixes out.

openfix-demo

          

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.

receipt.json in-toto · Statement v1

predicate.status

VERIFIED

3 of 3 required checks passed

sigstore
signed
findingSemgrep OSSpath-traversal-path-join-var
locationsrc/files.js:11base 9b3f760c
policyautofixrule "code findings"
authorclaude-opus-5-59 turns · $0.41
checkoriginalpatched
rescan1 finding→0, none new✔
testspass→pass✔
regressionfails→passes✔

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.

$ openfix receipt verify .openfix/runs/<run>/<finding> --repo .

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.

  1. 06:00Schedulecron, or run it by hand
  2. 06:01ScanSnyk, Semgrep, CodeQL, Trivy
  3. 06:04Fix & verifywithin max_usd_per_run
  4. 06:19Draft PRsone per verified fix
  5. 09:30You mergeor you don't
.github/workflows/openfix.yml
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