threat-model
What it does
This skill builds a threat model, which is a map of the ways a system could be attacked. It works from an interview with the app owner, from the code and its past bugs, or both. It is for security teams planning reviews.
When to use it
- βWhen you want to know what could go wrong with an app before looking for bugs.
- βWhen the app owner can answer questions about the system and its risks.
- βWhen there is no owner, and you want a threat model based on the code and past vulnerabilities.
Skill link
https://github.com/anthropics/defending-code-reference-harness/blob/main/.claude/skills/threat-model/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
βCan you build a threat model for my app, based on our code and the questions I answer?β
5 new skills a week. 1 minute to read.
How it works
The agent can interview the app owner with a set of questions, or read the code and past vulnerability reports. It then writes a threat model file for the project.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
threat-model
A threat model answers "what could go wrong with this system, who would do it, and what should we do about it?" independently of whether any specific bug has been found yet. It is the map; vulnerability discovery is the metal detector. A good threat model tells the pipeline where to look and tells triage which findings matter.
Litmus test: If patching one line of code makes an entry disappear, it was
a vulnerability, not a threat. A threat ("attacker achieves RCE via untrusted
media parsing") still stands after every known bug is fixed; a vulnerability
("dr_wav.h:412 doesn't bounds-check chunk_size") does not. This skill
produces threats. Vulnerabilities appear only as evidence that raises a
threat's likelihood score.
Invocation: /threat-model [bootstrap-then-interview|bootstrap|interview] <target-dir> [flags]
Step 0 β Safety preamble (always runs first)
This skill performs static analysis only. It reads source, git history,
and any vulnerability reports the user supplies, and writes a single output
file (<target-dir>/THREAT_MODEL.md). It does not build, execute, fuzz, or
modify the target, and does not make network requests against the target's
infrastructure.
Before proceeding, confirm and state in your first response:
- The target directory exists and is a local checkout you can read.
- You will not execute any code from the target directory.
- If
--vulnspoints at a URL or you are asked to "fetch CVEs", you will query only public advisory databases (NVD, GitHub Security Advisories, the project's own issue tracker) and never the target's live deployment.
If the user asks you to validate a threat by running an exploit, decline and
point them at the vuln-pipeline (README Step 2) instead.
Step 1 β Route to a mode
Parse $ARGUMENTS:
| First token | Route to |
|---|---|
interview |
Read interview.md in this directory and follow it. |
bootstrap |
Read bootstrap.md in this directory and follow it. |
bootstrap-then-interview |
Bootstrap first, then interview seeded from the draft. See below. |
| anything else, or empty | Ask the user: "Is someone who owns or built this system available to answer questions in this session?" Yes and the codebase is checked out β recommend bootstrap-then-interview. Yes but no codebase β interview.md. No β bootstrap.md. |
All modes write the same artifact (THREAT_MODEL.md, schema in schema.md)
so downstream consumers (pipeline recon/judge, verifier agents) do not need
to know which mode produced it.
interview |
bootstrap |
|
|---|---|---|
| Needs | An application owner present in the session | A local checkout; optionally past vulns |
| Method | Four-question framework: conversational walk through what are we working on β what can go wrong β what are we going to do about it β did we do a good job | Five stages: parallel research swarm β synthesize sections 1-3 + vuln table β generalize vulns into threat classes β STRIDE gap-fill β emit |
| Best for | New systems, design reviews, systems where the risk lives in business logic the code doesn't show | Inherited systems, third-party code, OSS dependencies, anything with a CVE history |
| Provenance tag | interview |
bootstrap |
Context durability. Interview mode is multi-turn; tool results from early reads may be evicted before you need them. To stay resilient:
- Do not read
interview.mdorbootstrap.mdin full up front. Read the mode file (or the relevant section of it) at the point you need it, one question or stage at a time. - If a re-read via the Read tool is refused as "file unchanged", the prior
result was evicted; reload with
cat <path>via Bash instead.
Interview backbone (so you can proceed even if interview.md is
unavailable mid-session):
| Q | Question | Fills schema sections |
|---|---|---|
| Q1 | What are we working on? | section 1 context, section 2 assets, section 3 entry points |
| Q2 | What can go wrong? | section 4 threat rows (id, threat, actor, surface, asset) |
| Q3 | What are we going to do about it? | section 4 impact/likelihood/status/controls; section 5 deprioritized; section 8 recommended mitigations |
| Q4 | Did we do a good job? | validate ranking, coverage check, section 6 open questions |
bootstrap-then-interview mode
When the owner is available and the codebase is checked out, this is the recommended path: the owner's time goe
FAQ
What is a threat model?
It is a list of ways an attacker could harm a system, along with how likely each one is and what to do about it.
Does it test the app?
No. The skill only reads the code and reports, and it does not run or change the app.
Where is the result saved?
It writes a threat model markdown file in the target project folder.
Details
Original description by the author
Build a threat model for a target codebase. Three modes: "interview" walks an application owner through the four-question framework and produces a threat model from their answers; "bootstrap" derives a threat model from the code plus past vulnerabilities (CVEs, git history, pentest reports) when no owner is available; "bootstrap-then-interview" chains the two when both owner and codebase are present. All write THREAT_MODEL.md in a shared schema. Use when asked to "threat model", "build a threat model", "map the attack surface", or "what should we be worried about in this codebase".
Popularity
- GitHub stars
- 7.7k
- Ranking position
- #13105
- License
- β
- Updated
- 8/6/2026
Comments
- β¦
More skills from this repository
customize
7.7kHelps your agent adapt an AI vulnerability-finding pipeline to a new bug type, language or target, by rewriting the parts that are specific.
dnr-hunt
7.7kHelps your agent hunt through web logs with no alert in hand, looking for signs of attack and writing up any incidents it finds.
dnr-respond
7.7kHelps your agent work through one security alert or indicator, checking whether an attack worked and how far it reached.
patch
7.7kHelps your agent draft candidate code fixes for verified security findings, saved as diffs for a person to review.
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.