name: threat-model
description: "Threat-model a system or feature to find where it could be attacked, before you build it. Use when asked to threat-model, do a security design review, document security risks, identify attack surface, or apply STRIDE to a design. Produces a structured threat model: assets, trust boundaries and data flows, threats enumerated by category (STRIDE), risk scores, prioritized mitigations, and residual-risk sign-off. Defensive security for systems you own or are authorized to assess."
Threat Model Skill
Security bugs are cheapest to fix at design time. Threat modeling asks, systematically, "what can go wrong
here?" — before code exists. This skill runs a structured pass: map what you're protecting and the trust
boundaries, enumerate threats with STRIDE, and prioritize mitigations by risk. It's for systems you own or
are authorized to assess.
Required Inputs
Ask for these only if they aren't already provided:
- The system/feature — what it does, its components, and how data flows through it.
- Assets — what's worth protecting (data, credentials, funds, availability, reputation).
- Trust boundaries — where control changes hands (internet↔app, app↔DB, tenant↔tenant, user roles).
- Actors & entry points — users, admins, services, third parties; APIs, inputs, uploads, auth.
Output Format
Threat model: [system/feature]
1. Scope & assets — what's in scope, and the assets ranked by what their compromise would cost.
2. Architecture & trust boundaries — the components, data flows, and where trust boundaries sit. (A Mermaid diagram helps — the playground renders it.)
flowchart LR
User -->|HTTPS| API
API --> DB[(Data)]
API -.->|boundary| ThirdParty[/3rd party/]
3. Threats (STRIDE) — walk each boundary/data-flow and enumerate threats by category:
| # | STRIDE category | Threat (how the attack works) | Asset at risk | Likelihood × Impact | Priority |
|---|
Cover Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, Elevation of privilege — skip a category only with a reason.
4. Mitigations (prioritized) — for the top threats, the concrete control (authn/authz, validation, encryption, rate-limiting, logging, least privilege) and where it goes. Note residual risk you're accepting.
5. Assumptions & out-of-scope — trust assumptions and what this model deliberately doesn't cover.
Quality Checks
Anti-Patterns
Based On
Threat-modeling practice (STRIDE, trust boundaries, data-flow diagrams, risk-ranked mitigations).
Example Trigger Phrases
- "Do a security design review?"
- "Document security risks."
- "Apply STRIDE to a design."