Security Autofix Agents Need Fix Lineage
By wGrow Project Team ·
The Trust Deficit in Autonomous Security Patches

GitHub’s Autofix and Google’s CodeMender have pushed vulnerability remediation past the suggestion stage. Autofix generates a concrete fix from a code-scanning alert; CodeMender goes further, running an agent that investigates the vulnerability and prepares a patch for review. That’s a genuine capability jump from the old static-analysis suggestion box. It’s also where the real problem starts.
Here’s the trouble: a maintainer staring at a ten-line diff generated by an agent has nothing to anchor trust to. A diff tells you what changed. It doesn’t tell you what the agent broke, what it ignored, or what it misunderstood on the way to that change. We review code by estimating risk, and risk estimation depends on provenance. When a human writes a patch, provenance comes from reputation, prior commits, a shared mental model of the system built up over months of working together. When a machine writes it, none of that exists by default — there’s no track record to draw on. So the remediation workflow shifts underneath us. Writing the fix stops being the bottleneck. Proving the fix is safe to merge becomes the bottleneck instead.
That gap matters more once autofix agents start running at volume. A single CVE alert triggering a single PR is manageable — a maintainer can sit down and read it carefully once. A pipeline generating dozens of these a week, across a portfolio of repos, cannot be reviewed the same way. At that point the review process itself needs structure, not just goodwill from whoever drew the short straw.
Why We Cannot Review Agent Code Like Human Code
Human code review runs on assumed shared context. When a senior developer opens a PR, the reviewer assumes that developer understands the architecture, has internalized the team’s conventions, and made trade-offs the reviewer would broadly recognize even if they’d have made them differently. That assumption is what makes a quick skim of a diff a reasonable review in most shops.
Agents don’t get that assumption — because it isn’t true of them. A typical autofix agent can’t be credited with the same durable, embodied system knowledge a long-tenured maintainer has. Even with a repo index, retrieved memory, or prior run logs on hand, its working model of the codebase is assembled fresh each run — from retrieved context, tool calls, and whatever files it inspects that time around. It doesn’t “know” the system the way an engineer with two years of tenure does, and reviewers need evidence of that assembly, not just the diff it produces.
That changes what review actually has to verify. It can’t just evaluate the diff — the output. It has to evaluate the investigation: the traversal through the codebase that produced the output. A standard git diff strips that traversal out entirely. It shows you the destination and deletes the map. If a reviewer can’t see which files the agent considered and rejected, there’s no way to tell “the agent understood the blast radius and scoped the fix correctly” apart from “the agent got lucky and stopped looking too early.”
Invisible Side-Effects During Legacy Migrations
- Evaluated & discarded
- Modified in diff
We ran into this directly — not on a security autofix pipeline, but on a legacy migration one, where the underlying mechanics turned out to be nearly identical. We’d deployed an internal agent crew to move a legacy PHP codebase to Python, aiming for high-volume autonomous refactoring rather than a manual line-by-line port.
The review bottleneck showed up almost immediately. In one run, the agent read through 14 files to resolve a single dependency chain — chasing an import, then a config loader, then a shared utility, then back up through three call sites — before deciding the actual fix only required touching two of them. The resulting PR diff showed exactly two modified files. It showed nothing about the other 12.
That’s an invisible side-effect problem, not a correctness problem. The two-file patch may well have been correct. But the reviewer had no way to confirm the agent had correctly ruled out the other 12 files, versus simply not gotten to them, misjudged them, or hit a context window limit and moved on. Reconstructing that judgment after the fact — opening each of the 12 files, working out why they weren’t touched, checking whether the reasoning held up — took the reviewer longer, in this case, than writing the migration by hand would have. An agent that shows only its final answer forces the human to redo the whole investigation from scratch just to trust it. Which defeats the point of automating the investigation in the first place.
Structuring the Lineage for Gov-Linked Portals
We see a stricter version of the same problem on gov-linked SME portal work, where vulnerability remediation sits under a compliance audit trail, not just an engineering norm. When CodeQL or an equivalent scanner flags a CVE on that kind of codebase, a raw AI-generated patch is a liability, not a convenience. You can’t merge it on the strength of “the tests pass.”
Our position — enforced before a human reviewer is even assigned — is that the PR carries five artifacts or it doesn’t get looked at:
- The original alert and raw evidence — the scanner output, not a paraphrase of it.
- Root cause analysis mapped to the specific codebase — not a generic description of the CVE class, but where and why this instance of it exists in this code.
- The agent’s search space — every file it read before it wrote the patch, not just the files it changed.
- CI validation logs showing the relevant security check or reproduction no longer fails, and that the existing test suite still passes.
- A residual risk statement — the edge cases the patch does not cover, stated explicitly rather than implied by silence.
Miss the search space or the validation logs, and the pipeline rejects the PR automatically — before a human spends a minute on it. This adds friction to every PR, agent-generated or not; trivial patches get slowed down right alongside the ones that actually need scrutiny. But on a compliance-bound system, that overhead isn’t optional to skip. It’s the same lesson from the PHP migration crew, just formalized: a patch without its investigation attached costs the reviewer more time than it saves.
The State-Space Traversal Log as the New Standard

Autonomous remediation is likely to hit a trust ceiling in enterprise settings well before it hits a technical one. Tools like GitHub Autofix and CodeMender will scale to production volume only if they solve the review bottleneck as deliberately as they’re already attacking patch generation.
Generating a correct patch is half the job. Proving it’s correct to a human who didn’t do the investigation is the other half — and right now it’s the half most agentic tooling treats as an afterthought. The industry default needs to move past the git diff as the unit of review. Agentic platforms need to emit a state-space traversal log natively: what was read, what was ruled out, and why, as a first-class artifact alongside the patch — not something a reviewer reconstructs by hand after the fact. That log isn’t a complete fix on its own, either. It’s only as trustworthy as the agent’s own account of its process, which is exactly why it needs corroboration from independent CI validation rather than being taken at face value.
Maintainers need to see what the agent decided not to change, as much as what it did. Without that, an autonomous security patch isn’t remediation. It’s technical debt wearing a green CI checkmark.