Google's AI Bug Hunter CodeMender Scans, Confirms, and Fixes Security Flaws
A new AI security agent just landed that does the thing every previous scanner avoided: it writes the patch. Google's CodeMender, in preview now, is the first agent I'd actually wire into a CI pipeline that ships a diff I can read — not an alert I have to triage.
That sounds like a small distinction. It isn't. Every static scanner I've used ends the same way — a flood of findings, a CSV export, a Slack thread, and three engineers who "own" the file quietly closing the tab. The reason is structural: scanners detect, humans patch, and humans are slower than the attackers the scanner is racing against. CodeMender's bet is that the loop closes in the agent. Scan, prove it's exploitable, write the fix, hand a diff to a human. If that loop holds, defender cycle time stops being the bottleneck.
Here's what's actually new under the hood, how to point it at a repo today, and the part that doesn't change when the model does.
What CodeMender actually is
CodeMender is an AI agent built on Google's Gemini models, fine-tuned continuously with the latest Google DeepMind research — agent skills, security tools, and system prompts all rolling forward as the lab publishes. It runs inside Gemini Enterprise Agent Platform and ships as a component of AI Threat Defense, Google's AI-powered security platform.
Three things in that sentence matter:
- Two access paths. Enterprises reach it through the Gemini Enterprise Agent Platform, or as a built-in capability inside AI Threat Defense. Pick the surface that fits your security org's procurement.
- A separately gated tier. A version paired with Gemini 3.5 Flash Cyber is restricted, per Google, to a small number of governments and trusted partners. That's a real constraint on availability, not marketing — budget the access review accordingly.
- Pluggable models later. Third-party frontier model support arrives later this year. The agent harness is the durable bit; the model underneath is meant to be swappable.
The three-stage workflow
The agent runs in three explicit stages. Knowing the shape lets you reason about where it can fail.
scan verify patch
repo → PoC exploit in → patch diff +
candidates customer sandbox judge reviewStage 1 — Scan. CodeMender reads the repository and looks for vulnerabilities that static tools commonly miss. The categories Google calls out: memory corruption, injection flaws, web security issues, cryptographic weaknesses, and insecure data handling. Languages are C/C++, Go, Java, Python, Ruby, Rust, and TypeScript — the universe it reasons over natively.
Stage 2 — Verify. Instead of trusting the static hit, CodeMender builds a proof-of-concept exploit and runs it in a sandbox the customer controls. This is the part that genuinely impressed me. A finding that survives a PoC in your own environment is a finding worth a triage ticket. Everything else is noise — and noise is what kills scanner adoption.
Stage 3 — Patch. Once a flaw is confirmed, the agent writes a patch and has a model acting as judge double-check that the fix doesn't break something else in the application. The output is a code diff handed to a developer. Google is explicit: no change reaches the repository without a human in the loop.

