AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

variant-analysis

Hunts for the other instances of a bug already found — the variants of one root cause across a codebase. Use immediately after a vulnerability, logic bug, or bad pattern turns up in a specific file and the question becomes where else it occurs, including the bare conversational form ("are there others like this?", "is this the same bug?"). Also for generalizing one known instance into a CodeQL or Semgrep query for its whole pattern family, and for triaging a set of look-alike candidates against a known root cause. Not for initial discovery with no bug in hand.

Original source
trailofbits
License
CC-BY-SA-4.0
Pinned revision
2be6433b39e009cd2b6fd3be1895f6b1faa5af9a

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

This skill also requires local files or dependencies. Remote reading alone may not be enough.

Ask your assistant

Use Agentic Memory skills to read trailofbits--variant-analysis at revision 2be6433b39e009cd2b6fd3be1895f6b1faa5af9a, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 6

resources/variant-report-template.md

Variant Analysis Report

Summary

| Field | Value | |-------|-------| | Original Bug | [BUG_ID / CVE] | | Analysis Date | [DATE] | | Codebase | [REPO/PROJECT] | | Variants Found | [COUNT] |

Original Vulnerability

Root Cause: [e.g., "User input reaches SQL query without parameterization"]

Location: [path/to/file.py:LINE] in function_name()

# Vulnerable code

Search Methodology

| Version | Pattern | Tool | Matches | TP | FP | |---------|---------|------|---------|----|----| | v1 | [exact] | ripgrep | 1 | 1 | 0 | | v2 | [abstract] | semgrep | N | N | N |

Final Pattern:

# Pattern used

Findings

Variant #1: [BRIEF_TITLE]

| Severity | Confidence | Status | |----------|------------|--------| | High | High | Confirmed |

Location: [path/to/file.py:LINE]

# Vulnerable code

Analysis: [Why this is a true/false positive]

Exploitability:

  • [ ] Reachable from external input
  • [ ] User-controlled data
  • [ ] No sanitization

False Positive Patterns

| Pattern | Count | Reason | |---------|-------|--------| | [pattern] | N | [why safe] |

Recommendations

Immediate

  1. Fix variant in [location]

Preventive

  1. Add Semgrep rule to CI
# CI-ready rule