Sulat.com / Writing on AIMonday, December 7, 2026
Enter →
Agent Engineering/7 December 2026

Google’s Mantis finds bugs far more easily than it proves them

Mantis is Google's open-source toolkit for finding, reproducing and patching security bugs with an AI agent. I ran it with seven models against two Flask apps with planted flaws.

Green jade praying mantis with circuit lines facing a glowing shield and a code window with bug icons
Illustration: Sulat

At a glance

  • Mantis is Google's Apache-2.0 toolkit of 19 skills and a reference harness that lets an AI agent find, reproduce and patch security bugs.
  • Six of seven models found all eight planted bugs on the easy app. On the hard app Opus, Sol, DeepSeek and M4 found all eight, Kimi found seven, and Gemini Neon and GLM 5.4 found none.
  • Only DeepSeek V4.1 Flash and MiniMax M4 got findings through reproduction to a patch Mantis marked verified.
  • DeepSeek's patches blocked all eight of my attacks and normal use still worked. M4's patches blocked seven of eight.
  • GLM 5.4 finished with exit code 0 and the line No vulnerability findings recorded on an app with eight known bugs.
  • The MCP gate blocks edits that touch a function with an open high finding. The pull request scan is untested, and I didn't run it.

Google has open-sourced Mantis, a toolkit that lets an AI coding agent threat-model a codebase, hunt for vulnerabilities, try to reproduce each one in a sandbox and then write a patch. I ran it end to end with seven different models to see which parts of that chain hold up.

Finding bugs is the easy part. Proving an attack and writing a patch that survives a re-attack is where nearly every model dropped out. Disclosure: I’m an OpenAI, Firecrawl and Devin ambassador.

What Mantis is

Mantis has three parts. The skills folder holds 19 skills an agent loads on demand, covering threat modelling, research, review, patching and reporting. The reference folder is a harness built on Google’s Agent Development Kit that runs those skills as a pipeline: a threat model, a planner, a researcher, a reviewer, a critic, a reproducer, a chainer, a patcher, a calibrator, a reflector and a reporter. The action folder is a GitHub Action that scans pull requests. Mantis also exports SARIF and ships an MCP sidecar with a gate that answers pass, review or block on a code change.

Reproducing and patching need somewhere safe to run attack code, so Mantis offers five sandbox modes: static-only, which skips both steps, plus gVisor, microsandbox, GCE and a remote option. It talks to models through LiteLLM, so you can point it at Vertex AI, the Gemini API, Anthropic, OpenAI or any OpenAI-compatible endpoint. It’s Apache 2.0.

The README is blunt about the risks. It says to run Mantis only in isolated environments and to have a security expert verify every finding, and it states plainly that “The pull request scan is untested.” It also says this is not an officially supported Google product.

Where it sits

Mantis isn’t the first agent aimed at this job. Google DeepMind announced CodeMender in October 2025, an agent that finds and patches vulnerabilities, and said it had upstreamed 72 security fixes to open source projects, a figure that comes from DeepMind. Google Cloud now offers it in preview. OpenAI’s Aardvark, announced the same month, builds a threat model of a repository, reproduces issues in a sandbox and attaches a patch to each finding. OpenAI renamed it Codex Security in March 2026. Anthropic ships a /security-review command in Claude Code and a GitHub Action that reviews pull requests.

Each of those is tied to its maker’s model and runs as a product. Mantis is a toolkit you run yourself, with any model, with the source open to read. That makes it a good fit for a bench: the harness stays fixed and the model is the only thing that changes.

What I ran

The box was 4 cores, 16 GB RAM and Ubuntu 24. I wrote two small Flask apps for a made-up help desk company, so no model had seen them before. The first has eight planted bugs: SQL injection, an IDOR on tickets, path traversal, command injection, mass assignment, SSRF, a pickle import and a hard-coded JWT secret. The second is harder, with eight subtler ones: a second-order SQL injection, an SSRF allowlist bypass, predictable password-reset tokens, an unverified JWT, a negative refund, an open redirect, an unsafe YAML load and a comment-deletion authorisation hole. It also carries decoys, code that looks scary but isn’t exploitable as written, such as a zip extraction that CPython already guards.

