mantis-advise
Skill2.5k starsChanged 15 days agoApache-2.0View on GitHub
Proactive security advisor and architectural remediation assistant for secure code development. Use to query threat models, historical vulnerability lineages, verified patch patterns, triaged false positives, and learned trajectory invariants before code edits or to generate architectural remediation plans for confirmed findings. Don't use for automated multi-pass red-team exploitation or fuzzing.
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 9 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 47
All Mantis knowledge (threat models, historical findings, verified patches, triaged false positives, and learned invariants) lives in the …
- Distinctive: line 94
When running inside an agent harness or Python environment:
- Distinctive: line 123
Before authoring code or refactoring an existing module:
- Distinctive: line 141
When introducing new endpoints, parameters, data parsing, or subprocess execution:
- Distinctive: line 146
Never trust input from external boundaries without canonicalization and strict schema enforcement.
- Distinctive: line 155
Ensure server-side validation even if client-side validation is present.
- Distinctive: line 156
Ensure zero-privilege assumptions (e.g.
- Very specific: line 161
When fixing a reported vulnerability or refactoring a vulnerable component, check the bug's lineage_id via python3 …
- Distinctive: line 164
Ensure the new implementation completely closes all attack vectors demonstrated in prior re-attack verification test suites.
- Distinctive: line 169
When resolving a confirmed security flaw (in pipeline or standalone):
- Very specific: line 181
Do NOT produce superficial point-hacks (e.g.
- Very specific: line 189
Run the finding reproducer (run_sandbox_with_evidence).
- Very specific: line 190
Verify that the attack fails to reach the sink (reattack_status == "failed_to_bypass").
- Distinctive: line 192
Verify that existing functional test suites pass without regression.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Security Advisor & Remediation Engine (/mantis-advise)
System Goal
Proactive Secure Development & Architectural Remediation Engine. Functions as a security guardrail, advisory assistant, and architectural remediator for developers and coding agents. Queries Mantis threat models, historical vulnerability lineages, verified remediation patterns, triaged false positives, and learned trajectory invariants to ensure that new code and refactors are implemented securely from the start, and to synthesize robust architectural remediations for confirmed vulnerabilities.
Command Definition
- Command:
/mantis-advise - Description: Queries security knowledge for a given target file or module, evaluates proposed changes against known threat boundaries, and provides verified secure implementation guidance or architectural remediation plans.
- Execution Command:
python3 "${MANTIS_HOME:-/path/to/mantis}/reference/scripts/advise.py" --file <target_file> [--db knowledge.db] - Arguments (optional):
--file/-f(or--target/-t): Target source file or component path (e.g.src/auth.pyorapi/app.py). Defaults to repo-wide scope if omitted.--remediate/-r: Finding ID, lineage UUID, or file to generate an architectural remediation dossier and verification plan for.--db/-d: Path to Mantis SQLite database (default: auto-discoversknowledge.dborworkspace/knowledge.db).--lineage/-l: Query lifecycle and recurrence for a specific lineage UUID.--signature/-s: Query lifecycle for a specific content signature hash.--json: Emit structured JSON output instead of formatted markdown.--full: Emit unabridged OKF markdown bodies and un-truncated diffs.
How to Fetch Guidance
All Mantis knowledge (threat models, historical findings, verified patches,
triaged false positives, and learned invariants) lives in the SQLite database
(knowledge.db). Do not look for flat files on disk (like learnings.jsonl or
workspace/findings/*.json). Use one of the two execution doors below:
Mechanism 1: CLI Execution (Recommended for Coding Agents)
Coding agents with standard bash access should run advise.py using its
installation-anchored absolute path.
Path Anchoring Requirement (CRITICAL): The advisor script resides within the
Mantis installation directory at reference/scripts/advise.py. You MUST
invoke this script via an absolute path or via $MANTIS_HOME. NEVER execute
python3 reference/scripts/advise.py using a relative path inside the audited
target repository, as untrusted repositories could spoof scripts or cause
command failures.
Query Security Guidance for Target File:
python3 "$MANTIS_HOME/reference/scripts/advise.py" --file src/auth.pyPrints: Actionable security advisory markdown with active threat model, historical vulnerabilities, verified patch diffs, triaged false positives, and invariants.
Query Specific Bug Lineage & Recurrence:
python3 "$MANTIS_HOME/reference/scripts/advise.py" --lineage c3a5e982-1234-5678-9abc-def012345678Machine-Readable JSON:
python3 "$MANTIS_HOME/reference/scripts/advise.py" --file src/auth.py --jsonArchitectural Remediation Dossier for a Finding:
python3 "$MANTIS_HOME/reference/scripts/advise.py" --remediate <finding_id>
Mechanism 2: Python Tool Invocation (Inside Pipeline / Harness)
When running inside an agent harness or Python environment:
from core.database import query_security_guidance
guidance = query_security_guidance(db_path="knowledge.db", filepath="src/auth.py")
print(guidance["guidance_summary"])Or via tool helper:
get_security_guidance(filepath="src/auth.py")Input/Output Contract
- Reads:
knowledge.db(findings,campaign_artifacts,learnings, andrisk_scorestables).- Target source code files (under repository root).
- Writes:
- Structured Security Advisory & Guardrail recommendations formatted for the active developer or coding agent.
Core Advisory Protocols
Protocol 1: Pre-Implementation Security Context Check
Before authoring code or refactoring an existing module:
- Run the Advisor: Execute
python3 "$MANTIS_HOME/reference/scripts/advise.py" --file <target_file>. - Review Advisory Context:
- Trust Boundaries: Identify who interacts with this module (untrusted public internet, authenticated users, internal microservices).
- Historical Pitfalls: Review all vulnerabilities previously confirmed or
reproduced on this file. Pay specific attention to recurring
lineage_idchains. - Verified Safe Idioms: Review verified patch diffs from prior passes
marked
VERIFIED_SECURE. - Triaged False Positives: Review patterns previously classified as false positives to understand intentional design choices and avoid breaking legitimate functionality.
Protocol 2: Trust Boundary Verification
When introducing new endpoints, parameters, data parsing, or subprocess execution:
Input Normalization & Validation:
- Never trust input from external boundaries without canonicalization and strict schema enforcement.
- For file paths: resolve against jail boundaries using strict
os.path.abspathorPath.resolve()checks (startswith(jail_dir)). - For OS command execution: strictly use
shlex.quoteor array-basedsubprocess.run(["cmd", arg])withoutshell=True.
Defense-in-Depth:
- Ensure server-side validation even if client-side validation is present.
- Ensure zero-privilege assumptions (e.g. no unnecessary IAM permissions, bounded execution timeouts).
Protocol 3: Lineage & Recurrence Defense
- When fixing a reported vulnerability or refactoring a vulnerable component,
check the bug's
lineage_idviapython3 "$MANTIS_HOME/reference/scripts/advise.py" --file <target_file>. - Ensure the new implementation completely closes all attack vectors demonstrated in prior re-attack verification test suites.
Protocol 4: Architectural Vulnerability Remediation & Sandbox Verification
When resolving a confirmed security flaw (in pipeline or standalone):
Grounding Context:
- Query
python3 "$MANTIS_HOME/reference/scripts/advise.py" --remediate <finding_id>(orget_security_guidance(filepath=...)). - Extract active OKF Threat Boundaries and Security Invariants.
- Inspect prior verified safe patterns from matching lineage history.
- Query
Architectural Synthesis:
- Do NOT produce superficial point-hacks (e.g.
return None, hardcodedFalse, or commenting out endpoints) that lobotomize functionality. - Refactor root-cause sinks using safe idioms (parameterization, strict bounds, array argv, canonicalized paths).
- Do NOT produce superficial point-hacks (e.g.
Sandbox Verification (INV-1 & INV-2):
- Apply the unified diff patch to the guest workspace (
apply_patch). - Run the finding reproducer (
run_sandbox_with_evidence). - Verify that the attack fails to reach the sink
(
reattack_status == "failed_to_bypass"). - Verify that existing functional test suites pass without regression.
- Apply the unified diff patch to the guest workspace (
Output Format
The Advisor outputs clean, actionable recommendations:
# Security Advisory: <target_file>
### 1. Threat Model & Trust Boundaries
- **Entry Points**: <untrusted network / RPC / CLI>
- **Sensitive Assets**: <credentials, filesystem, tenant data>
### 2. Known Pitfalls & Historical Lineages
- **[CWE-XX] <Title>** (Lineage: `<uuid>`): <How it occurred and how it was resolved>
- **Verified Safe Pattern**:
```python
# Safe implementation idiom3. False Positive Context (Intentional Behavior)
<Pattern>:<Why this pattern is considered safe in this specific architecture>
4. Implementation Checklist
- Validated against path traversal / injection / deserialization.
- Adheres to verified patch patterns.
- Respects trust boundary isolation.
Trending
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Who's talking about google/mantis
- Matheus Battisti“O Google lançou uma ferramenta que caça falhas de segurança com IA (Google Mantis)”YouTube · Jul 30, 2026 · 9.2k views
- ☕ Claude Code Cafe“🔒 コードの脆弱性を AI に探させて再現まで確かめる Google のリポジトリで公開された mantis #claude #claudecode”YouTube · Sep 8, 2026 · 647 views
- o0o0o0o“Your Tests Pass. Is Your Code Safe? Google’s AI Security Agents”YouTube · Sep 30, 2026 · 180 views
- ☕️ Claude Code Cafe“🔒 Let an Agent Find Your Security Flaws and Reproduce Them — mantis #claude #claudecode”YouTube · Sep 9, 2026 · 40 views
- 智用AI“Mantis:85% Token开销削减,AI漏洞扫描怎么做到的? #Shorts”YouTube · Sep 10, 2026 · 26 views
The biggest 5 of 46 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 46
Talked about on GitHub, YouTube and Bluesky (46 times).
On GitHub · 32
- Oct 30, 2026Design sandboxed agentic bug hunting, RCA, and novel vulnerability discovery — combustrrr/code-analysis-dashboard0 reactions
- Oct 30, 2026Epic: governed scanner and agentic analysis expansion — combustrrr/code-analysis-dashboard0 reactions
- Oct 28, 2026[radar-spike] google/mantis skills — sandbox threat-model (no CI gate) — pablontiv/a4s0 reactions
- Oct 27, 2026google 'mantis' — AI 코딩 에이전트용 취약점 자동 발견·재현·패치 툴킷 (10/26, GitHub) — roomedia/ax-trend0 reactions
- Oct 24, 2026agent-skills.github.google.mantis: 0-unstable-2026-10-22 → 0-unstable-2026-10-24 — sudosubin/agents.nix0 reactions
27 more on GitHub
- Oct 23, 2026agent-skills.github.google.mantis: 0-unstable-2026-10-17 → 0-unstable-2026-10-22 — sudosubin/agents.nix0 reactions
- Oct 17, 2026agent-skills.github.google.mantis: 0-unstable-2026-10-16 → 0-unstable-2026-10-17 — sudosubin/agents.nix0 reactions
- Oct 16, 2026agent-skills.github.google.mantis: 0-unstable-2026-10-15 → 0-unstable-2026-10-16 — sudosubin/agents.nix0 reactions
- Oct 15, 2026agent-skills.github.google.mantis: 0-unstable-2026-10-14 → 0-unstable-2026-10-15 — sudosubin/agents.nix0 reactions
- Oct 14, 2026feat: SAST — LLM alert triage of CodeQL and Semgrep findings with human sign-off (PR/CI, Advanced) — sparkgeo/github-actions0 reactions
- Oct 14, 2026agent-skills.github.google.mantis: 0-unstable-2026-10-13 → 0-unstable-2026-10-14 — sudosubin/agents.nix0 reactions
- Oct 13, 2026agent-skills.github.google.mantis: 52093f7 → 49ab993 — sudosubin/agents.nix0 reactions
- Oct 13, 2026agent-skills.github.google.mantis: 0-unstable-2026-10-05 → 0-unstable-2026-10-13 — sudosubin/agents.nix0 reactions
- Oct 5, 2026agent-skills.github.google.mantis: 76bf653 → f671cd8 — sudosubin/agents.nix0 reactions
- Oct 5, 2026agent-skills.github.google.mantis: 0-unstable-2026-10-04 → 0-unstable-2026-10-05 — sudosubin/agents.nix0 reactions
- Oct 5, 2026agent-skills.github.google.mantis: 30447e1 → f5656dd — sudosubin/agents.nix0 reactions
- Oct 5, 2026agent-skills.github.google.mantis: f48a85e → 30447e1 — sudosubin/agents.nix0 reactions
- Oct 4, 2026Update skill: /google-mantis-patch (high risk) — aiskillstore/marketplace0 reactions
- Oct 4, 2026Update skill: /google-mantis-meta-agent (critical risk) — aiskillstore/marketplace0 reactions
- Oct 4, 2026Update skill: /google-mantis-dedupe (high risk) — aiskillstore/marketplace0 reactions
- Oct 4, 2026Update skill: /google-mantis-threat-model (low risk) — aiskillstore/marketplace0 reactions
- Oct 4, 2026Update skill: /google-mantis-history (medium risk) — aiskillstore/marketplace0 reactions
- Oct 4, 2026Update skill: /google-mantis-structural-index (high risk) — aiskillstore/marketplace0 reactions
- Oct 4, 2026Update skill: /google-mantis-calibrate (high risk) — aiskillstore/marketplace0 reactions
- Oct 4, 2026agent-skills.github.google.mantis: 0-unstable-2026-09-28 → 0-unstable-2026-10-04 — sudosubin/agents.nix0 reactions
- Oct 3, 2026agent-skills.github.google.mantis: 0-unstable-2026-09-18 → 0-unstable-2026-09-28 — sudosubin/agents.nix0 reactions
- Sep 27, 2026agent-skills.github.google.mantis: init at 0-unstable-2026-09-18 — sudosubin/agents.nix0 reactions
- Sep 22, 2026fix(rust): patch parameter bounds validation bugs to avoid panic — morrowc/mrtparser0 reactions
- Sep 22, 2026fix(cpp): add minimal bound checks for packet lengths — morrowc/mrtparser0 reactions
- Sep 11, 2026mode — chogng/ash0 reactions
- Jul 27, 2026Integrate Google Mantis Skills as CRSs — ossf/oss-crs0 reactions · 1 comment
- Jul 3, 2026Add Google Mantis — agentic AI security review pipeline — ottosulin/awesome-ai-security0 reactions
On YouTube · 9
- Jul 30, 2026O Google lançou uma ferramenta que caça falhas de segurança com IA (Google Mantis) — Matheus Battisti - Hora de Codar9.2k views · 29 comments
- Sep 8, 2026🔒 コードの脆弱性を AI に探させて再現まで確かめる Google のリポジトリで公開された mantis #claude #claudecode — ☕ Claude Code Cafe647 views
- Sep 30, 2026Your Tests Pass. Is Your Code Safe? Google’s AI Security Agents — o0o0o0o180 views
- Sep 9, 2026🔒 Let an Agent Find Your Security Flaws and Reproduce Them — mantis #claude #claudecode — ☕️ Claude Code Cafe40 views
- Sep 10, 2026Mantis:85% Token开销削减,AI漏洞扫描怎么做到的? #Shorts — 智用AIsays it tested it26 views
4 more on YouTube
- Sep 3, 2026今日のAI実用ニュース4選:Slack・Skills・動画理解・WebGPU【9月3日】 — 毎日最速AIニュース21 views
- Sep 10, 2026Mantis:85% Token开销削减,AI漏洞扫描怎么做到的? — 智用AIsays it tested it19 views
- Jul 15, 2026Developer tools and hidden risk & Enterprise agents need real infrastructure - AI News (Jul 15, 2... — The Automated Daily9 views
- Sep 3, 2026Googleの新Skills「Mantis」公開、本番PCで試すな #Shorts — 毎日最速AIニュース5 views
On Bluesky · 5
- Sep 15, 2026Mantis : toolkit open source de Google pour agents de coding, conçu pour trouver, reproduire et corriger des vulnérabilités de façon… — @camilleroux.com3 likes and reposts · 1 reply
- Oct 1, 2026GitHub - google/mantis: A modular, stack-agnostic toolkit for AI coding agents to autonomously find, reproduce, and patch vulnerabilities.… — @tech-trending.bsky.social1 likes and repost
- Sep 23, 2026#ばばさん通信ダイジェスト 賛否関わらず話題になった/なりそうなものを共有しています。 GitHub - google/mantis: A modular, stack-agnostic toolkit for AI coding agents to autonomously… — @netmarkjp.bsky.social1 likes and repost
- Jul 3, 2026Three repos that are leading our path forward in scaling AppSec workflows: 1. github.com/google/mantis 2. github.com/anthropics/d... 3.… — @javanrasokat.bsky.social1 likes and repost
- Oct 1, 2026🤖 GitHub - google/mantis: A modular, stack-agnostic toolkit for AI coding agents to autonomously find,... 要約:… — @ai-bs-bot.bsky.social0 likes and reposts · 1 reply
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- mantis-configureSkill
- mantis-launchSkill
- mantis-architectureSkill
- mantis-calibrateSkill
- mantis-chainSkill
- mantis-criticSkill
- mantis-dedupeSkill
- mantis-historySkill
- mantis-meta-agentSkill
- mantis-patchSkill
- mantis-pipeline-adapterSkill
- mantis-planSkill
- mantis-reflectSkill
- mantis-reportSkill
- mantis-reproduceSkill
- mantis-researcherSkill
- mantis-reviewSkill
- mantis-structural-indexSkill
- mantis-summarizeSkill
- mantis-threat-modelSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

