google/mantis
A modular, stack-agnostic toolkit for AI coding agents to autonomously find, reproduce, and patch vulnerabilities.
Mantis – AI‑powered toolkit for automated security reviews
What it is – Mantis is a collection of skills (plug‑in modules) and an ADK‑based reference harness that lets you run AI‑driven vulnerability‑finding campaigns against a codebase. It orchestrates large language models (LLMs) to read source, build threat models, generate test exploits, and even suggest patches, all inside a sandboxed workflow.
How it works
- Setup – Install a Python virtual‑env, run the provided
install.sh, and (optionally) authenticate to Google Cloud if you want to use Vertex AI models. - Configuration –
scripts/configure.pyauto‑detects capabilities (model access, hardware, budget) and validates connectivity. - Launch –
run.sh <path>starts a review campaign:- Scans the repository history for past bugs.
- Builds a semantic index of the code for fast navigation.
- Generates a threat model and a list of research hypotheses.
- Executes those hypotheses with LLM‑driven agents, deduplicates results, and tries to reproduce findings (static analysis → unit‑test‑style exploits → mock‑server attacks).
- Optionally runs a graph synthesis step to create custom agent topologies for a specific objective (e.g., “audit for SSRF”).
- Feedback loop – Findings are critiqued, calibrated against a severity rubric, and, if desired, the system attempts to auto‑patch and re‑verify the fix.
- Advice – The
/mantis‑adviseskill can be invoked to get AI‑generated secure‑coding suggestions for new development.
Key features
- End‑to‑end AI workflow: from code ingestion to exploit reproduction and patch suggestion.
- Pluggable “skills” that can be adapted to domains such as hardware RTL, IaC, ML pipelines, or firmware.
- Parallel campaign execution with a shared SQLite DB (configurable lock timeout).
- Budget controls (
--no-budget) and sandbox examples for safe execution. - Ability to focus scans with natural‑language prompts (
--focus "look for IDOR"). - Graph‑based research synthesis for custom security objectives.
Intended use cases
- Security teams that want to augment manual code reviews with AI‑generated hypotheses.
- Organizations looking to automatically audit legacy codebases for forgotten vulnerabilities.
- Developers seeking AI‑driven guidance on writing more secure code.
- Research labs experimenting with LLM‑based vulnerability discovery pipelines.
Safety & limitations
- Highly experimental – the README repeatedly warns: run only in isolated, restricted environments; never on production systems or data.
- Non‑deterministic models – LLMs can hallucinate findings or generate incorrect patches; every output must be manually verified by a security expert.
- No official Google support – this is a demonstration project, not covered by Google’s open‑source vulnerability‑reward program.
- Resource‑intensive – large models (e.g., Vertex AI) may incur significant compute costs; budget flags are provided to limit spend.
- Sandbox reliability – while example sandboxes are included, users are encouraged to add additional monitoring to guard against escape attempts.
Getting started
# Install the virtual environment and dependencies
cd reference && ./install.sh
# Authenticate if you plan to use Vertex AI
gcloud auth application-default login
# Auto‑configure the environment
python3 scripts/configure.py --auto
# Run a quick pre‑flight test
python3 scripts/configure.py --test --probe
# Launch a review on a repo or file
./run.sh path/to/code
Bottom line – Mantis is a proof‑of‑concept platform that showcases how LLMs can be orchestrated to perform deep, automated security analysis of software. It is powerful for research and controlled internal audits, but it must be used with extreme caution and thorough human oversight.
Related
- Project
- Project
- Project
- Project
- Project