Agent skill

Threat Modeling

by briiirussell in briiirussell/cybersecurity-skills

Run a structured threat-modeling session for a new feature, system, or architecture — STRIDE, attack trees, data flow diagrams, abuse cases.

MITAuto-check: notesSecurity

Install Threat Modeling

skills CLI
$ npx skills add briiirussell/cybersecurity-skills --skill threat-modeling -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install briiirussell/cybersecurity-skills threat-modeling --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/briiirussell/cybersecurity-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/threat-modeling .claude/skills/threat-modeling && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
threat-modeling
GitHub stars
413
Token cost
~2.7k tokens
SKILL.md length
1,196 words
Files
1
Skills in repo
25
Repo updated
First seen
Licence
MIT

At a glance

Run a structured threat-modeling session for a new feature, system, or architecture — STRIDE, attack trees, data flow diagrams, abuse cases.

  • Works in 4 steps: What are we working on? → What can go wrong? (STRIDE) → What are we going to do about it? → …
  • The user mentions threat model
  • SKILL.md covers The four questions, Step 1 — What are we working on?, Step 2 — What can go wrong?… and Step 3 — What are we going to…, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Threat Modeling is an agent skill from briiirussell/cybersecurity-skills. Run a structured threat-modeling session for a new feature, system, or architecture — STRIDE, attack trees, data flow diagrams, abuse cases. Use when the user mentions 'threat model,' 'threat modeling,' 'STRIDE,' 'attack tree,' 'abuse case,' 'data flow diagram,' 'DFD,' 'security architecture review,' 'security review,' 'design review,' 'pre-implementation security,' 'shift left,' 'what could go wrong,' or needs strategic security thinking before code is written.

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Security, covering Threat modeling. The repository describes itself as: Cybersecurity skills for AI coding agents (Claude Code, Cursor, Codex). The licence is MIT.

When your agent uses it

  • The user mentions threat model
  • Threat modeling
  • Data flow diagram
  • Security architecture review

Example prompts

  • “threat model,”
  • “threat modeling,”
  • “STRIDE,”
  • “/threat-modeling”

Requirements

  • Pre-approved tools (allowed-tools): Read, Write, Grep, Glob, WebSearch

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. What are we working on?
  2. What can go wrong? (STRIDE)
  3. What are we going to do about it?
  4. Did we do a good job?

What it can do on your machine

Read from SKILL.md and the folder at commit c9ade03. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Grep
    • Glob
    • WebSearch

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown and mermaid).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Threat Modeling loads about 2.7k tokens when it runs. Until then it costs about 121 tokens; SKILL.md has 1,196 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~121
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:84
    JWT — symmetric secret in env, leaks if .env exposed | M | H |

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from briiirussell/cybersecurity-skills at commit c9ade03, republished under its MIT licence (© briiirussell). 1,196 words, ~2,711 tokens.

