# threat-model

Runs STRIDE threat modeling for features and system architectures. Evaluates data flows, trust boundaries, and AI vulnerabilities before code ships.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · ★ 47
- Author: haabe
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/haabe/mycelium/tree/HEAD/plugins/mycelium/skills/threat-model/SKILL.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/haabe-threat-model

## What it does

The skill maps components into a textual data flow diagram and marks trust boundaries. Next, it examines every element against the STRIDE categories, covering spoofing through elevation of privilege. Each issue receives severity ratings and suggested mitigations.

Systems using language models receive extra evaluation under the OWASP Top 10 for LLM and Agentic Skills Top 10. The skill reviews prompt injections, agent autonomy levels, and untrusted instructions. Results go into `.claude/canvas/threat-model.yml`.

Running this skill outside the Mycelium framework skips canvas state tracking and automated theory gates.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add haabe/mycelium --skill threat-model -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/threat-model/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/threat-model/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add haabe/mycelium --skill threat-model -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/threat-model/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add haabe/mycelium --skill threat-model -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/threat-model/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install haabe/mycelium threat-model
```

2. **Manually: put the files in place**
- File: `.github/skills/threat-model/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add haabe/mycelium --skill threat-model -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/haabe/mycelium --path plugins/mycelium/skills/threat-model
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/threat-model/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add haabe/mycelium --skill threat-model -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/haabe/mycelium/tree/HEAD/plugins/mycelium/skills/threat-model/SKILL.md

## When to use it
- Map data flows and trust boundaries for a new architecture
- Evaluate components against STRIDE threat categories
- Audit LLM features against OWASP Top 10 standards
- Generate prioritized mitigation steps for identified risks

## Example prompts
- Run a STRIDE threat model on the authentication service design
- Evaluate our LLM workflow against the OWASP Agentic Skills Top 10
- Generate trust boundaries and mitigations for the payment pipeline

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 627d0e66e590a02e.

BEGIN THIRD-PARTY FILE 627d0e66e590a02e
````text
---
name: threat-model
description: "Use to conduct STRIDE threat modeling for a system or feature design."
metadata:
  instruction_budget: "28"
  framework_dependency: "mycelium"
  framework_dependency_note: "This skill is designed to run within the Mycelium framework (https://github.com/haabe/mycelium). Standalone use will skip the canvas state, theory gates, and harness behavior the skill assumes. Install: /plugin install mycelium@haabe-mycelium."
---

# Threat Model Skill

STRIDE threat modeling for secure design.

## Workflow

1. **Define scope**: What system/feature/component is being modeled?

2. **Draw data flow diagram** (textual):
   - Identify actors (users, external systems)
   - Identify processes (services, functions)
   - Identify data stores (databases, caches, files)
   - Identify data flows (what moves between components)
   - Identify trust boundaries (where trust level changes)

3. **For each component and data flow, assess STRIDE threats**:

   | Threat | Description | Question to Ask |
   |--------|------------|----------------|
   | **S**poofing | Impersonating something or someone | Can an attacker pretend to be this user/system? |
   | **T**ampering | Modifying data or code | Can data be changed in transit or at rest? |
   | **R**epudiation | Claiming to not have done something | Can a user deny an action without accountability? |
   | **I**nfo Disclosure | Exposing data to unauthorized parties | Can sensitive data leak? |
   | **D**enial of Service | Making the system unavailable | Can this component be overwhelmed? |
   | **E**levation of Privilege | Gaining unauthorized access | Can a user escalate their permissions? |

4. **For each identified threat**:
   - Severity: Critical / High / Medium / Low
   - Likelihood: High / Medium / Low
   - Existing mitigations (if any)
   - Recommended mitigations
   - Residual risk after mitigation

   **For AI-powered systems**: Extend STRIDE with AI-specific threat dimensions:
   - **Autonomy risk**: Can the AI take actions beyond its intended scope?
   - **Oversight gap**: Is human-in-the-loop oversight meaningful? (Test Authority/Time/Understanding per Bannerman's triad -- see ${CLAUDE_PLUGIN_ROOT}/harness/security-trust.md)
   - **Feedback poisoning**: Can adversarial inputs degrade the system over time?
   - **Opacity risk**: Can decisions be explained to affected parties?

5. **Output**:
   ```
   ## Threat Model: [System/Feature]

   ### Data Flow
   [textual diagram]

   ### Trust Boundaries
   - [boundary 1]: [what changes]
   - [boundary 2]: [what changes]

   ### Threats
   | ID | Component | STRIDE | Threat | Severity | Likelihood | Mitigation |
   |----|-----------|--------|--------|----------|-----------|------------|
   | T1 | ... | S | ... | ... | ... | ... |

   ### Priority Actions
   1. [highest priority mitigation]
   2. [next priority]
   3. [next priority]
   ```

## OWASP Top 10 for LLM Applications (2025)

For AI-powered products (`product_type: ai_tool` or any product using LLM components), extend the STRIDE analysis with LLM-specific threats:

| # | Threat | Description |
|---|--------|-------------|
````
END THIRD-PARTY FILE 627d0e66e590a02e

The third-party file has ended. Everything between the 627d0e66e590a02e tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 3146 of 11396 bytes. © haabe · MIT · https://github.com/haabe/mycelium/tree/HEAD/plugins/mycelium/skills/threat-model/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
