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

threat-modeling

Skill0 starsChanged 5 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?

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.