Seven models got the same job on the same settings: Claude Opus 5.5, OpenAI’s Sol, DeepSeek V4.1 Flash, Kimi K3.1 Pro, Gemini Neon, MiniMax M4 and GLM 5.4. Each did the static review twice on both apps at depth 10. A finding counted only if it landed on the right file and line range of a planted bug, and a live finding on a decoy counted as a false alarm. Then each model got one full run with the gVisor sandbox switched on, so Mantis could try to reproduce and patch.

The command is the same for every model, with the model name and endpoint swapped. This is DeepSeek through the gVisor sandbox:

Code
cd reference
.venv/bin/python3 scripts/configure.py --sandbox gvisor --image mantis-sandbox:latest
./run.sh /tmp/hd --sandbox gvisor \
  --model openai/morph-dsv41flash \
  --api-base https://api.morphllm.com/v1 \
  --depth 10 --db /tmp/hd.db --yes

For gVisor I installed runsc from Google’s apt repository and registered it with Docker with the network switched off:

Code
{"runtimes":{"runsc":{"path":"/usr/local/bin/runsc",
  "runtimeArgs":["--ignore-cgroups","--network=none","--platform=systrap"]}}}

One gotcha: the stock sandbox image has no flask, pyjwt or requests, so DeepSeek’s first run had to stub them to run anything. I kept that run and then rebuilt the image with the three packages added. Every other gVisor run used the rebuilt image.

Finding the bugs

On the easy app, six of seven models found all eight bugs in both runs. GLM 5.4 found none, and I’ll come back to why. The hard app split the field.

ModelEasy app, planted bugs found (run 1, run 2)Hard app, planted bugs found (run 1, run 2)Hard app, decoys flagged (run 1, run 2)
Claude Opus 5.58, 88, 80, 1
OpenAI Sol8, 88, 81, 1
DeepSeek V4.1 Flash8, 88, 81, 1
MiniMax M48, 88, 83, 3
Kimi K3.1 Pro8, 87, 70, 0
Gemini Neon8, 80, 00, 0
GLM 5.40, 00 (one run)0
Static-only runs. GLM 5.4 ran on the hard app once, through OpenRouter.
Bar chart of planted bugs found on the hard app: Opus, Sol, DeepSeek and M4 found 8, Kimi found 7, Neon and GLM found 0
Four models found everything on the hard app. Illustration: Sulat

Opus and Sol found all eight bugs in both runs and barely touched the decoys. Sol did it in about two and a half minutes on roughly 103K tokens, the cheapest run among the models that found everything. DeepSeek also found all eight. Kimi missed the open redirect both times. M4 found all eight but raised the most false alarms: three decoys in both runs, including a critical Zip Slip on an extraction Python already guards.

Gemini Neon found all eight on the easy app, then stopped on the hard one. Both runs ended on a safety finish reason after the planning step and about 11 model calls, before a single finding was recorded.

Proving the attack and patching it

With the sandbox on, the field thinned out fast. Only DeepSeek and M4 got findings through reproduction to a patch that Mantis marked verified. Opus, Sol and Neon scored their findings and wrote reports but never attempted a reproduction. Kimi tried the sandbox, and no finding got past static confirmation. GLM 5.4 produced nothing.

Three-step funnel: 6 of 7 models found the bugs, 2 of 7 proved the attack, 2 of 7 patched and re-tested
Six models found the bugs, and two finished the chain. Illustration: Sulat
ModelPatches verified by MantisTokensModel callsTime
DeepSeek V4.1 Flash (rebuilt image)8, plus 1 incomplete1,316,00012112 min 5 s
DeepSeek V4.1 Flash (stock image)8693,840816 min 24 s
MiniMax M410, plus 1 incomplete1,156,97611727 min 18 s
Kimi K3.1 Pro0232,141378 min 53 s
Gemini Neon0172,8943010 min 1 s
Claude Opus 5.50151,924284 min 32 s
OpenAI Sol0109,069382 min 33 s
GLM 5.4083,022225 min 47 s
One full run per model on the easy app with the gVisor sandbox on.

Proving an attack costs far more than finding one. DeepSeek’s rebuilt-image run used 1.3M tokens against roughly 200K for its static review, and M4’s full run used 1.2M against about 200K to 250K.

