Trailmark variant neighborhood

From trailofbits/skills · View interactive version

Trailmark variant neighborhood is an AI agent skill from the GitHub repository trailofbits/skills. Expands one confirmed or suspected vulnerability into a Trailmark graph neighborhood of variant candidates by finding sibling functions, shared callers and callees, common sensitive sinks, common entrypoint paths, interface implementations, override relationships, type/reference neighbors, and struc

How to use this skill

Skill file

Trailmark Variant Neighborhood

Expand one seed issue into graph-derived variant candidates. This skill

generates review targets, not confirmed findings.

When to Use

trait, hook, handler, adapter, or critical type

static-analysis, or manual review

When NOT to Use

semgrep-rule-creator directly.

composition workflow.

Rationalizations to Reject

| Rationalization | Why It Is Wrong | Required Action |

|---|---|---|

| "Nearby code means variant" | Proximity is only a candidate reason | Rank it as a review target |

| "Only exact same names matter" | Variants often share sinks or preconditions, not names | Expand across callers, callees, interfaces, and types |

| "Every candidate is a finding" | This skill outputs candidates for review | Avoid vulnerability claims |

| "Unreachable candidates can be ignored completely" | They may become reachable after refactors | Rank lower or list as deferred |

| "Graph candidates replace semantic pattern work" | Graph structure finds locations, not root-cause semantics | Hand off to variant-analysis, Semgrep, CodeQL, or manual review |

Workflow

Variant Neighborhood Progress:
- [ ] Step 1: Normalize and bind the seed
- [ ] Step 2: Expand graph neighborhoods
- [ ] Step 3: Rank candidates
- [ ] Step 4: Extract variant pattern guidance
- [ ] Step 5: Emit handoff packet

Step 1: Normalize And Bind The Seed

Accept finding text, file/line, function name, or output from

trailmark-finding-triage. Bind the seed to a Trailmark node and record the

root cause in plain language.

If the seed has no concrete graph binding, stop before inventing variants.

Step 2: Expand Neighborhoods

Use the dimensions in

references/neighborhood-patterns.md:

Bound expansion to avoid candidate floods.

Step 3: Rank Candidates

Rank with references/ranking.md. Prioritize

entrypoint-reachable, tainted, boundary-adjacent, high-blast-radius, shared

sink, same-interface, and close-distance candidates. Penalize test, mock,

generated, vendor, unreachable, and trusted-internal-only candidates.

Step 4: Extract Pattern Guidance

Summarize what should be searched for syntactically and what requires semantic

review. Identify whether follow-up belongs in:

Step 5: Emit Handoff Packet

Use references/output-format.md. Include

ranked candidates, inclusion reasons, exclusions, limitations, and the

variant-analysis handoff.

Stop Conditions

that code is in scope

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.