Create Threat Model
Overview
Generate a STRIDE-based threat model (Microsoft) for a system or component. Identifies trust boundaries from architecture docs, analyzes each boundary for Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, and Elevation of Privilege threats, and recommends mitigations for each identified threat.
Workflow
Read architecture context -- Scan .chalk/docs/engineering/ for architecture docs, API designs, data models, and infrastructure descriptions. Check .chalk/docs/product/ for PRDs that describe the feature's intended behavior. You need to understand the system before modeling threats against it.
Parse the target system -- Extract from $ARGUMENTS the system, service, or component to threat model. If unspecified, ask the user to name the scope -- threat modeling the entire system at once is too broad to be useful.
Determine the next file number -- Read filenames in .chalk/docs/engineering/ to find the highest numbered file. The next number is highest + 1.
Identify trust boundaries -- Map the boundaries where data or control crosses between different trust levels: client/server, service/service, internal/external, user/admin, authenticated/unauthenticated. Each boundary is a potential attack surface.
Apply STRIDE at each boundary -- For each trust boundary, analyze:
- Spoofing: Can an attacker impersonate a legitimate entity?
- Tampering: Can data be modified in transit or at rest?
- Repudiation: Can a user deny performing an action without detection?
- Information Disclosure: Can sensitive data leak to unauthorized parties?
- Denial of Service: Can the system be made unavailable?
- Elevation of Privilege: Can a user gain unauthorized access levels?
Rate and prioritize -- For each threat, assess likelihood (low/medium/high) and impact (low/medium/high). Prioritize by risk = likelihood x impact.
Recommend mitigations -- For each threat rated medium or higher, provide a specific, actionable mitigation. Reference existing controls from the architecture docs where applicable.
Write the file -- Save to .chalk/docs/engineering/<n>_threat_model_<system-slug>.md.
Confirm -- Share the file path and highlight the top 3 highest-risk threats that need immediate attention.
Output
- File:
.chalk/docs/engineering/<n>_threat_model_<system-slug>.md
- Format: Plain markdown with trust boundary diagram (text-based), STRIDE analysis table, and prioritized mitigations
- First line:
# Threat Model: <System Name>
Anti-patterns
- Boilerplate threats without system context -- "SQL injection is a risk" is generic. Tie every threat to a specific trust boundary and data flow in the actual system.
- No mitigations -- A list of threats without mitigations is an anxiety generator, not a security tool. Every medium+ threat needs an actionable mitigation.
- Scope too broad -- Threat modeling "the application" produces shallow results. Scope to a specific component, service, or data flow for actionable depth.
- Missing trust boundaries -- If you only analyze the client-server boundary, you miss service-to-service, database access, third-party integrations, and admin interfaces. Map all boundaries.
- One-time artifact -- Note that threat models should be updated when the architecture changes. Flag sections that are most likely to become stale.
1---2name: create-threat-model3description: Perform STRIDE threat modeling for a system or component when the user asks to threat model, analyze security risks, or identify attack vectors4---5
6# Create Threat Model
7
8## Overview
9
10Generate a STRIDE-based threat model (Microsoft) for a system or component. Identifies trust boundaries from architecture docs, analyzes each boundary for Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, and Elevation of Privilege threats, and recommends mitigations for each identified threat.
11
12## Workflow
13
141. **Read architecture context** -- Scan `.chalk/docs/engineering/` for architecture docs, API designs, data models, and infrastructure descriptions. Check `.chalk/docs/product/` for PRDs that describe the feature's intended behavior. You need to understand the system before modeling threats against it.
15
162. **Parse the target system** -- Extract from `$ARGUMENTS` the system, service, or component to threat model. If unspecified, ask the user to name the scope -- threat modeling the entire system at once is too broad to be useful.
17
183. **Determine the next file number** -- Read filenames in `.chalk/docs/engineering/` to find the highest numbered file. The next number is `highest + 1`.
19
204. **Identify trust boundaries** -- Map the boundaries where data or control crosses between different trust levels: client/server, service/service, internal/external, user/admin, authenticated/unauthenticated. Each boundary is a potential attack surface.
21
225. **Apply STRIDE at each boundary** -- For each trust boundary, analyze:
23 - **Spoofing**: Can an attacker impersonate a legitimate entity?
24 - **Tampering**: Can data be modified in transit or at rest?
25 - **Repudiation**: Can a user deny performing an action without detection?
26 - **Information Disclosure**: Can sensitive data leak to unauthorized parties?
27 - **Denial of Service**: Can the system be made unavailable?
28 - **Elevation of Privilege**: Can a user gain unauthorized access levels?
29
306. **Rate and prioritize** -- For each threat, assess likelihood (low/medium/high) and impact (low/medium/high). Prioritize by risk = likelihood x impact.
31
327. **Recommend mitigations** -- For each threat rated medium or higher, provide a specific, actionable mitigation. Reference existing controls from the architecture docs where applicable.
33
348. **Write the file** -- Save to `.chalk/docs/engineering/<n>_threat_model_<system-slug>.md`.
35
369. **Confirm** -- Share the file path and highlight the top 3 highest-risk threats that need immediate attention.
37
38## Output
39
40- **File**: `.chalk/docs/engineering/<n>_threat_model_<system-slug>.md`
41- **Format**: Plain markdown with trust boundary diagram (text-based), STRIDE analysis table, and prioritized mitigations
42- **First line**: `# Threat Model: <System Name>`
43
44## Anti-patterns
45
46- **Boilerplate threats without system context** -- "SQL injection is a risk" is generic. Tie every threat to a specific trust boundary and data flow in the actual system.
47- **No mitigations** -- A list of threats without mitigations is an anxiety generator, not a security tool. Every medium+ threat needs an actionable mitigation.
48- **Scope too broad** -- Threat modeling "the application" produces shallow results. Scope to a specific component, service, or data flow for actionable depth.
49- **Missing trust boundaries** -- If you only analyze the client-server boundary, you miss service-to-service, database access, third-party integrations, and admin interfaces. Map all boundaries.
50- **One-time artifact** -- Note that threat models should be updated when the architecture changes. Flag sections that are most likely to become stale.