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:
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:
{"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.
| Model | Easy 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.5 | 8, 8 | 8, 8 | 0, 1 |
| OpenAI Sol | 8, 8 | 8, 8 | 1, 1 |
| DeepSeek V4.1 Flash | 8, 8 | 8, 8 | 1, 1 |
| MiniMax M4 | 8, 8 | 8, 8 | 3, 3 |
| Kimi K3.1 Pro | 8, 8 | 7, 7 | 0, 0 |
| Gemini Neon | 8, 8 | 0, 0 | 0, 0 |
| GLM 5.4 | 0, 0 | 0 (one run) | 0 |

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.

| Model | Patches verified by Mantis | Tokens | Model calls | Time |
|---|---|---|---|---|
| DeepSeek V4.1 Flash (rebuilt image) | 8, plus 1 incomplete | 1,316,000 | 121 | 12 min 5 s |
| DeepSeek V4.1 Flash (stock image) | 8 | 693,840 | 81 | 6 min 24 s |
| MiniMax M4 | 10, plus 1 incomplete | 1,156,976 | 117 | 27 min 18 s |
| Kimi K3.1 Pro | 0 | 232,141 | 37 | 8 min 53 s |
| Gemini Neon | 0 | 172,894 | 30 | 10 min 1 s |
| Claude Opus 5.5 | 0 | 151,924 | 28 | 4 min 32 s |
| OpenAI Sol | 0 | 109,069 | 38 | 2 min 33 s |
| GLM 5.4 | 0 | 83,022 | 22 | 5 min 47 s |
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.
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.


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.



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.


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.




