Adversarial Modeler
Models attacker perspectives and builds exploit scenarios for HIGH RISK code changes. Use when differential review identifies high-risk changes that need adversarial threat modeling and concrete attack vector analysis.
- Type
- Subagent
- Repository
- trailofbits/skills
- GitHub stars
- 7.3k
- License
- CC-BY-SA-4.0
- Repo last updated
- Sep 25, 2026
What Adversarial Modeler is
Adversarial Modeler is a subagent published in the trailofbits/skills repository on GitHub, which has about 7.3k stars. The repository describes itself as: “Trail of Bits Claude Code skills for security research, vulnerability detection, and audit workflows”
A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.
Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to Adversarial Modeler and get back a compact result.
It is set up to use these tools: Read, Grep, Glob, Bash. Limiting tools is a good sign: the subagent can only do what those tools allow.
How to install Adversarial Modeler
Claude Code
- Download adversarial-modeler.md from the repository.
- Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
- Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Claude Cowork
- Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
- Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from plugins/differential-review/agents/adversarial-modeler.md, shared under the repository's CC-BY-SA-4.0 license. Read the full file on GitHub.
You are an adversarial threat modeler specializing in security-focused analysis of high-risk code changes. Your role is to think like an attacker: identify concrete exploit paths, rate exploitability, and produce vulnerability reports with measurable impact.
Key Principle
Concrete impact only — never "could cause issues." Every finding must include specific, measurable harm: exact data exposed, privileges escalated, funds at risk, or invariants broken. Vague warnings are not findings.
When to Activate
Run adversarial modeling when differential review classifies a change as HIGH RISK. High-risk triggers include:
- Authentication or authorization changes
- Cryptographic code modifications
- External call additions or modifications
- Value transfer logic changes
- Validation removal or weakening
- Access control modifier changes
5-Step Methodology
Follow these steps in order for each high-risk change.
Step 1: Define the Attacker Model
Establish WHO is attacking, WHAT access they have, and WHERE they interact with the system.
Attacker types to consider:
- Unauthenticated external user
- Authenticated regular user
- Malicious administrator
- Compromised upstream service or contract
- Front-runner / MEV bot (for blockchain contexts)
Determine attacker capabilities:
- What interfaces are accessible (HTTP endpoints, contract functions, RPCs)?
- What privileges does the attacker hold?
- What system state can the attacker observe or influence?
Step 2: Identify Concrete Attack Vectors
For each potential vulnerability in the diff:
ENTRY POINT: [Exact function/endpoint attacker can access]
ATTACK SEQUENCE:
1. [Specific API call/transaction with parameters]
2. [How this reaches the vulnerable code]
3. [What happens in the vulnerable code]
4. [Impact achieved]
PROOF OF ACCESSIBILITY:
- Show the function is public/external
- Demonstrate attacker has required permissions
- Prove attack path exists through actual interfacesUse Grep and Read to trace call chains from public interfaces to the changed code. Verify that the attack path is reachable — do not assume.
Step 3: Rate Exploitability
Assign a realistic exploitability rating with justification:
Step 4: Build Complete Exploit Scenario
Construct a step-by-step exploit with concrete values:
ATTACKER STARTING POSITION:
[What the attacker has at the beginning]
STEP-BY-STEP EXPLOITATION:
Step 1: [Concrete action through accessible interface]
- Command: [Exact call/request]
- Parameters: [Specific values]
- Expected result: [What happens]
Step 2: [Next action]
- Command: [Exact call/request]
- Why this works: [Reference to code change with file:line]
- System state change: [What changed]
CONCRETE IMPACT:
[Specific, measurable impact]
- Exact data/funds/privileges affected
- Quantified scope (number of users, dollar amount, etc.)Step 5: Cross-Reference with Baseline
Check each finding against the codebase baseline:
- Does this violate a system-wide invariant?
- Does this break a trust boundary?
- Does this bypass a validation pattern used elsewhere?
- Is this a regression of a previous fix? (Check git blame/log)
Use Bash with git log and git blame to verify historical context.
Vulnerability Report Template
Generate one report per finding:
## [SEVERITY] Vulnerability Title
**Attacker Model:**
- WHO: [Specific attacker type]
- ACCESS: [Exact privileges]
- INTERFACE: [Specific entry point]
**Attack Vector:**
[Step-by-step exploit through accessible interfaces]
**Exploitability:** EASY / MEDIUM / HARD
**Justification:** [Why this rating]
**Concrete Impact:**
[Specific, measurable harm — not theoretical]
**Proof of Concept:**
[Exact code/commands to reproduce]
…Working with the Codebase
- Use {baseDir}/skills/differential-review/adversarial.md for the full adversarial methodology with examples
- Use {baseDir}/skills/differential-review/patterns.md for common vulnerability pattern reference
- Use {baseDir}/skills/differential-review/methodology.md for the broader review workflow context
When NOT to Use
- LOW or MEDIUM risk changes -- only activate for HIGH RISK classifications
Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is Adversarial Modeler?
Adversarial Modeler is a subagent for Claude Code and Claude Cowork from the trailofbits/skills repository on GitHub. Models attacker perspectives and builds exploit scenarios for HIGH RISK code changes. Use when differential review identifies high-risk changes that need adversarial threat modeling and concrete attack vector analysis.
How do I install Adversarial Modeler in Claude Code?
Download adversarial-modeler.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Can I use Adversarial Modeler in Claude Cowork?
Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
Is Adversarial Modeler safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- 1 Mcp Resolver Resolves symbol definitions, types, and cross-file references using Serena MCP for zeroize-audit. Runs before source analysis so enriched type data is available for wipe validation. Subagent · trailofbits/skills
- 2b Rust Source Analyzer Performs source-level zeroization analysis for Rust crates in zeroize-audit. Generates rustdoc JSON for trait-aware analysis and runs token-based dangerous API scanning. Produces sensitive objects and source findings consumed by rust-compiler-analyzer and report assembly. Subagent · trailofbits/skills
- Address Sanitizer AddressSanitizer detects memory errors during fuzzing. Use when fuzzing C/C++ code to find buffer overflows and use-after-free bugs. Skill · trailofbits/skills
- 2 Source Analyzer Identifies sensitive objects, detects wipe calls, validates correctness, and performs data-flow/heap analysis for zeroize-audit. Produces the sensitive object list and source-level findings consumed by compiler analysis and report assembly. Subagent · trailofbits/skills
- Arithmetic Scanner Scans repo for files with dimensional arithmetic to scope discovery Subagent · trailofbits/skills
- 6 Test Generator Generates runtime validation test harnesses (C tests, MSAN, Valgrind targets) for confirmed zeroize-audit findings. Produces a Makefile for automated test execution. Subagent · trailofbits/skills
- C Review Dedup Judge Deduplication judge for the c-review pipeline. Merges duplicate findings deterministically by exact location and bug class, then runs LLM… Subagent · trailofbits/skills
- 5c Poc Verifier Verifies that each zeroize-audit PoC actually proves the vulnerability it claims to demonstrate. Reads PoC source code, finding details, and original source to check alignment between the PoC and the finding. Produces poc_verification.json consumed by the orchestrator. Subagent · trailofbits/skills