Skip to content
Skills Library
Security · Review & audit

threat-model

/threat-model

Threat model the user's system with STRIDE. Reads the code, infra and docs, draws a data flow diagram with trust boundaries, lists threats per element, maps each to a control and a test, and writes THREAT_MODEL.md. Finds design flaws scanners miss (missing auth, IDOR, no rate limit, no audit log, over-privileged roles). Use for "threat model this", "STRIDE", "what could go wrong with this design", "security design review", "attack surface", or before building a new feature or service.

Repository
appsec-kit ↗
Licence
MIT
Last repository change
28.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 28.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Threat model the user's system with STRIDE. Reads the code, infra and docs, draws a data flow diagram with trust boundaries, lists threats per element, maps each to a control and a test, and writes THREAT_MODEL.md. Finds design flaws scanners miss (missing auth, IDOR, no rate limit, no audit log, over-privileged roles). Use for "threat model this", "STRIDE", "what could go wrong with this design", "security design review", "attack surface", or before building a new feature or service.

Triggers from the description

threat model thisSTRIDEwhat could go wrong with this designsecurity design reviewattack surface
Original author description

Threat model the user's system with STRIDE. Reads the code, infra and docs, draws a data flow diagram with trust boundaries, lists threats per element, maps each to a control and a test, and writes THREAT_MODEL.md. Finds design flaws scanners miss (missing auth, IDOR, no rate limit, no audit log, over-privileged roles). Use for "threat model this", "STRIDE", "what could go wrong with this design", "security design review", "attack surface", or before building a new feature or service.

How it works

  1. 1. What are we building
  2. 2. What can go wrong
  3. 3. What are we doing about it
  4. 4. Write THREATMODEL.md
  5. 5. Did we do a good job
Original SKILL.md headings · 69 lines, 620 words
SKILL.md preview
---
name: threat-model
description: Threat model the user's system with STRIDE. Reads the code, infra and docs, draws a data flow diagram with trust boundaries, lists threats per element, maps each to a control and a test, and writes THREAT_MODEL.md. Finds design flaws scanners miss (missing auth, IDOR, no rate limit, no audit log, over-privileged roles). Use for "threat model this", "STRIDE", "what could go wrong with this design", "security design review", "attack surface", or before building a new feature or service.
---

# Threat model

Answer the four questions: what are we building, what can go wrong, what are we doing about it, did we do a good job.

## 1. What are we building

Read before asking. Sources: entry points (routes, handlers, CLI, queue consumers), auth middleware, data models, outbound calls (HTTP clients, SDKs, shell, file I/O), IaC, Dockerfiles, CI workflows, README and architecture docs. Ask the user only what the code can't tell you: who the users are, what data is sensitive, what is internet-facing, compliance needs.

If the user names a feature or a design doc, scope the model to that, not the whole repo.

Write down:

- **Elements**: external entities (users, third-party services), processes (services, workers, CI), data stores (DBs, buckets, caches, secrets stores), data flows between them.
- **Trust boundaries**: every place data crosses from less-trusted to more-trusted (internet → API, API → shell/DB, tenant A → tenant B, CI → cloud account, container → host).
- **Assets**: what an attacker wants (user data, credentials, money, compute, availability).

Draw the DFD as a Mermaid `flowchart` with boundaries as `subgraph`s.

## 2. What can go wrong

Go element by element, flow by flow. Not every letter applies to every element:

| | Applies to | Ask |
|---|---|---|
| **S**poofing | entities, processes | Can someone pretend to be a user or service? How is identity proven at each boundary? |
| **T**ampering | flows, stores, processes | Can input change data, queries, commands, or code (injection, deserialization, unsigned artifacts)? |
| **R**epudiation | processes | Could someone deny an action? Is there an audit log that the actor can't edit? |
| **I**nformation disclosure | flows, stores, processes | Can data leak to the wrong party (IDOR, verbose errors, public buckets, logs, secrets in env)? |
| **D**enial of service | processes, stores | Can one caller exhaust CPU, memory, connections, money (no rate limit, unbounded queries, expensive endpoints)? |
| **E**levation of privilege | processes | Can a user become admin, or code become root / cloud admin (RCE, broad IAM, root containers, CI tokens)? |

