threat-model
Skill42 starsChanged 10 months agoApache-2.0View on GitHub
Threat model a system, feature, service, or PR using Shostack's 4Q workflow, evidence-first analysis, risk scoring, and CLI-friendly Mermaid helper scripts.
39 other projects use a version of this.
Adopted by
Most recently taken up by
- fmind/dottheir own version, first seen Oct 5, 2026
- aprameyak/coding-skillstheir own version, first seen Oct 2, 2026
- openai/codex-securitytheir own version, first seen Oct 2, 2026
- gonimar/claude-web-studiotheir own version, first seen Sep 27, 2026
- ryktara/Foundrytheir own version, first seen Sep 25, 2026
- antoniowolkk/junior-agenttheir own version, first seen Sep 22, 2026
Used with
Projects with it also use supply-chain-review, vuln-scan and 10 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
AnthropicSkillvuln-scan
Static source-code vulnerability scan. Reads a target directory (and THREAT_MODEL.md if present), spawns parallel review subagents per focus area, and writes VULN-FINDINGS.json + .md for /triage to consume. Read-only — no building, running, or network. For execution-verified crashes, use vuln-pipeline instead. Use when asked to "scan for vulns", "review this code for security issues", "find bugs in <dir>", or as the step between /threat-model and /triage.
Also in 3 projects that use this
AnthropicSkillpatch
Generate candidate fixes for verified security findings. Consumes
Also in 3 projects that use this
fefogarciaSkilldependency-audit
Comprehensive dependency health auditing for JavaScript/TypeScript projects. Run npm audit, detect outdated packages, check for security advisories, and verify license compliance. Prioritises vulnerabilities by severity and provides actionable fix recommendations.
Also in 4 projects that use this
CloudflareSkillsecurity-audit
Security guidance and vulnerability review for codebases, APIs, services, CLI tools, libraries, and daemons. Use for security questions, focused reviews, vulnerability research, security audits, or pen tests. Run the complete workflow only for explicit codebase audit or pen-test requests, full/comprehensive/end-to-end reviews, or requested report artifacts.
Also in 7 projects that use this
SentrySkillwrite-tests
Write tests following project conventions. Use when adding new tests or modifying existing ones.
Also in 3 projects that use this
- +2 more from anthropics
Other versions39 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 39
- openai/codex-security★ 11ksame name
- anthropics/defending-code-reference-harness★ 7.5ksame name
- openai/plugins★ 7.3ksame name
- 686f6c61/alfred-dev★ 116same name
- mbwsims/claude-universe★ 72same name
- alpha-omega-security/threat-model★ 58same name
- navikt/copilot★ 54same name
- thejefflarson/soundcheck★ 20same name
- epicsagas/epic-harness★ 19same name
- PerryLink/dsh-skill-pack-security★ 19same name
29 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 repository10 other files it gives its agents.
- copilot-instructions.mdCopilot instructions
- .github/copilot-instructions.mdCopilot instructions
- markdown-customizationsSkill
- access-control-reviewSkill
- dependency-cve-triageSkill
- genai-acceptance-reviewSkill
- input-validation-hardeningSkill
- secrets-and-logging-hygieneSkill
- secure-code-reviewSkill
- secure-fix-validationSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 0 are common, 15 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 35 edited versions we read keep these.
15
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use this skill when you need to:
- Distinctive: line 33
Ask only the branching intake questions that materially change exposure, privilege, or data-sensitivity scoring.
- Distinctive: line 35
Use the bundled Mermaid helper scripts when the Mermaid Chart extension tools are unavailable:
- Distinctive: line 49
MUST use this evidence hierarchy for factual claims: repo-confirmed, runtime/deployment evidence, operator-stated, ASSUMPTION, UNKNOWN.
- Distinctive: line 50
MUST keep confirmed facts separate from inference.
- Distinctive: line 51
MUST ask 4-8 concise intake questions when reachability, privileged workflows, data sensitivity, or environment isolation are unclear.
- Distinctive: line 52
MUST produce at least these diagrams unless the repository clearly cannot support them: DFD Level 0, DFD Level 1, trust-boundary view, and …
- Distinctive: line 53
MUST validate every Mermaid block before finalizing the report.
- Distinctive: line 54
MUST include at least 3 code-anchored or IaC-anchored findings that do not depend primarily on operator answers.
- Distinctive: line 55
MUST assign an overall application risk score from 0-100 with confidence, volatility, and top score drivers.
- Distinctive: line 56
MUST mark mitigations as PRESENT, ABSENT, or UNKNOWN.
- Distinctive: line 57
MUST mark threats as Mitigated, Partially Mitigated, Open, or Unknown based on whether controls materially close the exploit path.
- Distinctive: line 58
SHOULD prefer simple Mermaid syntax over advanced styling.
- Distinctive: line 59
SHOULD call out contradictions between repo evidence and operator statements before finalizing prioritization.
- Distinctive: line 84
Run the helper scripts for Mermaid docs and validation.
“Common” is measured: kept by at least 6 in 10 of the 35 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
Purpose
Provide a repeatable, evidence-first threat modeling workflow for GitHub Copilot users who need durable Markdown output and Mermaid diagrams, including a fallback path for GitHub Copilot CLI users who cannot call the VS Code Mermaid Chart tools directly.
When to use
Use this skill when you need to:
- threat model a repository, feature, architecture, or PR diff
- prepare a security architecture review with data flows and trust boundaries
- produce a 4Q report with actionable mitigations and a validation plan
- work from GitHub Copilot CLI and still validate Mermaid diagrams before publishing the report
Inputs to collect
- in-scope components, deployables, and entry points
- deployment and reachability assumptions
- privileged roles and high-impact workflows
- sensitive data categories and likely consequence of misuse
- existing controls, especially authn/authz, ingress, logging, and environment isolation
- repository evidence for code paths, IaC, manifests, and configuration
How to use
- Collect repository evidence before relying on operator answers.
- Ask only the branching intake questions that materially change exposure, privilege, or data-sensitivity scoring.
- Draft the report in a root-level file named
Threat Model Review - YYYY-MM-DD.md. Use the bundled Mermaid helper scripts when the Mermaid Chart extension tools are unavailable:
npm run threat-model:mermaid-docs -- --list npm run threat-model:mermaid-docs -- --type flowchart npm run threat-model:mermaid-docs -- --type sequenceDiagram npm run threat-model:mermaid-validate -- --file "Threat Model Review - 2026-04-15.md"- Fix Mermaid failures and rerun validation until the script exits successfully.
- Deliver the final report plus a short PR-ready summary.
Rules
- MUST use this evidence hierarchy for factual claims: repo-confirmed, runtime/deployment evidence, operator-stated, ASSUMPTION, UNKNOWN.
- MUST keep confirmed facts separate from inference.
- MUST ask 4-8 concise intake questions when reachability, privileged workflows, data sensitivity, or environment isolation are unclear.
- MUST produce at least these diagrams unless the repository clearly cannot support them: DFD Level 0, DFD Level 1, trust-boundary view, and top 2-3 sequence diagrams.
- MUST validate every Mermaid block before finalizing the report.
- MUST include at least 3 code-anchored or IaC-anchored findings that do not depend primarily on operator answers.
- MUST assign an overall application risk score from 0-100 with confidence, volatility, and top score drivers.
- MUST mark mitigations as PRESENT, ABSENT, or UNKNOWN.
- MUST mark threats as Mitigated, Partially Mitigated, Open, or Unknown based on whether controls materially close the exploit path.
- SHOULD prefer simple Mermaid syntax over advanced styling.
- SHOULD call out contradictions between repo evidence and operator statements before finalizing prioritization.
- MAY omit optional diagrams when the repository does not expose the needed evidence; label the gap as UNKNOWN.
Step-by-step process
- Triage and calibrate risk
- Identify the primary application surface, deployables, and datastore paths.
- Classify reachability first: internal, mixed, partner-reachable, or public.
- Capture repo-confirmed versus operator-stated exposure details separately.
- Q1: What are we working on?
- Summarize system purpose, components, identities, assets, and trust boundaries.
- Rank key flows by sensitivity, privilege, and exposure.
- Draft DFD Level 0 and Level 1 diagrams.
- Q2: What can go wrong?
- Enumerate flow-specific threats with STRIDE and OWASP mapping.
- Include abuse cases for admin paths, bulk actions, impersonation, exports, webhooks, and downstream triggers where relevant.
- Preserve at least 2-3 high-confidence threats directly anchored in code or IaC.
- Q3: What are we going to do about it?
- Evaluate controls as PRESENT, ABSENT, or UNKNOWN.
- Distinguish direct mitigations from adjacent hygiene controls.
- Recommend practical fixes with expected effort and blast-radius reduction.
- Q4: Did we do a good job?
- Build a validation plan with 3-6 scenarios.
- Include one scenario for a code-evidenced weakness, one for an operator-stated assumption, and one for privileged workflow misuse.
- Validate diagrams and finish the report
- Run the helper scripts for Mermaid docs and validation.
- Confirm that diagram evidence, findings, scoring, and validation scenarios are internally consistent.
Mermaid helper scripts
The skill includes these local scripts under skills/threat-model/scripts/:
mermaid-docs.mjs: prints concise syntax guidance and common pitfalls for supported diagram types.validate-mermaid.mjs: validates Mermaid blocks in Markdown reports or standalone diagram files using deterministic preflight checks.
Supported diagram types:
flowchartsequenceDiagramclassDiagramerDiagram
Validation expectations:
- the first meaningful line must declare a supported Mermaid diagram type
- flowcharts must not mix sequence-diagram grammar
- sequence diagrams must not mix flowchart grammar and must close structured blocks with
end - Markdown reports may contain multiple Mermaid blocks; each block is validated independently
Output format
Produce a Markdown report with these sections:
- Executive summary
- Risk score
- Scope
- Exposure and risk calibration
- Contradictions and reconciliation
- Assumptions and unknowns
- Architecture and data flows with validated diagrams
- Key flows
- Threats table
- Mitigations table
- High-risk interaction sequences
- Validation plan
- Owners
- Open questions
Required tables:
- threats table:
ID | Flow | Summary | STRIDE | OWASP | Likelihood | Impact | Status | Rationale - mitigations table:
Threat ID | Mitigation | Status | Directness | Location/Evidence | Notes/Open questions
Required scoring fields:
- overall application risk score
- risk band
- confidence
- score volatility
- primary score drivers
- what would raise or lower the score
Examples
Example: CLI-first threat model workflow
npm run threat-model:mermaid-docs -- --type flowchart
npm run threat-model:mermaid-docs -- --type sequenceDiagram
npm run threat-model:mermaid-validate -- --file "Threat Model Review - 2026-04-15.md"Expected outcome:
- the docs command prints the required header, allowed constructs, and common pitfalls
- the validation command reports each Mermaid block as
PASSor fails with block-specific errors
Example: threat model output goals
- Top findings are prioritized by real reachability, privilege, and blast radius.
- Evidence is anchored to repository files, symbols, and line ranges when available.
- Unknowns include an owner and a question that can be answered later.
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.

