threat-model
Skill25 starsChanged 4 months agoApache-2.0View on GitHub
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".
61 other projects use a version of this, 4 of them edited.
Adopted by
Most recently taken up by
- Lucface/claude-skillstheir own version, first seen Nov 16, 2026
- MichaelRyanWood/claude-skillstheir own version, first seen Nov 16, 2026
- seancabalse/agentic-playbooktheir own version, first seen Nov 16, 2026
- Yomudogly/oh-my-agytheir own version, first seen Nov 16, 2026
- mgkvibez/sentinel-skillstheir own version, first seen Nov 8, 2026
- requie/endostacktheir own version, first seen Nov 8, 2026
Used with
Projects with it also use supply-chain-review, orbit and 7 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MesteriisSkillsupply-chain-review
Reviews lockfiles, installers, provenance, CI permissions, dependency confusion, artifacts, registries, and publishing.
Also in 3 projects that use this
mbwsimsSkillorbit
Run for repo-wide or diff-wide readiness sweeps: "/orbit", "/orbit pr", "/orbit deep", "/orbit quick", "audit this project", "project-wide review", "is this PR ready overall", or "combined security, tests, codebase, evolution, and instruction review". Use this for broad multi-system assessment, not for a single-file review or a one-domain question.
Also in 3 projects that use this
mbwsimsSkilltest-plan
This skill should be used when the user asks to "plan tests", "what should I test", "what tests do I need", "test plan for", "testing strategy for", "test matrix for", "what cases should I cover", "help me plan tests", mentions "/test-plan", or wants to understand what tests are needed before writing any test code.
Also in 3 projects that use this
Sagargupta16Skilldependency-audit
Audit project dependencies for security vulnerabilities, licensing issues, maintenance health, and optimization opportunities. Use it during regular security audits (monthly or quarterly); before a major release when you want to ensure the dependency tree is clean; when evaluating whether to adopt or replace a dependency; after a security advisory affects one of your dependencies; when your install times or bundle sizes have grown noticeably.
Also in 4 projects that use this
patrickserranoSkillperformance-audit
Audit and improve SwiftUI runtime performance. Use for requests to diagnose slow rendering, janky scrolling, high CPU/memory usage, excessive view updates, or layout thrash in SwiftUI apps.
Also in 3 projects that use this
asterkinSkilladr
Create Architecture Decision Records (ADRs) following project standards. Guides template usage, process, and best practices for documenting architecturally significant decisions.
Also in 6 projects that use this
Other versions61 projects use a version of this.
Word for word · 0
None found.
Edited · 4
- anthropics/defending-code-reference-harness★ 7.5k96% same
- Q00/ouroboros★ 6.4k83% same
- air-gapped/skills★ 670% same
- IvandoNascimento/skills★ 196% same
Wrote their own version · 57
- openai/codex-security★ 14ksame name
- openai/plugins★ 7.8ksame name
- me2resh/apexyard★ 542same name
- jmanico/grim-prompter★ 497same name
- Cosmian/kms★ 378same name
- mbwsims/claude-universe★ 71same name
- navikt/copilot★ 61same name
- Codeminer42/skills★ 32same name
- PerryLink/dsh-skill-pack-security★ 22same name
- epicsagas/epic-harness★ 20same name
47 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- customizeSkill
- patchSkill
- quickstartSkill
- sast-drivenSkill
- sast-prioritiseSkill
- threat-modelSkill
- triageSkill
- variant-scanSkill
- verifySkill
- vuln-scanSkill
- customizeSkill
- patchSkill
- quickstartSkill
- sast-drivenSkill
- sast-prioritiseSkill
- triageSkill
- variant-scanSkill
- verifySkill
- vuln-scanSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 5 are distinctive, and 8 are very specific to this project.
0
Common
Most of the 55 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 37
Litmus test: If patching one line of code makes an entry disappear, it was a vulnerability, not a threat.
- Distinctive: line 57
Before proceeding, confirm and state in your first response:
- Very specific: line 61
If --vulns points at a URL or you are asked to "fetch CVEs", you will query only public advisory databases (NVD, GitHub Security …
- Very specific: line 65
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.
- Very specific: line 81
All modes write the same artifact (THREAT_MODEL.md, schema in schema.md) so downstream consumers (pipeline recon/judge, verifier agents) do …
- Very specific: line 95
Do not read interview.md or bootstrap.md in full up front.
- Very specific: line 98
If a re-read via the Read tool is refused as "file unchanged", the prior result was evicted.
- Distinctive: line 113
When the owner is available *and* the codebase is checked out, this is the recommended path: the owner's time goes to refining a …
- Very specific: line 121
Read bootstrap.md and follow it end-to-end.
- Very specific: line 137
Before deriving threats, classify the target into ONE layer and record it as target_layer in section 1.
- Distinctive: line 159
Release-diff is mandatory: If the checkout is a dev pin, note the latest released tag and flag which threats are shipped vs dev-only-new vs …
- Very specific: line 172
All modes MUST emit <target-dir>/THREAT_MODEL.md conforming to schema.md in this directory.
- Distinctive: line 177
After writing the file, print to the user:
“Common” is measured: kept by at least 6 in 10 of the 55 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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 memory disclosure
via untrusted binary parsing") still stands after every known bug is fixed; a
vulnerability ("Table::sum_record reads an unsafe slice at an
attacker-controlled data_off without a bounds check") 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 goes to refining a code-grounded draft instead of describing the system from scratch.
- Tell the owner: "I'll read the code first and come back with a draft
(about 5-10 min), then we'll walk it together. Want that, or would you
rather start cold?" Only proceed if they opt in; otherwise fall back to
interview.md. - Read
bootstrap.mdand follow it end-to-end. Write<target-dir>/THREAT_MODEL.md. - Immediately continue into interview mode: read
interview.mdand follow it with--seed <target-dir>/THREAT_MODEL.mdin effect. The section 6 open questions from bootstrap become your Q1-Q4 prompts; the owner confirms, corrects, and adds rather than starting from nothing. - Overwrite
<target-dir>/THREAT_MODEL.mdwith the refined model. Set provenancemode: bootstrap-then-interview.
The same flow is available manually: run bootstrap first, then
interview --seed <THREAT_MODEL.md> in a later session.
Step 1.5 — Classify the target's LAYER (bug-class & tool router) [ADR-1]
Before deriving threats, classify the target into ONE layer and record it as target_layer in
section 1. The layer decides the primary bug-class to hunt and the primary tool — routing this
deliberately is the difference between finding the class that ships and re-running a fuzzer over
already-fuzzed code (see LESSONS.md L42–L44).
| Layer | Signal | Primary bug-class | Primary method | Add finders |
| data-format parser | bytes → structure; a decode/parse/from_bytes entry over untrusted input | panic / OOB / overflow / alloc-DoS on malformed input | fuzz-first | classic cargo-fuzz + find→fuzz CWE→oracle table |
| protocol / state-machine | handshakes, sessions, negotiated params, client+server sides | missing/asymmetric enforcement, downgrade, state-transition data-loss, protocol-tied resource growth | invariant-first | invariant-symmetry + silent-failure differential |
| API-contract / library | serialization, containers, config, fs helpers; a documented contract | contract violation, silent failure, spec/impl divergence | differential-first | spec-vs-impl + control-vs-attack differential |
Rules:
- Fuzz only when layer = parser (or a parser sub-surface) and not already well-covered by OSS-Fuzz and the class is crash/OOB/alloc. Otherwise deprioritize byte-mutation fuzzing and record why in section 5 (deprioritized) — a decision, not an omission.
- Protocol/contract targets: enumerate the protocol's invariants (e.g. "QUIC uses TLS 1.3 only", "chunked framing terminates on a zero-size line", "recursion is bounded") and, for each, locate where it is enforced and where its mirror is not (client↔server, send↔receive, offered↔accepted, one-param↔all-params). A guard with a missing mirror is a section-4 threat with a concrete evidence lead. Silent-failure bugs (validated-then-discarded, accept-what-should-reject) need a control-vs-attack oracle, not a crash — flag them for that harness.
- Release-diff is mandatory. If the checkout is a dev pin, note the latest released tag and flag which threats are shipped vs dev-only-new vs a dev regression of a shipped guard — this changes both severity and disclosure channel.
- A large target can be multi-layer (rustls = protocol core + a
msgs/parser sub-surface): classify per sub-surface and route each.
Then continue to the mode from Step 1; the layer + hunt plan feeds bootstrap's "generalize vulns
into threat classes" stage.
Step 2 — Shared output contract
All modes MUST emit <target-dir>/THREAT_MODEL.md conforming to schema.md
in this directory. Read schema.md immediately before you write the file,
not at routing time; in interview mode the gap between routing and emit can be
many turns, and an early read will be evicted before it's used.
After writing the file, print to the user:
- The path to
THREAT_MODEL.md. - The top 5 threats by likelihood × impact (id, one-line description, L×I).
- For
bootstrap: any open questions the code could not answer (these seed a laterinterviewpass). - For
interview: any owner statements that could not be verified in code (these seed follow-up code review).
References
- docs/security.md for the engagement-context, authorization, and untrusted-input framing this skill inherits.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

