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.mdCopy 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
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
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
- Risk-First: Focus on auth, crypto, value transfer, external calls
- Evidence-Based: Every finding backed by git history, line numbers, attack scenarios
- Adaptive: Scale to codebase size (SMALL/MEDIUM/LARGE)
- Honest: Explicitly state coverage limits and confidence level
- 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
Comments
- β¦
More skills from this repository
audit-context-building
8.0kHelps your agent learn an unfamiliar codebase before a security review, mapping what each function assumes, guarantees and depends on.
algorand-vulnerability-scanner
8.0kHelps your agent scan Algorand smart contracts, written in TEAL or PyTeal, for 11 common security problems such as rekeying attacks and unchecked fees.
audit-prep-assistant
8.0kHelps your agent get a codebase ready for an outside security review, with static analysis, test coverage, dead-code cleanup and clear documentation.
cairo-vulnerability-scanner
8.0kHelps your agent scan Cairo smart contracts on StarkNet for 6 serious problems, including arithmetic overflow, risky cross-layer messages and signature replay.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.