agentleFS
MohOneXMohOneX/claude-opus-skills/threat-modeling/SKILL.md

threat-modeling

Skill0 starsChanged 6 months agoMITView on GitHub

Systematically identifies threats, trust boundaries, and attack paths for a system before attackers do. Use when designing or reviewing a system's security, adding a feature that handles sensitive data or access, or answering "what could go wrong security-wise here?

29 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use supply-chain-security, dependency-audit 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.
  • MicrosoftSkill

    supply-chain-security

    Activate when reviewing or modifying dependency resolution, lockfile schema, package downloaders, signature/integrity checks, file integration cleanup, or anything that could expose APM to dependency confusion, typosquatting, malicious packages, or token leakage.

    Also in 3 projects that use this

  • fefogarciaSkill

    dependency-audit

    Comprehensive dependency health auditing for JavaScript/TypeScript projects. Run npm audit, detect outdated packages, check for security advisories, and verify license compliance. Prioritises vulnerabilities by severity and provides actionable fix recommendations.

    Also in 4 projects that use this

  • AnthropicSkill

    incident-response

    Run an incident response workflow — triage, communicate, and write postmortem. Trigger with "we have an incident", "production is down", an alert that needs severity assessment, a status update mid-incident, or when writing a blameless postmortem after resolution.

    Also in 5 projects that use this

  • SentrySkill

    architecture-review

    Staff-level codebase health review. Finds monolithic modules, silent failures, type safety gaps, test coverage holes, and LLM-friendliness issues.

    Also in 4 projects that use this

  • MicrosoftSkill

    api-design

    Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.

    Also in 5 projects that use this

  • OpenAISkill

    observability

    Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.

    Also in 3 projects that use this

The file

Files
SKILL.md

Threat Modeling

Security is a property of the whole system under an adversary's choosing, not a feature you add. Model the attacker's goals and capabilities, then find the cheapest path to them — because that's the path they'll take.

Four questions, in order

  1. What are we building? Draw the data flow: components, data stores, and the trust boundaries they cross (user→app, app→DB, service→service, tenant→tenant). Threats live on boundaries.
  2. What can go wrong? Walk each boundary with STRIDE: Spoofing (identity), Tampering (integrity), Repudiation (deniability), Information disclosure (confidentiality), Denial of service (availability), Elevation of privilege (authorization).
  3. What are we going to do about it? Mitigate, accept (with sign-off), transfer, or eliminate. Not every threat warrants a control.
  4. Did we do it right? Validate the mitigations actually hold against a motivated attacker.

Define the attacker before the defenses

  • Who: unauthenticated internet, authenticated user, malicious insider, compromised dependency, another tenant. Each has different access and changes the model entirely.
  • Capability and motivation: opportunistic script vs targeted adversary vs nation-state. Don't defend against the wrong tier.
  • Assets and goals: what does the attacker want (data, money, disruption, foothold)? Rank by impact × likelihood, and protect the crown jewels first.

Adversarial validation (think like the attacker)

  • Trace the highest-value asset backward: from the data an attacker wants, what's the shortest chain of trust to reach it? That chain is your priority.
  • Assume one layer is breached: the WAF is bypassed, one service is popped, one credential leaks. Does it cascade to total compromise, or does defense-in-depth contain it?
  • Attack the trust assumptions: "internal traffic is trusted", "the client validates this", "this field is always well-formed" — every assumption is an attack surface.
  • Abuse the features, don't just find bugs: password reset, sharing links, export, impersonation, and rate-limit-free endpoints are designed functionality that becomes an attack tool.
  • Confused deputy: can a low-privilege actor trick a high-privilege component into acting on its behalf (SSRF, IDOR, signed-URL reuse)?

Non-obvious risks

  • Client-side controls (validation, hidden fields, disabled buttons) are UX, not security — the attacker controls the client entirely.
  • The most damaging breaches chain low-severity issues; a "minor" info leak + a "minor" CSRF can compose into account takeover.
  • Trust boundaries are often invisible in the code (a microservice that trusts its caller's auth header without re-verifying).

Output structure

Deliver: the data-flow diagram with trust boundaries marked, the attacker profiles in scope, the STRIDE threats per boundary ranked by impact × likelihood, the highest-value-asset attack path traced, the mitigations (or explicit accept-with-rationale), and the "assume-breach" containment check.

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.