11 production screens. Login, database, payments — all wired.
The SaaS Dashboard Kit ships everything already connected. Nothing to set up. Live demo at saas.otf-kit.dev.
How to put it in a real pipeline
You don't get a CLI to run yet. You get an agent that surfaces diffs through Google's enterprise surfaces. The shape of integration looks like this:
# .github/workflows/codemender-review.yml
# illustrative — adapt to the surfaces your team has access to
name: codemender-review
on:
pull_request:
types: [opened, synchronize]
jobs:
agent-review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: trigger codemender scan
run: |
# surface the repo state to the agent through your
# Gemini Enterprise Agent Platform or AI Threat Defense connector
gcloud ai agents invoke codemender \
--repo="${GITHUB_REPOSITORY}" \
--ref="${GITHUB_SHA}" \
--languages=c,cpp,go,java,python,ruby,rust,typescript \
--sandbox="${CODEMENDER_SANDBOX_ID}"
- name: post verified diff
# the agent only emits diffs for vulns whose PoC ran in the sandbox
run: gcloud ai agents diff codemender --pr="${PR_NUMBER}"The wiring point that matters is --sandbox. The verification step runs in a sandbox the customer controls, so the PoC never executes against production-shaped data and the agent's reasoning stays inside your boundary.
A typical daily loop:
// pseudo: how the diff lands with the developer
type CodeMenderFinding = {
id: string
file: string
line: number
vulnClass:
| "memory-corruption"
| "injection"
| "web-security"
| "crypto-weakness"
| "insecure-data-handling"
pocSandboxRun: { id: string; result: "exploited" | "benign" }
patchDiff: string // unified diff, no auto-merge
judgeReview: { ok: boolean; notes: string }
}
// the developer reviews the diff like any other PR — agent never writes to mainThree practical habits when you turn it on:
- Tighten the language set first. Don't scan a polyglot monorepo on day one. Pick the repo with the worst static-scanner noise floor and let CodeMender prove the false-positive rate on it. Expand once you've calibrated.
- Treat the diff like any other PR. The agent's output is a unified diff with a judge's notes attached. Review it the way you'd review a junior engineer's patch — accept, request changes, reject. Don't merge blindly, don't ignore it.
- Wire the sandbox before the scanner. The verification stage is the load-bearing part of the value prop. If your sandbox isn't isolated, the agent has nothing useful to tell you.
The security posture underneath
CodeMender runs inside what Google calls a secure-by-design Agent Platform. The specifics that matter to a security team:
- Traffic routes through your VPC. The agent doesn't talk to the public internet from inside your perimeter; egress stays inside the VPC.
- Data isolation and encryption. Repositories are processed under your tenant boundary; the agent doesn't share state across customers.
- Zero retention of source code data. Source code isn't retained after the run.
For most enterprises that's the table-stakes checklist, not a differentiator. But it's also the reason the agent is allowed inside regulated environments in the first place. If your security org has been blocking AI tools on data-residency grounds, this is the answer.
What it doesn't replace
Three things the agent isn't trying to be:
- A replacement for human review. The diff lands on a developer. The developer still owns the merge. That's a feature, not a limitation.
- A dependency upgrader. Vulnerable transitive dependencies are out of scope here. Pair CodeMender with a SCA tool for that layer.
- A legacy-system migration path. If your codebase lacks tests, types, or consistent conventions, the agent has nothing to anchor its patches against. Garbage in, plausible-looking diff out — that's the failure mode to design against.
The part that doesn't change when the model does
Here's the angle that doesn't move with the announcement cycle. CodeMender is one more wave of AI capability landing on top of a codebase — Gemini today, a third-party frontier model later this year, the next thing after that. The thing that determines whether the agent's diff is useful or plausible-looking-but-wrong is the shape of the code underneath it.
A codebase where the same component renders identically on web, iOS, and Android from a single API is a codebase an agent can patch without inventing three different conventions. A consistent design-system contract is the same idea — the agent doesn't get to choose between five button variants because there are five button variants; there is one. When the harness changes underneath, the codebase's surface doesn't.
That, more than any individual scanner launch, is the durable layer. CodeMender writes a patch. The codebase decides whether that patch fits.
What this gets us
If you've ever closed a scanner tab and said "I'll get to that next sprint," the next sprint is finally arriving. CodeMender's three-stage loop — scan, exploit-verify, judge-checked patch — is the closest thing yet to AI security that finishes the job instead of just starting it.
Try it through Gemini Enterprise Agent Platform if you have it, or as a component of AI Threat Defense. Start with one repo, one language, the worst static-noise offender in your tree. Wire the sandbox before you wire the scanner. And treat the diff like a pull request from a junior engineer who happens to be very fast and very literal — review it, ship it, move on.
Ship the product, not the setup.
- 11 production screens — auth, billing, team, analytics, settings
- Real database, payments, and login — all wired on day 1
- AI configs pre-tuned so your agent extends instead of regenerates