Logo von Mantis Advise

Mantis Advise

OrganisationBeliebt
google
mantis-advise

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.

Übersicht

Herausgebergoogle
Repositorymantis
Skill-Namemantis-advise
Sterne
1.6K
Forks
154
Mitgelieferte Dateien
Nur Anweisungen
LizenzApache-2.0
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • In sich abgeschlossen

    Alles, was das Modell braucht, steht in den Anweisungen — keine zusätzlichen Dateien zum Synchronisieren.

  • Open Source

    Von google auf GitHub veröffentlicht. Prüfen Sie vor der Installation die Quelldateien.

Installation

Installieren Sie den KI-Skill Mantis Advise in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner. Dabei liest die App SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/google/mantis/tree/main/mantis-advise
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill hinzufügen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format unterstützt, kann diesen Skill nutzen. Kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/google/mantis.git /tmp/mantis
mkdir -p .claude/skills
cp -r /tmp/mantis/mantis-advise .claude/skills/mantis-advise
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Mantis Advise in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Mantis Advise automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Mantis Advise nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Schlüsseln.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

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:
    bash
    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.py or api/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-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.
    • --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.

  1. Query Security Guidance for Target File:

    bash
    python3 "$MANTIS_HOME/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.

  2. Query Specific Bug Lineage & Recurrence:

    bash
    python3 "$MANTIS_HOME/reference/scripts/advise.py" --lineage c3a5e982-1234-5678-9abc-def012345678
  3. Machine-Readable JSON:

    bash
    python3 "$MANTIS_HOME/reference/scripts/advise.py" --file src/auth.py --json
  4. Architectural Remediation Dossier for a Finding:

    bash
    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:

python
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:

python
get_security_guidance(filepath="src/auth.py")

Input/Output Contract

  • Reads:
    • knowledge.db (findings, campaign_artifacts, learnings, and risk_scores tables).
    • 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:

  1. Run the Advisor: Execute python3 "$MANTIS_HOME/reference/scripts/advise.py" --file <target_file>.
  2. 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_id chains.
    • 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:

  1. 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.abspath or Path.resolve() checks (startswith(jail_dir)).
    • For OS command execution: strictly use shlex.quote or array-based subprocess.run(["cmd", arg]) without shell=True.
  2. 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

  1. When fixing a reported vulnerability or refactoring a vulnerable component, check the bug's lineage_id via python3 "$MANTIS_HOME/reference/scripts/advise.py" --file <target_file>.
  2. 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):

  1. Grounding Context:

    • Query python3 "$MANTIS_HOME/reference/scripts/advise.py" --remediate <finding_id> (or get_security_guidance(filepath=...)).
    • Extract active OKF Threat Boundaries and Security Invariants.
    • Inspect prior verified safe patterns from matching lineage history.
  2. Architectural Synthesis:

    • Do NOT produce superficial point-hacks (e.g. return None, hardcoded False, or commenting out endpoints) that lobotomize functionality.
    • Refactor root-cause sinks using safe idioms (parameterization, strict bounds, array argv, canonicalized paths).
  3. 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.

Output Format

The Advisor outputs clean, actionable recommendations:

markdown
# 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 idiom

3. False Positive Context (Intentional Behavior)

  • :

4. Implementation Checklist

  • Validated against path traversal / injection / deserialization.
  • Adheres to verified patch patterns.
  • Respects trust boundary isolation.

Häufig gestellte Fragen

Was macht der KI-Skill Mantis Advise?

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.

Warum Mantis Advise in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Mantis Advise besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Mantis Advise in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/google/mantis/tree/main/mantis-advise ein. TypingMind liest die Datei SKILL.md und installiert den Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Mantis Advise nutzen?

Jedes Modell, das Sie mit TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Mantis Advise verwenden?

So viele Sie möchten. In TypingMind können Sie Mantis Advise mit jedem Modell verwenden, das Skills unterstützt, etwa mit GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama. Dabei nutzen Sie Ihre eigenen API-Schlüssel.

Ist der KI-Skill Mantis Advise kostenlos?

Ja. Der Skill wird von google auf GitHub unter der Lizenz Apache-2.0 veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: Die Datei SKILL.md enthält den Namen und die Beschreibung des Skills. Hinzu kommen bei Bedarf Skripte, Vorlagen oder Referenzdateien für das Modell. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und kommen daher ohne Server, API-Schlüssel und Laufzeitumgebung aus. Sie funktionieren mit jedem Modell.

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