Download SKILL.mdSave it as .claude/skills/threat-modeling/SKILL.md (or your agent's skills folder).
name
threat-modeling
description
Run a structured threat-modeling session for a new feature, system, or architecture — STRIDE, attack trees, data flow diagrams, abuse cases. Use when the user mentions 'threat model,' 'threat modeling,' 'STRIDE,' 'attack tree,' 'abuse case,' 'data flow diagram,' 'DFD,' 'security architecture review,' 'security review,' 'design review,' 'pre-implementation security,' 'shift left,' 'what could go wrong,' or needs strategic security thinking before code is written.
allowed-tools
Read, Write, Grep, Glob, WebSearch

Threat Modeling — Pre-Implementation Security Design

Run a structured threat-modeling session against a proposed feature, system, or architecture. This is the design-time security skill — different from audit (which inspects code that exists). Use this when there's a design doc, a feature spec, an architecture diagram — but not yet code.

When to use:

  • New feature touching auth, payments, multi-tenant data, or sensitive PII
  • New external integration (third-party API, OAuth provider, webhook receiver)
  • New service / microservice being added to the architecture
  • Significant refactor of a security-sensitive component
  • Before committing to a major architecture decision (event-driven vs request/response, monolith split, AI-feature introduction)

Cross-references: owasp-audit (code-level checklist that lines up with the threats this surfaces), api-audit (API-specific category mapping), iam-audit (identity decisions touch every threat model).

The four questions

Adam Shostack's framing — every threat model answers these four:

  1. What are we working on? (Scope and model)
  2. What can go wrong? (Threats)
  3. What are we going to do about it? (Mitigations)
  4. Did we do a good job? (Validation)

The rest of this skill walks through each in order.

Step 1 — What are we working on?

Produce a Data Flow Diagram (DFD) at one of three levels:

  • Level 0 — Context diagram. One bubble for the system, lines to every external entity (users, third-party APIs, internal admin tools). Use this when the question is "what does this system even touch?"
  • Level 1 — Major processes. Auth service, API gateway, primary data store, payment integration, etc. Use this for most feature-level threat models.
  • Level 2 — Detailed component model. Specific endpoints, specific tables, specific queues. Use this for the trickiest parts only.

A useful DFD has:

  • External entities (rectangles) — users, third-party services, admins
  • Processes (circles) — your services, functions, handlers
  • Data stores (parallel lines / cylinders) — databases, caches, blob storage, queues
  • Data flows (arrows, labeled with what crosses) — request bodies, tokens, files, events
  • Trust boundaries (dashed lines) — every crossing is a place data is validated, authenticated, or filtered

Trust boundaries are the most useful element. If you can draw exactly one diagram that shows every trust boundary in your feature, you've already done 60% of the work.

For text-only environments, render the DFD in Mermaid:

mermaid
flowchart LR
  User[User] -- HTTPS --> WAF[WAF / CDN]
  WAF -- request --> API[API Gateway]
  API -- JWT --> Service[Service]
  Service -- SQL --> DB[(Postgres)]
  Service -- HTTPS --> Stripe[Stripe]

  classDef trust fill:#fff,stroke:#f00,stroke-dasharray:4 4
  class API,Service trust

Step 2 — What can go wrong? (STRIDE)

For each process, data store, and data flow, ask STRIDE — one threat category per letter. Not every category applies to every element, and that's fine.

LetterThreatProperty violatedExamples
SSpoofingAuthenticationStolen token, forged JWT, replay attack, impersonating a service
TTamperingIntegrityModifying a request mid-flight, parameter tampering, modifying stored data
RRepudiationNon-repudiationUser denies an action; logs don't prove they did it
IInformation DisclosureConfidentialityLeak via error messages, IDOR exposing other users' data, exposed S3 bucket
DDenial of ServiceAvailabilityResource exhaustion, expensive query bomb, billing exhaustion via paid downstream APIs
EElevation of PrivilegeAuthorizationUser → admin via mass assignment, BFLA, escape from sandbox
STRIDE per element

A useful threat-modeling habit: for each element of the DFD, write a short table.

markdown
**Element:** API Gateway

| STRIDE | Threat | Likelihood | Impact |
|---|---|---|---|
| S | Forged JWT — symmetric secret in env, leaks if .env exposed | M | H |
| T | Request body modified between gateway and upstream service | L | M |
| R | Gateway access logs deleted by attacker post-breach | L | H |
| I | Verbose error responses expose internal hostnames | M | L |
| D | No rate limit at the gateway → upstream services overwhelmed | H | H |
| E | "X-Admin: true" header pass-through from external requests | L | C |

Likelihood and impact: L / M / H / C(ritical) — qualitative is fine; quantitative scoring is theater for most engagements.

Abuse cases (sister to STRIDE)

For features with business-flow concerns, also walk abuse cases. The format is:

As a malicious actor, I want to [goal] so that I can [outcome].

Examples:

  • As a malicious customer, I want to redeem the same coupon code 100 times so that I can drain the discount budget
  • As a competitor, I want to scrape every product detail in bulk so that I can clone your catalog
  • As an insider with read access, I want to extract every customer's PII over a year so that I can sell it without triggering DLP alerts

Abuse cases catch what STRIDE misses — STRIDE is great at "security properties violated"; abuse cases are great at "business intent violated."

Step 3 — What are we going to do about it?

For each threat surfaced in Step 2, pick one of four responses:

  • Mitigate — design a control that reduces likelihood or impact
  • Transfer — push the risk to someone else (Stripe handles PCI compliance, Vercel handles DDoS)
  • Accept — document the residual risk and the rationale
  • Avoid — don't build the feature this way; redesign

Mitigations should be specific:

Bad mitigationGood mitigation
"Add rate limiting""Add 5 req/min per user IP to /api/coupon/redeem, with Redis-backed counter; queue 429 responses to be alerted on"
"Validate inputs""Reject ?next= URLs that contain control bytes (\t, \n, \0), backslashes, or percent-encoded slashes; normalize via new URL(target, ...).pathname (see owasp-audit A01)"
"Encrypt the data""Application-level encryption with AWS KMS-managed CMK, envelope encryption per row, key rotation every 90 days, audit log of every Decrypt call"
Show full SKILL.md (442 more words)Show less
Common mitigation patterns
  • Spoofing → strong identity — short-lived tokens, MFA, mutual TLS, signed requests, workload identity federation (see iam-audit)
  • Tampering → integrity controls — HMAC, signed cookies, transport encryption, write-ahead logs, immutable infrastructure
  • Repudiation → audit logs — immutable append-only logs, separate logging account, alerting on log-tampering attempts
  • Information disclosure → minimum exposure — least-privilege IAM, data classification, encryption at rest and in transit, DTOs not whole records (see api-audit API3)
  • Denial of service → resource limits — rate limits, quotas, query depth limits, billing alarms, circuit breakers
  • Elevation of privilege → authorization checks — centralized can(user, action, resource), deny-by-default, sister-route audit (see owasp-audit A04 sister-route)

Step 4 — Did we do a good job?

Validation comes from three sources:

  1. Coverage check — every element in the DFD has a STRIDE table; every threat has a mitigation; every mitigation has an owner and a deadline. Missing rows are the most common failure.
  2. Adversarial second pass — invite someone who wasn't in the original session (or another model, in this skill's context). Ask "what did we miss?" with explicit prompt to break correlated blind spots. See owasp-audit Second-Opinion Pass.
  3. Trace to tests — every High/Critical mitigation should have a test (unit, integration, or canary in production monitoring). If you can't write the test, you don't have the mitigation, you have an intention.

