Skip to content
Skillpedia
Security8.0k Β· #12674

differential-review

What it does

Performs a security-focused review of a code change, looking at risky areas such as authentication, crypto and value transfer. It is for developers and security reviewers checking a change before it merges.

When to use it

  • βœ“When a reviewer needs a security check of a pull request, commit or diff.
  • βœ“When a team wants to know if a change brings back a bug that was fixed before.
  • βœ“When a reviewer wants to know what else a change could affect.

Skill link

https://github.com/trailofbits/skills/blob/main/plugins/differential-review/skills/differential-review/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/trailofbits/skills/blob/main/plugins/differential-review/skills/differential-review/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œReview this pull request for security problems and tell me what else it could break.”

5 new skills a week. 1 minute to read.

How it works

The skill adjusts depth to the size of the codebase, checks git history for context, counts callers to estimate impact, and checks whether changed code has tests. It produces a markdown report that states its limits.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Differential Security Review

Security-focused code review for PRs, commits, and diffs.

Core Principles

  1. Risk-First: Focus on auth, crypto, value transfer, external calls
  2. Evidence-Based: Every finding backed by git history, line numbers, attack scenarios
  3. Adaptive: Scale to codebase size (SMALL/MEDIUM/LARGE)
  4. Honest: Explicitly state coverage limits and confidence level
  5. Output-Driven: Always generate comprehensive markdown report file

Rationalizations (Do Not Skip)

Rationalization Why It's Wrong Required Action
"Small PR, quick review" Heartbleed was 2 lines Classify by RISK, not size
"I know this codebase" Familiarity breeds blind spots Build explicit baseline context
"Git history takes too long" History reveals regressions Never skip Phase 1
"Blast radius is obvious" You'll miss transitive callers Calculate quantitatively
"No tests = not my problem" Missing tests = elevated risk rating Flag in report, elevate severity
"Just a refactor, no security impact" Refactors break invariants Analyze as HIGH until proven LOW
"I'll explain verbally" No artifact = findings lost Always write report

Quick Reference

Codebase Size Strategy

Codebase Size Strategy Approach
SMALL (<20 files) DEEP Read all deps, full git blame
MEDIUM (20-200) FOCUSED 1-hop deps, priority files
LARGE (200+) SURGICAL Critical paths only

Risk Level Triggers

Risk Level Triggers
HIGH Auth, crypto, external calls, value transfer, validation removal
MEDIUM Business logic, state changes, new public APIs
LOW Comments, tests, UI, logging

Workflow Overview

Pre-Analysis β†’ Phase 0: Triage β†’ Phase 1: Code Analysis β†’ Phase 2: Test Coverage
    ↓              ↓                    ↓                        ↓
Phase 3: Blast Radius β†’ Phase 4: Deep Context β†’ Phase 5: Adversarial β†’ Phase 6: Report

Decision Tree

Starting a review?

β”œβ”€ Need detailed phase-by-phase methodology?
β”‚  └─ Read: methodology.md
β”‚     (Pre-Analysis + Phases 0-4: triage, code analysis, test coverage, blast radius)
β”‚
β”œβ”€ Analyzing HIGH RISK change?
β”‚  β”œβ”€ Read: adversarial.md
β”‚  β”‚  (Phase 5: Attacker modeling, exploit scenarios, exploitability rating)
β”‚  └─ Or delegate to: differential-review:adversarial-modeler agent
β”‚     (Autonomous attacker modeling with concrete exploit scenarios)
β”‚
β”œβ”€ Writing the final report?
β”‚  └─ Read: reporting.md
β”‚     (Phase 6: Report structure, templates, formatting guidelines)
β”‚
β”œβ”€ Looking for specific vulnerability patterns?
β”‚  └─ Read: patterns.md
β”‚     (Regressions, reentrancy, access control, overflow, etc.)
β”‚
└─ Quick triage only?
   └─ Use Quick Reference above, skip detailed docs

Agents

differential-review:adversarial-modeler β€” Models attacker perspectives and builds exploit scenarios for HIGH RISK code changes. Follows the 5-step adversarial methodology (attacker model, attack vectors, exploitability rating, exploit scenario, baseline cross-reference) and produces structured vulnerability reports. Delegate to this agent when Phase 5 analysis is needed on high-risk changes, passing that full namespaced name as subagent_type β€” a bare adversarial-modeler is unregistered and the dispatch fails at runtime.


Quality Checklist

Before delivering:

  • All changed files analyzed
  • Git blame on removed security code
  • Blast radius calculated for HIGH risk
  • Attack scenarios are concrete (not generic)
  • Findings reference specific line numbers + commits
  • Report file generated
  • User notified with summary

Integration

audit-context-building skill:

  • Pre-Analysis: Build baseline context
  • Phase 4: Deep context on HIGH RISK changes

issue-writer skill:

  • Transform findings into formal audit reports
  • Command: issue-writer --input DIFFERENTIAL_REVIEW_REPORT.md --format audit-report

Example Usage

Quick Triage (Small PR)

Input: 5 file PR, 2 HIGH RISK files
Strategy: Use Quick Reference
1. Classify risk level per file (2 HIGH, 3 LOW)
2. Focus on 2 HIGH files only
3. Git blame removed code
4. Generate minimal report
Time: ~30 minutes

Standard Review (Medium Codebase)

Input: 80 files, 12 HIGH RISK changes
Strategy: FOCUSED (see methodolog
FAQ

Is a small change safe to skip?

No. The skill rates changes by risk, not size, since small changes can still cause serious bugs.

What is blast radius?

It means how many other parts of the code depend on the changed code, and the skill counts them.

Will it write a report?

Yes. It always produces a markdown report file.

Details

Original description by the author

Performs security-focused differential review of code changes. Adapts analysis depth to codebase size, uses git blame for context, calculates blast radius by counting callers, checks test coverage of modified code, and generates a markdown report. Use when reviewing a PR, commit, or diff for security vulnerabilities, checking whether a change re-introduces a previously fixed bug, asking what else a change could break, or finding which modified code has no test covering it.

repo: trailofbits/skills

Popularity

GitHub stars
8.0k
Ranking position
#12674
License
CC-BY-SA-4.0
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills