agentleFS
mik2winmik2win/foureyes/skills/threat-model/SKILL.md

threat-model

Skill2 starsChanged 3 months agoMITView on GitHub

Design-time threat modeling (STRIDE-lite) for a feature BEFORE it's built — map the new surface and trust boundaries, walk spoofing/tampering/disclosure/DoS/elevation per entry point, add abuse cases (IDOR, mass assignment, rate abuse), and land every accepted threat as a spec AC or plan step — not a wish. TRIGGER when: a spec/plan adds or changes external surface — a new endpoint/form/webhook, file upload, auth/authz change, a new integration or tenant boundary — and code hasn't been written yet; or the user says "threat model", "что тут может пойти не так по безопасности". DO NOT TRIGGER when: auditing EXISTING code (use /audit-security or the security-reviewer agent), or reviewing a diff (built-in /security-review).

57 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 10 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

  • mbwsimsSkill

    orbit

    Run for repo-wide or diff-wide readiness sweeps: "/orbit", "/orbit pr", "/orbit deep", "/orbit quick", "audit this project", "project-wide review", "is this PR ready overall", or "combined security, tests, codebase, evolution, and instruction review". Use this for broad multi-system assessment, not for a single-file review or a one-domain question.

    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

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 51 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read .claude/PROJECT.md (Architecture, Integrations, Domain → roles), the installed code.md + stack security rules, and the input artifact …

    line 31
  2. Distinctive:

    Every threat gets exactly one disposition — the table is the deliverable:

    line 84

“Common” is measured: kept by at least 6 in 10 of the 51 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

Threat Model: $ARGUMENTS

Principle

/audit-security finds the holes after they're built; this skill prices them before, when a mitigation is one AC-line instead of a refactor. The method is an attacker's walk over the design: every new entry point, every trust boundary crossed, every data class touched — asked "how would I abuse this?" while it's still paper. Output is never advice — every threat lands as a spec AC, a plan step, or a named accepted risk with the user's sign-off.

Phase 0 — Load context

Read .claude/PROJECT.md (Architecture, Integrations, Domain → roles), the installed code.md + stack security rules, and the input artifact — an /analyst spec, a /prepare plan, or a described feature ($ARGUMENTS). Missing/TEMPLATE profile → fall back to the root CLAUDE.md (always in context) when it carries the architecture/integrations/roles (note you're running without a kit profile); STOP for /bootstrap first only if neither has them. Skim how the codebase already does auth/authz/validation (grep the enforcement points) — mitigations must reuse the house mechanism, not invent a parallel one.

Phase 1 — Map the surface (the model)

For the feature, enumerate — a table each, cited against spec/plan items:

  1. Entry points — endpoints, forms, webhooks, file uploads, CLI/jobs args, messages consumed. New AND changed.
  2. Trust boundaries crossed — internet→app, app→DB, app→third-party, tenant→tenant, user-role→admin-surface. Each crossing is where validation/authz must live (code.md).
  3. Data classes touched — credentials/tokens, PII, money/ledger, user content, internal config. Class sets the stakes.
  4. Actors — the role matrix from the spec, plus the two the spec forgot: the unauthenticated stranger and the authenticated-but-wrong-tenant/role user. Most real-world holes belong to those two.

Phase 2 — STRIDE-lite walk

Per entry point, five questions — pragmatic, not ceremonial (skip a row only with a written "n/a — why"):

ThreatThe question at this entry point
SpoofingWho can call this pretending to be someone else? Is authn actually checked here (not just "somewhere upstream")?
TamperingWhich inputs reach state/queries/paths/templates? Mass assignment — can extra fields ride in? Is anything trusted that the client controls (IDs, prices, role fields, redirect URLs)?
Info disclosureWhat does the response/error/log leak — other tenants' rows (IDOR), stack traces, existence oracles ("user not found" vs "wrong password"), secrets in logs?
DoSWhat's unbounded — payload size, list length, fan-out, regex on user input, expensive query per anonymous request? Where's the rate/size limit?
ElevationCan a lower role reach a higher action via this path — direct object reference, missing per-object authz (not just per-endpoint), workflow-step skipping?

Ground every YES/RISK in the artifact or codebase (path:line / spec item) — a threat with no concrete avenue is noise; this table feeds engineers, not compliance.

Phase 3 — Abuse cases (the attacker's user stories)

Three deliberate inversions beyond STRIDE:

  • The hostile power user: scripts the feature at 1000× — what breaks, what gets scraped, what costs money (per-request LLM/API calls behind a free endpoint)?
  • The curious insider: same-tenant low-role user exploring — what do IDs enumerate to, what do "hidden" UI actions actually enforce server-side?
  • The supply path: what enters from the third-party side — webhook forgery (is the signature verified?), uploaded file content (parsed by what?), callback/redirect URLs.

Phase 4 — Land the mitigations

Every threat gets exactly one disposition — the table is the deliverable:

#Threat (entry, STRIDE)ImpactDisposition
T1……AC — add AC-n to the spec (falsifiable: "role X requesting object of tenant Y observes 404") / Plan step — with Verify: line / Accepted risk — user-confirmed, with why
  • Mitigations reuse the house mechanisms found in Phase 0.
  • Accepted risks are the user's to accept — one AskUserQuestion listing them with your recommendation, never silently self-accepted (core.md).
  • Route the additions: back into the spec (/analyst numbering — append, never renumber) or the plan (/prepare); the artifact's stage gate should fail until the rows land.
  • Offer to write the model to the Plans location (<slug>-threat-model.md) when the surface is big enough to outlive this session.

Hard rules

  • Design-time only; read-only on code — you change specs/plans, never source.
  • No threat without an avenue; no mitigation without a landing place (AC / step / accepted-with-sign-off). A threat model whose findings changed nothing was theater.
  • The forgotten actors are mandatory: unauthenticated + wrong-tenant walked at every entry point — that's where IDOR lives.
  • Per-object authz, not per-endpoint — the elevation row always asks about the object.

See also

  • /audit-security — the post-build counterpart (code-level sweep); security-reviewer agent — diff-level check; /analyst / /prepare — where the mitigations land; rules/_generic/code.md — the always-on floor.

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.