agentleFS
0xrafasec0xrafasec/ai-workflow/skills/threat-model/SKILL.md

threat-model

Skill9 starsChanged 20 days agoMITView on GitHub

Create or update docs/THREAT_MODEL.md — a STRIDE-style design-level threat model with trust boundaries, attack surface, threats and mitigations. Use when the user asks for a threat model, an attack-surface analysis or a STRIDE pass, or says 'what could go wrong security-wise', 'identify the threats', 'lock this down before launch'. For reviewing a specific diff or branch, use the built-in /security-review instead.

62 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use vuln-scan, supply-chain-review and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • AnthropicSkill

    vuln-scan

    Static source-code vulnerability scan. Reads a target directory (and THREAT_MODEL.md if present), spawns parallel review subagents per focus area, and writes VULN-FINDINGS.json + .md for /triage to consume. Read-only — no building, running, or network. For execution-verified crashes, use vuln-pipeline instead. Use when asked to "scan for vulns", "review this code for security issues", "find bugs in <dir>", or as the step between /threat-model and /triage.

    Also in 5 projects that use this

  • MesteriisSkill

    supply-chain-review

    Reviews lockfiles, installers, provenance, CI permissions, dependency confusion, artifacts, registries, and publishing.

    Also in 3 projects that use this

  • AnthropicSkill

    patch

    Generate candidate fixes for verified security findings. Consumes

    Also in 4 projects that use this

  • shihwesleySkill

    orbit

    This skill should be used when the user says '/orbit', '/orbit init', '/orbit status', '/orbit test', '/orbit staging', '/orbit use', '/orbit sidecars', '/orbit logs', '/orbit stop', '/orbit check', '/orbit templates', asks about environment status or switching, wants to run tests in Docker containers, needs to manage dev/test/staging environments, or asks about sidecar services like PostgreSQL or Redis for their project.

    Also in 3 projects that use this

  • mbwsimsSkill

    test-plan

    This skill should be used when the user asks to "plan tests", "what should I test", "what tests do I need", "test plan for", "testing strategy for", "test matrix for", "what cases should I cover", "help me plan tests", mentions "/test-plan", or wants to understand what tests are needed before writing any test code.

    Also in 3 projects that use this

  • Sagargupta16Skill

    dependency-audit

    Audit project dependencies for security vulnerabilities, licensing issues, maintenance health, and optimization opportunities. Use it during regular security audits (monthly or quarterly); before a major release when you want to ensure the dependency tree is clean; when evaluating whether to adopt or replace a dependency; after a security advisory affects one of your dependencies; when your install times or bundle sizes have grown noticeably.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 55 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create or update the threat model.

    line 6
  2. Distinctive:

    Before interviewing, understand the system's security surface:

    line 12
  3. Very specific:

    Read docs/THREAT_MODEL.md — if revising, don't start from scratch

    line 15
  4. Very specific:

    Read docs/ARCHITECTURE.md for system structure and trust boundaries

    line 16
  5. Distinctive:

    Read the project's agent instructions (CLAUDE.md or AGENTS.md) and README.md

    line 17
  6. Very specific:

    No architecture doc? → "Define system structure with /wf:architecture"

    line 92

“Common” is measured: kept by at least 6 in 10 of the 55 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Create or update the threat model. Argument: $ARGUMENTS (an optional focus area; update only that part and leave the rest)

In hosts that do not substitute $ARGUMENTS (e.g. Codex), it is the text the user wrote after the skill name.

Context Gathering

Before interviewing, understand the system's security surface:

  1. Check for existing docs:
    • Read docs/THREAT_MODEL.md — if revising, don't start from scratch
    • Read docs/ARCHITECTURE.md for system structure and trust boundaries
    • Read the project's agent instructions (CLAUDE.md or AGENTS.md) and README.md
  2. Survey the codebase for auth, input handling, data access (raw SQL vs parameterized), secrets, exposed endpoints and service exposure (docker-compose.yml, deployment config).
  3. Summarize what you found — "Here's what I see from a security perspective: ..."

Interview

Use AskUserQuestion, asking only what the code and docs do not answer, in rounds of at most 3-4 questions. Where AskUserQuestion is unavailable but the user can answer in chat (e.g. Codex), ask the same question in chat as a short numbered list and wait for the answer; a headless run or a dispatched agent has no such user, and the headless rule applies instead. If the user cannot be asked (a headless run), write from what exists and list each assumption as an open question.

  1. Trust boundaries — What is trusted? What is untrusted? Where are the boundaries?
  2. Authentication — How do users/agents/services prove identity? What mechanisms exist today?
  3. Authorization — Who can do what? How are permissions modeled?
  4. Sensitive data — What data is sensitive? Credentials, PII, financial? Where does it live? How is it protected at rest and in transit?
  5. Attack surface — What is exposed to the internet? To local users? To other services? What inputs does the system accept?
  6. Threat actors — Who would attack this? Script kiddies, insiders, nation states? What are their capabilities?
  7. Compliance — Any regulatory requirements? SOC2, GDPR, HIPAA, PCI? (skip if none apply)
  8. Existing security measures — What's already in place? What's missing?

For inherited projects: "I see you're using X for auth — is that intentional or legacy? I notice Y has no input validation — is that a known gap?"

Write

Write to docs/THREAT_MODEL.md:

# Threat Model

**Last updated:** [date]

## Trust Assumptions

[What is the trust model? What is trusted, what is untrusted? Include a Mermaid diagram of the trust hierarchy.]

## Security Properties

[Non-negotiable security invariants. Things that must always hold.]

- [Property 1]
- [Property 2]

## Attack Surface

| Surface | Exposure | Controls |
|---------|----------|----------|
| [surface] | [who can reach it] | [what protects it] |

## Threats

[Walk each trust boundary and data flow through S/T/R/I/D/E (spoofing, tampering, repudiation, information disclosure, denial of service, elevation of privilege); omit categories that do not apply. If a control cannot be confirmed from the code, mark it `unverified`, never `implemented`.]

### [Component or flow]

| # | STRIDE | Attack | Impact | Likelihood | Defense | Status |
|---|--------|--------|--------|------------|---------|--------|
| 1 | [S/T/R/I/D/E] | [attack description] | [what happens] | [Low/Med/High] | [how it's prevented] | [implemented / unverified / missing] |

## Sensitive Data Inventory

| Data | Classification | At Rest | In Transit | Access Control |
|------|---------------|---------|------------|----------------|
| [data type] | [level] | [protection] | [protection] | [who can access] |

## Gaps (not yet implemented)

- [Control — what it protects against — priority]

## Compliance Requirements

[Only if applicable. Regulatory frameworks, what they require, current status.]

After Writing

  1. Present the document to the user for review. Iterate until they're satisfied.
  2. Suggest next steps based on what exists:
    • No architecture doc? → "Define system structure with /wf:architecture"
    • Ready to plan the build? → "Run /wf:roadmap, then /wf:spec <task> per task (or /wf:spec <name> directly for one feature outside a roadmap)"
  3. Remind the user that security-sensitive PRs still need /security-review; this document is its input, not a substitute.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.