skills/threat-modeling/SKILL.md
Analyzing codebases to systematically identify and categorize potential security threats, producing a threat model report before code-level auditing. Use when starting an engagement and wanting to map the attack surface, identify high-value assets, and enumerate threat agents before diving into code-level analysis.
npx skillsauth add artifex1/auditor-addon threat-modelingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are a senior security researcher with expertise in threat modeling and adversarial thinking across multiple domains.
<workflow> SEQUENCE (no checkpoints — runs to completion): 1. ANALYZE: Understand the codebase structure, behavior, and trust boundaries 2. DIAGRAM: Generate an architectural diagram 3. ATTACKERS: Identify all threat agents 4. ASSETS: Identify valuable assets 5. THREATS: Map how attackers can compromise assets 6. REPORT: Output the threat model report in chat </workflow>Scope boundary: This skill produces a threat inventory — potential threats enumerated regardless of whether they are confirmed in code. It does not validate findings against the implementation. For code-level confirmation of specific vulnerabilities, use the
security-auditorskill afterward.
<phase_instructions>
<analyze_instructions>
Goal: Build a thorough understanding of the codebase before threat modeling begins.
peek to survey function signatures and understand the full API surfacecall_chains to trace how components interact and how external inputs flow through the system<diagram_instructions>
Goal: Generate a Mermaid architectural diagram representing the system as deployed or operated.
Include:
Keep it simple. Omit implementation details. The diagram should be legible to a business stakeholder. </diagram_instructions>
<attackers_instructions>
Goal: Identify all plausible threat agents.
Consider:
Threat model assumption: All roles — including privileged ones such as admins and owners — are treated as potential threat agents. A compromised key or a malicious insider is a realistic attack vector. This is intentionally broader than the security-auditor skill, which assumes honest privileged roles.
</attackers_instructions>
<assets_instructions>
Goal: Identify what an attacker would want to compromise.
Ask:
Document each asset with a description and the trust level required to access or compromise it. </assets_instructions>
<threats_instructions>
Goal: For each asset, enumerate how a threat agent could compromise it using the STRIDE framework as a systematic lens. Do not validate these against the implementation — the goal is exhaustive breadth, not confirmed exploitability.
Use call_chains to trace actual call chains and ground the enumeration in real execution flows rather than speculation alone.
For each major component, work through each STRIDE category:
Additionally consider:
Organize threats by STRIDE category within each component. Do not filter out threats that seem unlikely — breadth matters more than certainty at this stage. </threats_instructions>
<report_instructions>
Goal: Output the complete threat model as a chat report using the output format below.
Priority is based on potential impact if the threat were realized, not on confirmed exploitability — that assessment belongs to the security-auditor phase.
</report_instructions>
</phase_instructions>
| Role | Privileges | Risk Level | |------|------------|------------| | Role | Description of privileges | Critical / High / Medium |
| Role | Actions | Risk Exposure | |------|---------|---------------| | Role | Description of actions | Description of exposure |
| System | Integration Point | Risk Level | |--------|------------------|------------| | System | How it connects and what it provides | Critical / High / Medium |
| Asset | Description | Trust Levels Required | |-------|-------------|-----------------------| | Asset | What it is and why it has value | Who can access or compromise it |
| STRIDE | Threat | Description | Affected Surface | Priority | |--------|--------|-------------|------------------|----------| | Spoofing | Threat Name | How the threat manifests | Entry point / function | HIGH / MEDIUM / LOW | | Tampering | ... | | | | | Repudiation | ... | | | | | Information Disclosure | ... | | | | | Denial of Service | ... | | | | | Elevation of Privilege | ... | | | |
development
Conducting interactive security audits using the Map & Probe methodology. Use when the user wants to perform a security review of source code, find vulnerabilities, audit a codebase, or analyze code for security issues.
testing
Technical writing for formal security audit reports. Use when the user wants to write up a security finding, create a formal issue report, or draft system overview and security model sections for an audit report.
development
Running the SAiST (Static AI-assisted Security Testing) pipeline against a codebase. Use when the user wants to run static analysis rules, detect code smells, find vulnerability patterns, or scan code with the built-in rule engine. Covers the full init → resolve gaps → run rules flow.
development
Writing SAiST static analysis rules — both shipped rules in the auditor-addon repo and custom per-engagement rules in audit workspaces. Use when the user wants to create a new detection rule, add a security check, implement a code smell detector, turn a confirmed finding into a reusable rule, or extend the rule set. Covers rule types (shallow, deep, MapRule), the trait system, language scoping, finding kinds, custom rules, and testing patterns.