threat-model
Skill16 starsChanged 5 months agoMITView on GitHub
Produces a professional red-team application security threat model as a standalone HTML report. Use when mapping architecture, data flows, trust boundaries, attack surface, and realistic abuse cases.
57 other projects use a version of this.
Adopted by
Most recently taken up by
- mgkvibez/sentinel-skillstheir own version, first seen Nov 8, 2026
- requie/endostacktheir own version, first seen Nov 8, 2026
- pat-lewczuk/skillstheir own version, first seen Nov 1, 2026
- Codeminer42/skillstheir own version, first seen Nov 1, 2026
- jmanico/grim-promptertheir own version, first seen Nov 1, 2026
- Q00/ouroborostheir own version, first seen Oct 25, 2026
Used with
Projects with it also use vuln-scan, patch and 9 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.
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 5 projects that use this
AnthropicSkillpatch
Generate candidate fixes for verified security findings. Consumes
Also in 4 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
Other versions57 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 57
- openai/codex-security★ 11ksame name
- openai/plugins★ 7.8ksame name
- anthropics/defending-code-reference-harness★ 7.5ksame name
- Q00/ouroboros★ 6.3ksame name
- me2resh/apexyard★ 542same name
- jmanico/grim-prompter★ 391same name
- Cosmian/kms★ 372same name
- mbwsims/claude-universe★ 71same name
- navikt/copilot★ 61same name
- Codeminer42/skills★ 32same 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 repository14 other files it gives its agents.
- access-reviewSkill
- agent-security-reviewSkill
- api-testingSkill
- branch-reviewSkill
- code-qualitySkill
- code-reviewSkill
- compliance-reviewSkill
- deep-appsec-reviewSkill
- finding-reviewSkill
- leadership-reportSkill
- pr-reviewSkill
- retestSkill
- security-testsSkill
- supply-chain-reviewSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
25 rules. 0 are common, 21 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 51 edited versions we read keep these.
21
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Use this skill when the user wants a full application-security threat model of a repository, delivered as a polished standalone HTML page.
- Very specific: line 23
Use templates/threat-model-report.html from this skill as the visual and structural template when available.
- Distinctive: line 28
No external JavaScript, fonts, images, trackers, or CDN assets.
- Distinctive: line 29
No hidden dependencies on local build tooling.
- Distinctive: line 35
Prefer system-specific threat scenarios over generic STRIDE filler.
- Distinctive: line 39
Treat missing security boundaries, missing tests, and unclear ownership as reportable risks when they materially affect security.
- Distinctive: line 64
Do not run dependency installation, migrations, destructive commands, production network calls, or broad scanners unless the user …
- Distinctive: line 68
Create an internal working model with these elements:
- Distinctive: line 79
If the system is too large to understand exhaustively in one pass, prioritize high-risk flows and explicitly list coverage limits.
- Distinctive: line 83
Use repository-specific evidence to identify plausible abuse cases and threat scenarios.
- Distinctive: line 114
Do not include step-by-step exploitation instructions or payloads.
- Very specific: line 125
Use evidence to justify ratings.
- Very specific: line 135
Use status values such as confirmed, likely, needs_validation, design_risk, accepted_control, or no_confirmed_findings.
- Very specific: line 149
If no confirmed risks are found, still emit the header and one no_confirmed_findings informational row in the risk register.
- Distinctive: line 172
Use tables for inventories and risk registers.
- Distinctive: line 180
Do not hide uncertainty inside confident prose.
- Distinctive: line 182
Use temporary stubs only to isolate unavailable external services, credentials, nondeterministic providers, or slow dependencies.
- Distinctive: line 184
When subagents are available, ask an independent subagent to challenge high or critical threat scenarios for reachability, impact, …
- Distinctive: line 188
Before finalizing the HTML:
- Distinctive: line 191
Ensure the report is readable without external assets.
- Distinctive: line 192
Ensure no placeholder text remains.
- Distinctive: line 193
Ensure every high or critical risk has a recommended mitigation and validation plan.
- Distinctive: line 194
Ensure the appendix lists commands run and files reviewed.
- Distinctive: line 195
Ensure the report does not contain unsafe exploitation instructions.
- Distinctive: line 208
If the user asks only for the artifact, keep the chat response brief and point to the generated HTML file.
“Common” is measured: kept by at least 6 in 10 of the 51 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
Use this skill when the user wants a full application-security threat model of a repository, delivered as a polished standalone HTML page.
This is not a checklist exercise. The agent must first understand how the system works, then model how it can fail under realistic adversarial pressure. The output should help engineers and security reviewers make decisions.
This skill is written for Claude Code, Codex, Cursor, and similar coding agents. Tool names vary by environment; use the local equivalents for file search, file reading, command execution, and writing the final report.
Deliverable
Produce a standalone HTML report, preferably named:
appsec-threat-model.htmlUse templates/threat-model-report.html from this skill as the visual and structural template when available. If the environment cannot directly read skill template files, recreate the same structure from the required report sections below.
The final report must be self-contained:
- Inline CSS only.
- No external JavaScript, fonts, images, trackers, or CDN assets.
- No hidden dependencies on local build tooling.
- Clean typography, clear hierarchy, readable tables, and printable layout.
Operating Principles
- Understand before judging. Do not write the threat model until the architecture, trust boundaries, entry points, and sensitive data flows are grounded in repository evidence.
- Prefer system-specific threat scenarios over generic STRIDE filler.
- Model realistic attacker paths without providing weaponized exploit instructions, payload catalogs, persistence steps, credential theft workflows, or third-party attack guidance.
- Tie every important claim to code, config, docs, tests, or explicit uncertainty.
- Separate confirmed design facts from inferred behavior and unknowns.
- Treat missing security boundaries, missing tests, and unclear ownership as reportable risks when they materially affect security.
Phase 1: Repository Comprehension
Build a codebase map before threat modeling.
Inspect, when present:
README, architecture docs, API docs, runbooks, deployment docs, ADRs, and diagrams.- Package manifests, lockfiles, workspace files, monorepo config, and build scripts.
- Route definitions, controllers, handlers, RPC services, GraphQL resolvers, workers, CLIs, cron jobs, webhooks, and event consumers.
- Auth, session, identity, tenant, role, permission, policy, and middleware code.
- Database schema, migrations, ORM models, storage clients, queues, caches, search indexes, and external integrations.
- Infrastructure-as-code, Dockerfiles, compose files, Kubernetes manifests, Terraform, CI/CD workflows, release scripts, and secrets/config examples.
- Tests around authentication, authorization, validation, tenancy, and critical workflows.
Useful discovery commands when available:
rg --files
git status --short
find . -maxdepth 3 -type f
rg -n "auth|session|token|tenant|org|role|permission|policy|admin|webhook|secret|encrypt|decrypt|jwt|oauth|saml|csrf|cors|rate|limit"Do not run dependency installation, migrations, destructive commands, production network calls, or broad scanners unless the user explicitly approves them or the repo workflow clearly permits them.
Phase 2: Build The System Model
Create an internal working model with these elements:
- Product purpose: what the application exists to do.
- System shape: frontend, backend, jobs, agents, data stores, third-party services, deployment boundaries, and operational surfaces.
- Actors: anonymous users, authenticated users, admins, support users, service accounts, internal services, external providers, CI/CD actors, and attackers.
- Sensitive assets: credentials, sessions, API keys, tokens, PII, payment data, customer data, tenant data, prompts, model outputs, audit logs, source code, infrastructure credentials, and administrative controls.
- Entry points: routes, APIs, webhooks, file uploads, importers, parsers, URL fetchers, background workers, queues, CLIs, browser surfaces, extensions, model/tool interfaces, and admin panels.
- Trust boundaries: browser to server, tenant to tenant, user to admin, app to third party, app to database, app to worker, worker to infrastructure, model output to tool execution, CI to deployment, and local config to runtime.
- Data flows: how sensitive data enters, moves, transforms, leaves, and is logged or cached.
- Security controls: authentication, authorization, validation, output encoding, CSRF, CORS, rate limits, audit logging, encryption, secret storage, sandboxing, network controls, and test coverage.
If the system is too large to understand exhaustively in one pass, prioritize high-risk flows and explicitly list coverage limits.
Phase 3: Red-Team AppSec Threat Modeling
Use repository-specific evidence to identify plausible abuse cases and threat scenarios.
Analyze at least these domains when applicable:
- Authentication and account lifecycle: signup, login, logout, password reset, SSO, OAuth/SAML, magic links, invitation flows, account linking, API keys, service accounts, and token rotation.
- Authorization and tenant isolation: object-level access, role checks, organization membership, admin boundaries, support access, sharing, exports, bulk operations, background jobs, and indirect object references.
- Data exposure: logs, telemetry, traces, error messages, analytics, browser storage, caches, exports, generated files, object storage, client bundles, and support tools.
- Unsafe input handling: SQL/NoSQL injection, shell invocation, template injection, path traversal, archive extraction, deserialization, XML/YAML parsing, SSRF, URL previewers, file uploads, and content processing.
- Agentic or LLM surfaces: prompt injection, untrusted model output controlling tools, tool permission boundaries, browser automation, retrieval poisoning, memory poisoning, and cross-tenant context leakage.
- Business logic abuse: workflow state changes, billing, quotas, trials, referrals, approvals, invitations, reset flows, marketplace/actions, and race conditions.
- Supply chain and deployment: package scripts, CI permissions, release workflows, container hardening, dependency pinning, generated code, secrets in build logs, artifact provenance, and environment separation.
- Resilience and abuse prevention: rate limits, timeout behavior, retry loops, idempotency, queue poisoning, expensive operations, storage exhaustion, and unauthenticated resource consumption.
- Cryptography and secrets: password hashing, randomness, signing, encryption, key management, webhook signatures, JWT verification, config defaults, and local development secrets.
Threat Scenario Standard
Each meaningful threat scenario should include:
- Scenario title.
- Affected component or flow.
- Attacker starting position.
- Preconditions.
- Trust boundary crossed.
- Attack narrative at a safe, non-weaponized level.
- Impact.
- Existing controls observed in the repo.
- Gaps or weak assumptions.
- Recommended mitigations.
- Validation approach.
- Residual risk after mitigation.
Do not include step-by-step exploitation instructions or payloads. The purpose is to help defenders fix design and implementation risk.
Risk Rating
Rate risks using likelihood, impact, and confidence:
- Likelihood: Low, Medium, High.
- Impact: Low, Medium, High, Critical.
- Confidence: Low, Medium, High.
- Priority: P0, P1, P2, P3.
Use evidence to justify ratings. Keep confidence low when code paths, deployment controls, or production assumptions are unclear.
Findings CSV
The report's risk register and any chat summary of risks must use this exact CSV header:
id,severity,confidence,status,category,title,location,asset_or_flow,actor,issue,impact,evidence,fix,test,scope_notesUse status values such as confirmed, likely, needs_validation, design_risk, accepted_control, or no_confirmed_findings. Use category values such as authorization, authentication, data-exposure, injection, ssrf, file-access, llm-agent, business-logic, supply-chain, resilience, crypto, or tests.
For threat scenarios, use:
location: primary code, config, report section, or component reference.asset_or_flow: sensitive asset, trust boundary, or data flow.actor: realistic attacker starting position.issue: threat scenario and failed security property.impact: likely customer, tenant, data, operational, or business consequence.evidence: repo facts, inferred architecture, or explicit missing evidence.fix: recommended mitigation.test: validation plan or regression test.scope_notes: priority, likelihood, residual risk, or coverage limit.
If no confirmed risks are found, still emit the header and one no_confirmed_findings informational row in the risk register.
Required HTML Report Structure
The report must include:
- Title block with repo name, date, reviewer/agent, scope, and commit or branch when available.
- Executive summary.
- Scope and methodology.
- System overview.
- Architecture inventory.
- Trust boundaries.
- Sensitive assets.
- Entry points and attack surface.
- Data-flow summary.
- Threat scenarios.
- Risk register as a CSV-formatted table using the standard findings header.
- Security controls observed.
- Gaps and recommended roadmap.
- Validation plan.
- Review coverage and limitations.
- Appendix with key files reviewed and commands run.
Use tables for inventories and risk registers. Use compact visual blocks for severity and priority. Use code path references for evidence.
Evidence Rules
- Link or reference concrete files and functions using repo-relative paths.
- For claims based on config or tests, name the relevant file.
- For inferred architecture, mark it as inferred.
- For unknown production behavior, mark it as unknown and explain what evidence would resolve it.
- Do not hide uncertainty inside confident prose.
- Where locally testable, run focused smoke tests, existing tests, static checks, or local harnesses to validate high-priority risks before placing them in the risk register.
- Use temporary stubs only to isolate unavailable external services, credentials, nondeterministic providers, or slow dependencies. Do not stub the trust boundary, policy, approval gate, tenant filter, or parser behavior being modeled.
- Clean up scratch files, temporary fixtures, mock servers, local config changes, generated harnesses, and ad hoc scripts before finalizing the report unless the user asked for durable tests.
- When subagents are available, ask an independent subagent to challenge high or critical threat scenarios for reachability, impact, confidence, and whether observed controls already mitigate them.
Output Quality Bar
Before finalizing the HTML:
- Open or inspect the file enough to verify it is valid HTML with one
<!doctype html>, one<html>, and balanced major sections. - Ensure the report is readable without external assets.
- Ensure no placeholder text remains.
- Ensure every high or critical risk has a recommended mitigation and validation plan.
- Ensure the appendix lists commands run and files reviewed.
- Ensure the report does not contain unsafe exploitation instructions.
Agent Workflow
- Confirm scope if the user has not provided one and the repo is ambiguous.
- Discover the repo structure and Git state.
- Build the system model from code, docs, config, and tests.
- Identify trust boundaries, assets, entry points, and data flows.
- Threat model high-risk flows deeply.
- Draft the report using the HTML template.
- Validate the HTML artifact for completeness and readability.
- Report the output path and summarize the top risks in chat.
If the user asks only for the artifact, keep the chat response brief and point to the generated HTML file.
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.