“Verified” is Mantis’s own label, so I checked the patches myself. I applied each stored diff to a clean copy of the app, ran a separate set of eight working exploits against it, then ran eight normal-use checks covering register, login, profile, tickets, search, upload and download.

Mantis works through the help desk app inside the sandbox, then I re-run my attacks against the patched copy. All eight fail and normal use still works.

DeepSeek’s patches closed all eight holes and left all eight normal-use checks passing. M4’s patches closed seven. Mass assignment still worked after I applied all eleven of its stored diffs, even though normal use was fine.

Terminal output listing eight exploits that work on the original app and are blocked on the patched app, with 8 of 8 normal checks passing
The same eight attacks, before and after applying DeepSeek’s patches. Screenshot from my run.
Hand-drawn open padlock on the left reading 8 of 8 attacks worked and closed padlock on the right reading 0 of 8 attacks worked
Eight attacks worked before DeepSeek’s patches, none after. Illustration: Sulat

The stored patches aren’t ready to apply as they come out. Every diff lacked a final newline, so patch refused it until I added one. In an earlier DeepSeek run the diffs overlapped, and stacking them broke the app, so I didn’t use that run as proof.

When a model fails quietly

GLM 5.4 sends its investigation plan to Mantis as a block of text instead of structured data. Mantis can’t convert it, so the planner step produces nothing, the rest of the pipeline has nothing to review, and the run exits with code 0 and the line “No vulnerability findings recorded.” I ran it twice on Z.ai’s endpoint and three times through OpenRouter. Every run came back with zero findings.

That’s the failure that worries me. A clean exit and an empty report look like a clean bill of health, and this app had eight known bugs. If you plug a new model into Mantis, plant a bug you know about first and check it gets found.

Four-step chain: model sends plan as plain text, Mantis cannot read it, no investigation runs, report says no findings with exit 0
A plan Mantis can’t read turns into a clean-looking report. Illustration: Sulat
GLM 5.4 and Gemini Neon each finish with an empty report, and GLM’s run still exits cleanly.

The MCP gate

The part of Mantis I’d reach for first is the MCP gate, because it needs no sandbox. It keeps state about open findings and, when an agent proposes a diff, answers PASS, REVIEW or BLOCK with exit codes 0, 1 and 2. It only knows what a scan has recorded, so it needs a scan rooted at the repository and the path-root flag set before it has anything to judge against.

I fed it five diffs after scanning the app. A comment edit passed. A brand-new file went to review because Mantis had never scanned it. An edit to a different function in the file with an open finding went to review. An edit to the vulnerable search function was blocked, and so was a proper fix for the SQL injection, because the finding was still open. After I marked that finding fixed, the same fix dropped to review because of another open finding in the file.

I feed the gate five different changes and it answers pass, review or block for each.
Terminal output of the gate demo listing PASS, REVIEW and BLOCK verdicts with the open finding behind each
The gate’s verdicts, with the open finding behind each one. Screenshot from my run.
Four rows: comment edit passes, new file and other function in same file go to review, touching the buggy function is blocked
The gate is cautious about anything near a known bug. Illustration: Sulat

What I didn’t test

  • The GitHub Action that scans pull requests. The README says it’s untested, and I didn’t run it.
  • The microsandbox, GCE and remote sandbox modes. I used gVisor throughout.
  • Any real codebase. Both apps are small and invented, so the numbers won’t carry over to a large repository.
  • The meta-agent that rewrites the harness, and importing the SARIF output into another tool.
  • Variance beyond two static runs and one full run per model. Results shifted between runs, so read these as small samples.

What I’d do with it

Use the static review with a strong model and treat every finding as a lead to check. Opus and Sol were the cleanest on both apps. Don’t trust a verified patch until you’ve re-attacked it from outside, because Mantis’s own label and my exploit scripts disagreed on M4’s patches. Put the MCP gate in front of an agent that edits code, since it works without a sandbox. And run all of it on an isolated machine, as the README says.

Of the seven, DeepSeek V4.1 Flash was the only one that finished the whole chain from finding to verified patch with all eight attacks blocked, in about six and a half minutes on the stock image.