Threat Modeling logo

Threat Modeling

Community
arozumenko
threat-modeling

Use when deriving a data-flow diagram and STRIDE threats from code, with a citation per element and mitigations recorded as claims a fresh reviewer can confirm or refute; provides the threat-model.json shape cite.mjs check validates.

Overview

Publisherarozumenko
Repositorysdlc-skills
Skill namethreat-modeling
Stars
26
Forks
10
Bundled files
4
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by arozumenko on GitHub. Read the source before you install it.

Installation

Install the Threat Modeling AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/arozumenko/sdlc-skills/tree/main/bundles/security-testing/skills/threat-modeling
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/arozumenko/sdlc-skills.git /tmp/sdlc-skills
mkdir -p .claude/skills
cp -r /tmp/sdlc-skills/bundles/security-testing/skills/threat-modeling .claude/skills/threat-modeling
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Threat Modeling in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Threat Modeling on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Threat Modeling is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Threat modeling

You write a code-derived DFD and STRIDE threats with citations; cite.mjs check <st>/threat-model.json re-reads every citation against the bytes at head and validates the disposition grammar — everything else is your judgement. Three rules hold everywhere:

  1. An element or a mitigation exists only because it is cited. Same citation shape as a finding's (references/dfd-elements.md), same FAILED <locus>.<i> <why> vocabulary.
  2. A mitigation is a claim, not a fact (references/mitigations-as-claims.md) — you never grade your own claim; a fresh security-reviewer's mitigation-review does, and even that never rewrites the model.
  3. You assign every element's, threat's and mitigation's own id (E-nnn/T-nnn/M-nnn) yourself; never write state, oid, snippet_redacted or check_stamp — check stamps those, and refuses a file carrying them from your hand (D10), the same rule as findings. id anywhere but element/threat/mitigation position is refused there too.

The shape

{ head?, elements: [{id, name, kind, citations}], threats: [{id, element_id, stride, title, mitigations, disposition}] }.

json
{
  "elements": [
    { "id": "E-001", "name": "HTTP handler", "kind": "process",
      "citations": [{ "path": "src/app.js", "lines": [1, 3], "snippet": "…" }] },
    { "id": "E-002", "name": "Orders table", "kind": "datastore",
      "citations": [{ "path": "src/orders.js", "lines": [40, 45], "snippet": "…" }] }
  ],
  "threats": [
    { "id": "T-001", "element_id": "E-002", "stride": "T",
      "title": "Order total tampered before it is charged",
      "mitigations": [
        { "id": "M-001", "claim": "createOrder recomputes the total from line items (lines 40-52)",
          "citations": [{ "path": "src/orders.js", "lines": [40, 52], "snippet": "…" }] }
      ],
      "disposition": "mitigated(M-001)" }
  ]
}
  • kind ∈ external | boundary | process | datastore | flow (references/dfd-elements.md — which letters apply to which kind is in references/stride.md).
  • stride ∈ S | T | R | I | D | E, one letter per threat.
  • disposition ∈ open | accepted(R-nnnn) | mitigated(M-nnn) | planned(TC-nnn) | out-of-scope(<reason>) — the full grammar, what each ref must name and the one-run sequence are in references/dispositions.md.
  • ids (E-nnn, T-nnn, M-nnn) are unique across the whole model, not just within their array.

Procedure

  1. Read engagement.md's scope_paths — what you may cite.
  2. Enumerate entry points — routers, handlers, consumers, schedulers.
  3. Elements, one citation each — external/process at entry points, boundary at trust changes, datastore/flow at sinks and moves (references/dfd-elements.md § Where to start).
  4. STRIDE per element — only the letters references/stride.md's table marks for that kind; one threat per effect.
  5. Mitigations as cited claims — a sentence a reviewer can confirm or refute from the citation alone (references/mitigations-as-claims.md).
  6. Dispositions — the one you can justify now; mitigated(M-nnn) only when the mitigation is already in the model under that threat.
  7. cite.mjs check <st>/threat-model.json.
  8. Fix TM-INVALID — the locus and the missing relationship name what to correct; edit threat-model.json and check again.
  9. Candidate passive cases — when a threat is worth an admitted test, draft it (never admit it yourself — that is the lead's cases.mjs admit) at .agents/security-testing/cases/TC-NNN_<slug>.md, id: TC-NNN, a # heading as its title. A planned(TC-nnn) disposition only validates once the lead has admitted it.

Result lines you will see

  • FAILED <locus>.<i> <why> — why ∈ bad-shape, path-not-in-scope, range-over-40, not-in-tree, snippet-not-found.
  • TM-INVALID <locus>: <why> — a structural or disposition defect, one per line, in document order (references/dispositions.md).
  • MODEL elements=<n> threats=<n> open=<n> then CHECK verified=<n> failed=<n> — printed on every run; exit 4 on any FAILED/TM-INVALID, else 0.
  • --md after those: the elements/threats/mitigations tables, then TABLES sha256=<hex>.

Your return line

cite.mjs check exits 0, no TM-INVALID lines ⇒ MODEL_WRITTEN elements=<n> threats=<n> open=<n> (the counts from the MODEL line). Anything else ⇒ the TM-INVALID lines verbatim — fix what they name and check again before you reply if you can.

Commands

node scripts/cite.mjs --help (from secure-code-review/scripts/, the only script this skill uses):

usage: cite <command> [options]

commands:
  init
  show
  check
  redact

show <path> [start end] [--at <oid>] for reading; check <threat-model.json> [--md [--no-snippets]] for validating; see secure-code-review/SKILL.md for init and redact. Every string printed or written is redacted (D9); the file is rewritten with check_stamp and, per citation, state, oid, snippet_redacted — never edit a stamped file by hand (REFUSED agent-written key <key>); fix the unstamped source and let the lead re-run check.

References

references/dfd-elements.md (the five kinds, the citation), references/stride.md (the six letters, which apply to which kind), references/mitigations-as-claims.md (the claim shape, the mitigation-review contract), references/dispositions.md (the five-value grammar, the failure format, the one-run sequence).

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Threat Modeling AI skill do?

Use when deriving a data-flow diagram and STRIDE threats from code, with a citation per element and mitigations recorded as claims a fresh reviewer can confirm or refute; provides the threat-model.json shape cite.mjs check validates.

Why use Threat Modeling on TypingMind?

Because you install it once and use it with any model. Threat Modeling is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Threat Modeling in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/arozumenko/sdlc-skills/tree/main/bundles/security-testing/skills/threat-modeling. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Threat Modeling?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Threat Modeling?

As many as you like. As long as a model supports skills, you can use Threat Modeling with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Threat Modeling AI skill free?

Yes. It is published on GitHub by arozumenko under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