mantis-chain

A security-analysis step that checks whether several separately confirmed weaknesses can be combined into a larger attack.

In plain words
What is it for?
Use it after individual findings have been validated to investigate multi-step attack paths and record possible exploit chains.
Why use it?
Small problems may have greater combined consequences when an attacker can use them in sequence.

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-chain
Any agent
npx skills add google/mantis --skill mantis-chain
Clone the repo
git clone --depth 1 https://github.com/google/mantis

Made for: Claude Code, Codex.

Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,787 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00050 $0.05787
Opus 5 $0.00025 $0.02893
Sonnet 5 $0.00010 $0.01157
Haiku 4.5 $0.00005 $0.00579

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

Security

Grade A, and why

mantis-chain scanned grade A with 0 findings 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

mantis-chain/SKILL.md · 397 lines

How it starts

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

Vulnerability Chainer (/mantis-chain)

System Goal

Exploit Chain Architect. Analyzes isolated, individually-validated security findings and historical knowledge base primitives to identify and construct complex, multi-step exploit chains.

Command Definition

  • Command: /mantis-chain
  • Description: Analyzes individual security findings to identify and construct complex exploit chains.
  • Arguments (all optional; supplied by the orchestrator per the harness lifecycle contract — see schema.json "Non-JSON Contracts"):
    • --snapshot_root / SNAPSHOT_ROOT — the pinned, immutable code snapshot root for this pass. Consumed by Block A.
    • --snapshot_id / SNAPSHOT_ID — the snapshot identity string for this pass. Consumed by Block A (sentinel) and Block B (match check).
    • --state_root — parent directory of workspace/. When absent, defaults to the current directory (Block A step 1c/1d).
    • --target_root — an already-prepared tree that OVERRIDES the snapshot root (rarely used by this stage; honored by Block A step 1a). When NONE of these are passed, Block A falls back to active_snapshot in workspace/.mantis_state.json; if that is absent too, the stage runs MODE-OFF (snapshot_pinned = false) and behaves exactly as today (see Backward-compat).

Input/Output Contract

  • Reads:
    • workspace/findings/ (validated finding JSON files where status is "VALID", and viability is "VIABLE", "CONDITIONAL_VIABLE", or "SAMPLE_OR_TEST").
    • workspace/kb/entities/*.md and workspace/kb/vulnerabilities/*.md (knowledge base primitives).
    • workspace/.mantis_state.json (to track current loop pass).
  • Writes:
    • Net-new exploit chain finding JSON files to workspace/findings/<new_uuid>.json. Original findings are left unmodified.
  • Preconditions:
    • Validated or viable findings must exist in workspace/findings/.
  • Idempotency Guarantee:
    • Before writing a new exploit chain finding, the skill must check existing exploit chain findings by comparing the constituent finding sequence. Scan BOTH the current workspace/findings/ directory AND every archived pass under workspace/archive/findings_pass_*/ AND legacy workspace/archive/loop*_findings/ (all STATE-RELATIVE — never prefix CODE_ROOT). A chain JSON is any finding whose constituent_findings array is present and non-empty. If a chain with the EXACT same ordered constituent sequence already exists in EITHER location, skip creating a duplicate.
    • Signature-keyed idempotency (preferred) — with a code_paths tiebreak: If ALL constituent findings have a signature field, compare the ordered constituent signature sequence (not UUIDs). Treat two chains as the SAME (and skip creating the new one) ONLY IF their ordered signature sequences are equal AND, for each corresponding constituent pair, at least one code_paths entry (line-inclusive, i.e. compared WITH its trailing :line) is identical. If the signature sequences match but any corresponding constituent's code_paths differ, the chains are DISTINCT — create the new chain. (Over-reporting is safe; a signature collision must never suppress a genuinely new exploit chain, because signature strips line numbers and can collide between distinct same-file bugs.)
    • UUID fallback (today's behavior): If ANY constituent finding lacks a signature field, fall back to comparing the ordered constituent UUID sequence exactly as before. This preserves today's behavior for legacy / un-upgraded findings.
    • This archive scan is now fully effective with stable finding signatures: two chains whose constituents share the same signatures are correctly deduplicated across passes. When signatures are absent (legacy findings), the scan remains HARMLESS — it cannot falsely suppress a legitimate new chain (no silent dropped result) and simply prevents exact-UUID re-duplication within a resumed / rerun pass. If the workspace/archive/ directory does not exist, treat the archived set as empty and proceed.

Read the full file on GitHub · 397 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 · 397 lines · 50 tokens per session scan A 0705f2b167e1

Subscribe to this mod's changes

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