Google Open-Sources Mantis, an AI Harness for Finding and Fixing Software Bugs
Google has open-sourced Mantis, an AI-powered security harness designed to automate vulnerability discovery, triage, reproduction, and patching while using repository context and sandboxed testing.
Xcademia Team
Xcademia Research Team

Artificial intelligence is increasingly being used to discover software vulnerabilities, including by systems that can identify and exploit bugs with limited human assistance. Google says defenders need comparable capabilities to help keep pace.
To support that effort, Google has open-sourced Mantis, a bug finding-and-fixing harness designed to automate several stages of vulnerability analysis, including discovery, triage, reproduction, and patching.
Google describes Mantis as part of its internal approach to finding and fixing vulnerabilities at machine-speed. The framework is designed to provide scalable, context-aware repository analysis.
The company says Mantis is available as an open-source framework, allowing developers and security teams to explore the approach.
Why Google built Mantis
AI models have demonstrated an ability to discover and exploit vulnerabilities with little, if any, human assistance. For defenders, however, simply applying AI to code scanning is not enough.
Google says sloppy AI code scanning can result in hallucinated bugs and weak true-positive rates under 7%.
Mantis is designed around a different approach. The framework combines agentic techniques, including critic and review agents, with sandboxed reproduction of vulnerabilities to provide additional grounding for its findings.
Rather than relying only on an AI model to identify suspicious code, the approach adds steps intended to help determine whether a suspected vulnerability can be reproduced and whether the finding warrants attention.

Mantis uses repository history for security context
A major part of Mantis is its ability to analyze more than the current contents of a code repository.
Google says the framework examines repository history to learn from previous security fixes. It can also automatically build architectural and threat-model documentation, even when those materials are not provided.
This gives the security analysis additional context about the repository and its development history.
The approach is designed to help Mantis understand the structure of a codebase rather than treating individual files as isolated pieces of software.
A hierarchical view of large repositories
Large repositories can create a significant context challenge for AI systems.
Mantis addresses this with a hierarchical security summary tree.
According to Google, the framework condenses information from individual files into directory-level summaries and then into root-level summaries. This creates a layered representation of the repository while preserving important structural information.
Google says this technique reduced token overhead by more than 85%, while preserving critical structural context across massive repositories.
The approach allows Mantis to work with summarized information at different levels of a repository instead of requiring every analysis to process the same volume of raw code.

Sandboxing helps verify vulnerabilities
Mantis does not stop at identifying potential vulnerabilities.
Google says the framework uses sandboxed environments to reproduce vulnerabilities. The company has included sample sandboxing options in the Mantis repository and says organizations can implement their own sandbox to match their workflows.
Sandboxing provides a controlled environment for testing whether a suspected vulnerability can actually be reproduced.
Google also recommends defining clear vulnerability acceptance criteria. These criteria can help establish which findings should be surfaced and provide a basis for determining whether fixes are correct.
This approach is particularly relevant to the problem of false positives in AI-assisted security analysis. A finding generated by an AI system still needs to be evaluated against the organization's requirements and security criteria.

Getting started with Mantis
Google says Mantis is intended to provide an accessible starting point for vulnerability discovery, true-positive filtering, and patching.
The setup begins by cloning the open-source repository locally:
git clone https://github.com/google/mantis.gitDevelopers can then use their preferred coding agent and provide a prompt asking the agent to use the Mantis framework to review a specified codebase.
Google says this exact prompt has been used internally to find real vulnerabilities across its repositories.
The Mantis repository also includes sample sandboxing options. Organizations can implement their own sandbox to match their development and security workflows.
Mantis also supports secure coding
Google's approach does not end with finding existing vulnerabilities.
The company points to a new mantis-advise skill that can use accumulated knowledge to help coding agents write more secure code from the beginning.
This creates a broader security workflow:
Discover vulnerabilities → Understand findings → Reproduce issues → Patch vulnerabilities → Apply accumulated knowledge to future code
The approach connects vulnerability discovery with preventative development practices rather than treating security analysis only as a post-development activity.
Google recommends two practices for AI-driven security
Google highlights two practices for organizations adopting AI-driven vulnerability discovery.
1. Provide the right context
Google says Mantis automatically analyzes commit history and code to build documentation, but human-curated knowledge can further improve the quality of results.
Organizations can provide information about which types of findings matter to their security teams.
Google gives the example of a situation where a user being able to crash their own program would not be considered a bug worth fixing. Providing that information to a scanning pipeline can help prevent such findings from being surfaced unnecessarily.
The broader point is that AI security systems work within the context and criteria provided to them.
2. Build a cyber sandbox with acceptance criteria
Google also recommends creating safe, sandboxed environments where vulnerabilities can be reproduced against clear criteria.
Such environments can help security teams determine whether a finding meets their requirements and whether a proposed fix is correct.
Clear reproduction criteria can therefore provide an additional layer of evidence between an AI-generated finding and a security decision.
What Mantis means for AI-powered application security
Mantis reflects a broader industry shift toward using AI not only to write software, but also to analyze and secure it.
AI agents can assist with vulnerability discovery, but the reliability of their findings remains an important consideration.
Google's approach emphasizes context, verification, and feedback.
Repository history provides historical context. Security summaries provide structural context. Critic and review agents provide additional analysis. Sandboxing provides a controlled environment for vulnerability reproduction. Acceptance criteria help define which findings and fixes meet organizational requirements.
Together, these elements create a workflow designed to make AI-assisted security analysis more grounded.
For enterprises, this could mean that the value of AI security tooling depends not only on the underlying AI model, but also on the processes and controls surrounding it.
A potential vulnerability identified by an AI system still needs to be assessed. Reproduction, organizational context, and acceptance criteria can help security teams determine whether the finding deserves action.
Open source brings the approach beyond Google
Mantis is available as an open-source framework on GitHub, allowing developers and security teams to examine and experiment with Google's approach.
Google says the framework distills decades of cybersecurity expertise across a wide range of codebases.
The company has also included sample sandboxing options in the repository, while allowing organizations to build their own sandboxing environments.
Additional details were not disclosed in the announcement about broader external adoption, deployment numbers, or performance across organizations outside Google.
The bigger picture
AI-assisted vulnerability discovery is becoming an increasingly important part of the software security conversation.
The challenge is not simply generating more security findings. Security teams also need findings that can be evaluated, reproduced, prioritized, and addressed.
Mantis is Google's approach to this problem. The framework combines repository understanding, historical context, agent-based review, vulnerability reproduction, triage, and patching into a single workflow.
The announcement highlights a broader industry shift toward security systems that use AI as part of an evidence-based development process rather than treating AI as a standalone code scanner.
For security and development teams evaluating AI-driven vulnerability discovery, Google's recommendations point to two practical foundations: provide the system with meaningful organizational context and establish a controlled environment where suspected vulnerabilities can be reproduced and fixes can be evaluated.
Mantis is now available as an open-source framework for teams that want to explore this approach.
Source: Google Cloud Blog
About the Author