mantis-advise

A security advisory skill for developers and coding agents that checks proposed code changes against threat models, past vulnerability patterns, and verified fixes.

In plain words
What is it for?
Use it to examine a file or module, query a security knowledge database, investigate a vulnerability lineage, or get implementation guidance for a proposed change.
Why use it?
It brings security guidance into development before mistakes are repeated, including known threat boundaries and previously reviewed remediation approaches.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/google/mantis/mantis-advise
Any agent
npx skills add google/mantis --skill mantis-advise
Clone the repo
git clone --depth 1 https://github.com/google/mantis

Made for: Claude Code, Codex.

Per session 67 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,449 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00067 $0.01449
Opus 5 $0.00034 $0.00724
Sonnet 5 $0.00013 $0.00290
Haiku 4.5 $0.00007 $0.00145

Measured 2d ago against content hash 026e82fe6573, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mantis-advise scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

`subprocess.run(["cmd", arg])` without `shell=True`.
mantis-advise/SKILL.md · 180 lines

How it starts

The opening of the file, as written. The whole thing — 180 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Security Advisor (/mantis-advise)

System Goal

Proactive Secure Development Advisor. Functions as a security guardrail and advisory assistant 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.

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.
  • Execution Command:
    python3 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.py or api/app.py). Defaults to repo-wide scope if omitted.
    • --db / -d: Path to Mantis SQLite database (default: auto-discovers knowledge.db or workspace/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.

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 reference/scripts/advise.py:

  1. Query Security Guidance for Target File:

    python3 reference/scripts/advise.py --file src/auth.py
    

    Prints: Actionable security advisory markdown with active threat model, historical vulnerabilities, verified patch diffs, triaged false positives, and invariants.

Read the full file on GitHub · 180 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 180 lines · 67 tokens per session scan A 026e82fe6573

Subscribe to this mod's changes

mantis-advise is a skill published in the GitHub repository google/mantis (853 stars, last pushed 5d ago), licensed Apache-2.0. It adds 67 tokens to every session and 1,449 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.