Check the code to confirm each threat; cite file:line. Mark ones you inferred but couldn't confirm as **assumed**.

Always look specifically for what scanners miss: authZ on every object access (IDOR), tenant isolation, business-logic abuse (negative amounts, replay, race conditions), rate limits, audit logging, secret lifecycle, blast radius of each credential.

## 3. What are we doing about it

For each threat: a control (prefer removing the feature or narrowing the design over adding a filter), how to detect it (which scanner/rule, test, or "design review only"), and status: Open / Mitigated / Accepted (with owner and reason).

Rank by likelihood × impact; keep it simple (High / Medium / Low). Internet-reachable + no auth + sensitive data is High.

## 4. Write THREAT_MODEL.md

```markdown
# Threat Model — <system>

Scope, date, sources read.

## System
<mermaid DFD>
Trust boundaries: numbered list. Assets: list.

## Threats
| # | STRIDE | Threat | Where (file:line / element) | Risk | Control | Detect / test | Status |

## Not found by scanners
Threats above that only design review catches.

## Assumptions and open questions
```

## 5. Did we do a good job

- Every trust boundary has at least one threat considered.
- Every High has a control and a test (unit/integration test, Semgrep rule, policy, or pentest step).
- Suggest turning repeatable checks into automation: a custom Semgrep rule for a project-specific bad pattern, a Conftest policy, a CI gate (`secure-pipeline` skill). Run the `scan` skill for the code-level findings.
- Revisit when the design changes: new entry point, new data store, new third party, new privilege.

Versions

RepositoryScoreLicence
This page · camtoan-do/appsec-kit100MIT
mohamed-osama-aboelkheir/appsec-untangled-resources100MIT
jelvodev/yaap100MIT
cowork-os/cowork-os100MIT
andreibesleaga/gabbe100CC-BY-4.0
rafagomes/ai-workflow100MIT
ClineSec/cline-skills100MIT
qa-aman/claude-skills100MIT
hamzabellouch/agent-skills100MIT

Database snapshot: 13.11.2026 · package version 5ee0d985c25e (SHA-256 digest of the entire package)

Downloads in the last 30 days: 3 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90Threat Modeling
    This skill should be used when the user asks about "threat model", "STRIDE", "data flow diagram", "attack surface", "threat analysis", "security architecture", "component threats", "trust boundaries", "technology decomposition", or needs systematic threat identification during…
  • 90model
    This skill should be used when the user asks to "create threat model", "threat model architecture", "map security architecture", "build threat model", "STRIDE analysis", "data flow diagram", "DFD security", or "attack tree analysis". Also triggers when the user wants a…
  • 100threat-modeling
    Builds practical threat models - a data flow diagram with trust boundaries, STRIDE analysis per element, ranked threats, and mitigations turned into tracked work. Use when designing a new system or feature, reviewing a design doc or architecture for security, adding an external…
  • 100security-threat-model
    Threat-model the user's own app from its real code. Draws the data flow (actors, trust boundaries, data stores, external services) as a Mermaid diagram, finds threats per element with STRIDE, ranks them by likelihood times impact, then proves each top risk with a local failing…
  • 100threat-modeling-stride
    Use when a system needs a threat model — before development from its planning documents (architecture, data model, API, roles, security design) or on an existing codebase — producing a STRIDE-per-element analysis, data-flow diagrams with trust boundaries, a rated and owned…
  • 90security-threat-modeling
    Runs a STRIDE-style threat model on a component — assets, entry points, trust boundaries, threats, mitigations — with each threat anchored to an owner and a ticket. Output: `threat-model.md` with the full asset / boundary / threat table. Pulled by the `security` specialist.…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.