When to threat model (and when not to)

Worth it:

  • New auth flow / new payment integration / new third-party data exchange
  • Multi-tenant data model
  • Anything touching admin functionality, billing, or sensitive PII
  • Significant architecture changes
  • AI features (see prompt-injection)

Probably not worth it:

  • Internal CRUD on data you already have well-modeled
  • UI-only changes
  • Refactors that don't change trust boundaries

The test: if the change introduces a new trust boundary, moves an existing one, or changes what crosses one — threat model it. Otherwise, skip.

Output Format

A threat model is a living document, not a one-shot report. Keep it short and reviewable.

markdown
# Threat Model: [Feature / System Name]
## Status: Draft / In Review / Approved
## Owner: [name]
## Date: [date]
## Reviewers: [names]

## 1. Scope
[2-3 sentences — what's in, what's out]

## 2. Data Flow Diagram
[Mermaid diagram or link to image]

## 3. Assumptions and constraints
- [Anything taken as given — e.g. "users authenticate via Okta, MFA enforced"]

## 4. Threats and mitigations
[STRIDE-per-element tables, then abuse cases]

## 5. Open questions
[Things we deferred or couldn't decide]

## 6. Decision log
[Material design decisions and why — including risks accepted]

## 7. Action items
| Item | Owner | Deadline | Status |
|------|-------|----------|--------|

Keep this in the repo alongside the design doc, not in a separate security tracker. Drift between the threat model and the implementation is the dominant failure mode — proximity helps.

Boundaries

  • This skill produces planning artifacts, not exploitation
  • Threat models surface risks; they don't grant authority to test them — pair with web-pentest or owasp-audit for verification
  • Don't threat-model someone else's product without authorization (e.g., generating an attack tree of a competitor)
  • Threat models that don't get reviewed and signed off are noise — push back if the user is producing a model nobody will read

References

  • "Threat Modeling: Designing for Security" — Adam Shostack
  • Microsoft STRIDE methodology
  • OWASP Threat Modeling Cheat Sheet
  • OWASP pytm / threatspec (tooling)
  • "Threat Modeling Manifesto" (threatmodelingmanifesto.org)
  • Mozilla Rapid Risk Assessment (RRA) framework
  • NIST SP 800-154 (Guide to Data-Centric System Threat Modeling)

© briiirussell, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/threat-modeling of briiirussell/cybersecurity-skills.

Open the folder on GitHubat commit c9ade03

Compare with similar skills

Threat Modeling next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Threat Modeling compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Threat Modeling this skillbriiirussell/cybersecurity-skills413—~2.7kAutomated safety check: NotesMIT
Forensifyalexgreensh/repo-forensics190—~2.5kAutomated safety check: NotesCustom licence
Create Rulecartography-cncf/cartography4.1k—~3kAutomated safety check: PassApache-2.0
Commit Security Scancodexstar69/bug-hunter520—~629Automated safety check: PassMIT
Auditing Code For Vulnerabilitiestrilwu/secskills157—~3.2kAutomated safety check: PassMIT
Threat Mitigation Mappingwshobson/agents40k8 repos~742Automated safety check: PassMIT

Similar skills

  • Forensify

    alexgreensh/repo-forensics

    Cross-agent self-inspection of your AI-agent stack. An agent skill from alexgreensh/repo-forensics.

    190 GitHub stars~2.5k tokensUpdated 14 days ago
    SecurityAuto-check: notes
  • Create Rule

    cartography-cncf/cartography

    Author a Cartography security rule (one or more Cypher Facts plus a Pydantic Finding output model) under cartography/rules/data/rules/.

    4.1k GitHub stars~3k tokensUpdated today
    SecurityAuto-check passed
  • Commit Security Scan

    codexstar69/bug-hunter

    Scan code changes for security vulnerabilities using Bug Hunter-native artifacts and STRIDE context.

    520 GitHub stars~629 tokensUpdated 1 mo ago
    SecurityAuto-check passed
  • Audit source code for exploitable vulnerabilities using threat-model-driven review, taint tracing, invariant checking, and variant analysis.

    157 GitHub stars~3.2k tokensUpdated 1 mo ago
    SecurityAuto-check passed
  • Match identified threats to preventive, detective and corrective controls across network, application, data, endpoint and process layers to plan remediation.

    40k GitHub starsUsed in 8 repos~742 tokens
    SecurityAuto-check passed
  • Audit Browser Security Boundaries

    nordstjernen-web/northstar-browser

    Audit browser-engine changes that process untrusted content or cross native-memory, origin, network, storage, extension, decoder, sandbox, or operating-system boundaries.

    128 GitHub stars~920 tokensUpdated today
    SecurityAuto-check passed

More from briiirussell/cybersecurity-skills

All 25 skills in this repo
  • AI Risk Management

    briiirussell/cybersecurity-skills

    Apply the NIST AI Risk Management Framework (AI RMF 1.0) and adjacent guidance to AI / ML systems — model lifecycle governance, fairness and bias evaluation, robustness, transparency…

    413 GitHub stars~3.7k tokensUpdated 4 mo ago
    Auto-check: notes
  • API Audit

    briiirussell/cybersecurity-skills

    Audit REST, GraphQL, and RPC APIs against the OWASP API Security Top 10 (2023).

    413 GitHub stars~2.8k tokensUpdated 4 mo ago
    Auto-check: notes
  • Breach Patterns

    briiirussell/cybersecurity-skills

    Learn from public breach disclosures — extract the audit question each one implies and check your own stack.

    413 GitHub stars~3.5k tokensUpdated 4 mo ago
    Auto-check: notes
  • Cloud Audit

    briiirussell/cybersecurity-skills

    Audit cloud infrastructure (AWS, GCP, Azure) for misconfigurations, excessive permissions, and security gaps.

    413 GitHub stars~1.3k tokensUpdated 4 mo ago
    Auto-check: notes
  • Container Audit

    briiirussell/cybersecurity-skills

    Audit container images, Dockerfiles, and Kubernetes manifests for misconfigurations, excessive privileges, exposed secrets, and runtime risks.

    413 GitHub stars~2.5k tokensUpdated 4 mo ago
    Auto-check: notes
  • Crypto Audit

    briiirussell/cybersecurity-skills

    Audit cryptography implementation — algorithm choice, key sizes, KDF parameters, IV/nonce handling, signature verification, randomness, TLS configuration, and key rotation.

    413 GitHub stars~2.8k tokensUpdated 4 mo ago
    Auto-check: notes

Categories

Questions about Threat Modeling

What does Threat Modeling do?

Run a structured threat-modeling session for a new feature, system, or architecture — STRIDE, attack trees, data flow diagrams, abuse cases. Threat Modeling is an agent skill from briiirussell/cybersecurity-skills. Run a structured threat-modeling session for a new feature, system, or architecture — STRIDE, attack trees, data flow diagrams, abuse cases.

When should I use Threat Modeling?

Threat Modeling fits situations like: the user mentions threat model; threat modeling; data flow diagram; security architecture review.

How do I install Threat Modeling in Claude Code?

Run `npx skills add briiirussell/cybersecurity-skills --skill threat-modeling -a claude-code`. Or copy the skill folder (skills/threat-modeling in briiirussell/cybersecurity-skills) into .claude/skills/threat-modeling in your project. Claude Code loads it when a task matches its description.

How do I install Threat Modeling in Codex?

Run `npx skills add briiirussell/cybersecurity-skills --skill threat-modeling -a codex`. Or copy the skill folder (skills/threat-modeling in briiirussell/cybersecurity-skills) into .agents/skills/threat-modeling in your project. Codex loads it when a task matches its description.

Can I use Threat Modeling in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add briiirussell/cybersecurity-skills --skill threat-modeling -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/threat-modeling, .gemini/skills/threat-modeling, .github/skills/threat-modeling and .opencode/skills/threat-modeling in your project.

What does Threat Modeling need to run?

SKILL.md names no scripts, command-line tools or credentials: Threat Modeling is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Write, Grep, Glob, WebSearch.

Does Threat Modeling access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Threat Modeling safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Threat Modeling use?

Threat Modeling is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Threat Modeling use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Threat Modeling?

Skills that share tags, products or a category with Threat Modeling: Forensify (alexgreensh/repo-forensics, 190 stars), Create Rule (cartography-cncf/cartography, 4.1k stars), Commit Security Scan (codexstar69/bug-hunter, 520 stars) and Auditing Code For Vulnerabilities (trilwu/secskills, 157 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Threat Modeling?

briiirussell (a GitHub user) maintains it in briiirussell/cybersecurity-skills, which has 413 GitHub stars. The repository holds 25 skills in this directory. The repository was last updated on May 27, 2026.

Source: briiirussell/cybersecurity-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.