All projects

FixBot

internal
FixBot hero illustration

A security pipeline that scans a repository on every push, drafts a fix with a local model, and opens a merge request only after the project's tests, a secrets scan, and a rescan pass. A person merges; FixBot never does.

TypeScriptBunNode.jsPostgreSQLRedisBullMQDockerSemgrep

A security scan produces a list of findings. Each one still needs someone to read it, find the code, write a patch, and check that nothing else broke.

FixBot is built to end a scan in a reviewable change instead. On a push, it scans the code, drafts a fix with a local model, runs the project’s own tests against the fix in a sandbox, and opens a merge request only when the checks pass. A person reviews and merges; FixBot never does.

We built it in December 2025 and ran it end to end on one of my own projects that month, and in October 2026 it was deployed as a service from my infrastructure repository. I have no record yet of a FixBot merge request that was merged, so this page is about the design: what it does, and the decisions that keep it from acting on its own.

What happens on a push

  1. A push from GitLab or GitHub arrives as a webhook. Events are deduplicated and queued.
  2. Semgrep scans the code, with the OWASP Top Ten rules and language rules where the language is known. A secrets scanner runs too, and the results are mapped to OWASP categories, classified, and deduplicated.
  3. FixBot clones the repository at the pushed commit and cuts out the code around each finding: the vulnerable line with fifteen lines on each side, the imports, and the enclosing function or class.
  4. A local model drafts a fix from that context. The fix goes through a syntax check and a linter.
  5. The fix is applied to a copy, the test framework is detected (pytest, Jest, Vitest, or JUnit), and the tests run in a throw-away Docker container.
  6. Only if the tests pass, the secrets scan is clean, and a rescan shows the original finding gone with nothing new does FixBot open a merge request, with labels for severity and type and a risk class of low, medium, or high.
  7. Every step writes a row to an audit log.

Who built it

The merge rule is mine. I asked for research on how other automatic fix tools work before we designed anything, and I made its central finding the first rule. The sweep mode below is my idea, taken from the autoresearch pattern. I also made the call on how the running copy is kept in step with the repository. We built it: “we” is me and a team of AI agents. The specification and plan came out of a spec-driven session with the agents, the agents wrote much of the code, and the commits cite a second model’s review.

Decisions

A person owns the merge

The research came back with one point GitHub, Microsoft, and Amazon agreed on. In the words of the research document: “Humans Always Own the Merge Button.” The project’s plan records it as a gate marked “NON-NEGOTIABLE.”

There were three ways to honor it. FixBot could create nothing on its own and stop at “fix generated,” which adds a manual step to every fix. It could merge low-risk fixes by itself, which the specification left room for, and a low-risk flag is still stored with each merge request. Or it could open a merge request and leave the merge to a person. The code does the third. There is no call to merge or accept a merge request anywhere in it, and nothing reads the auto-merge flag.

Prove it before asking a person

Without a check, a reviewer spends time on fixes that cannot apply. So a fix has to clear four checks before FixBot opens a merge request: the project’s own tests pass with the fix applied, the secrets scan is clean, a rescan no longer finds the original problem, and it finds nothing new.

The tests run in a container with no network, 512 MB of memory, one CPU, the repository mounted read-only, and a five-minute limit. That costs time and a Docker dependency, and the runner only handles the frameworks it can detect. Test setups for TypeScript projects are a known limit and an open issue.

Give the model the code, not only the finding

An end-to-end run on December 28, 2025, showed what a fix model does with too little to go on. The scan worked. The fixes did not: they were generic example code, not patches to the code that was there, and the model’s confidence scores did not reflect their quality.

So the prompt changed. The model now gets the code around the finding, the imports, and the enclosing function, with rules to make the smallest fix that solves the problem, and examples of what that looks like. A check flags a fix that brings in framework code the original file does not use. The issue closed at the turn of the year. A review step that filters weak fixes before a person sees them was the next idea from that run; it is not built.

A local model writes the fixes

The fix model runs on our own infrastructure. A fix costs nothing per call, and the code does not leave the network. Since October 2026, those calls go through the job manager. A generator for the Anthropic API is written but not switched on.

Sweep mode

In March 2026 I tried a different idea inside the same project: the autoresearch loop, applied to code quality. Each iteration, a coding model makes exactly one focused change. FixBot measures the project before and after with its own tests, type check, and lint. If anything gets worse, the change is reverted. If nothing gets worse, it is committed.

The loop runs in phases: correctness first (failing tests, type errors, a broken build), then cleanliness (lint, unused imports), then simplicity (dead code, complexity). It moves on or stops when several iterations in a row change nothing, waits between iterations, and has a time budget and a cost budget. The cost budget uses an estimate in the code, not measured spend. Sweep commits to a branch and never opens a merge request; a person reads the branch.

It was written in March and merged on October 16, 2026. Between March 12 and 15, 2026, it made forty-nine committed changes across six repositories. On FixBot’s own code, one ten-iteration run kept two changes, both cleanups that left the score unchanged, and found nothing to change the other eight times.

How it’s built

  • TypeScript, with Bun for development and a Node 22 image, pinned by digest, in production.
  • PostgreSQL through TypeORM for state and the audit log; Redis and BullMQ for the queue.
  • Semgrep and a custom secrets scanner; Docker for the test sandbox.
  • A local code model, called through the job manager.
  • Built spec first: the specification, clarifications, plan, and task list were written on December 20, 2025, and the core components the next day.

In October 2026 we moved FixBot off an end-of-life Node version. Before the rebuild, I chose to commit the changes in the running copy to the repository first, so a rebuild from a pinned commit equals what ran, plus the Node 22 change. From October 28, 2026, the service was deployed from the infrastructure repository at that commit.

Where it stands

FixBot has forty commits and three merged merge requests, up to October 27, 2026. It has one end-to-end run on record, and no recorded merge request of its own that was merged. The open issues include dependency scanning, a test environment that handles TypeScript projects, and code-smell scanning. In the fix pipeline today, no code path merges: a person does.

About the author

Carlos Mendez

Carlos Mendez

IT support and systems, Maui, Hawaii

I come from IT support and systems work. I build and run my own infrastructure and the production websites for West Maui Tech, my business, and I build AI tooling on top of that stack. I write here about what I run, what broke, and how I fixed it.