agentleFS
NikoxkxNikoxkx/Agent-Skills/skills/security/threat-model-designer/SKILL.md

threat-model-designer

Skill1 starsChanged 5 months agoApache-2.0View on GitHub

Creates a structured threat model for an application using STRIDE or PASTA methodology. Use when designing security into a new system or assessing an existing one.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Third-party services: Treat as external entities.

    line 88
  2. Distinctive:

    All major trust boundaries and data flows are covered.

    line 94

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Overview

Creates a structured, actionable threat model using STRIDE (or PASTA) methodology. Includes data flow diagram creation, trust boundary identification, threat enumeration worksheet, risk rating (likelihood × impact), mitigation mapping, and a complete threat model document template that can be maintained as living documentation.

When to Use This Skill

  • Designing security controls for a new system or major feature.
  • Assessing the security posture of an existing application before a pentest or launch.
  • Onboarding new team members to the security context of a product.
  • The user says "threat model this", "what are the threats to X", or provides an architecture diagram.

Prerequisites

  • Architecture diagrams or a clear description of components, data flows, and trust boundaries.
  • Knowledge of the data being processed (especially sensitive/PII data).
  • Stakeholders who can validate assumptions (engineering, product, security).

Steps

  1. Draw the system (Data Flow Diagram - DFD):
    • External entities (users, other systems).
    • Processes (your services, functions).
    • Data stores (databases, caches, S3, etc.).
    • Data flows (arrows with labels: "user credentials", "order data", "JWT").
    • Trust boundaries (dashed lines: "internet", "DMZ", "internal VPC", "app trust boundary").
  2. Identify trust boundaries:
    • Where does untrusted input enter?
    • Where does privileged data cross from one component to another?
    • Where are different privilege levels (unauth, user, admin, service-to-service)?
  3. Enumerate threats using STRIDE (per element or per flow):
    • Spoofing (authentication)
    • Tampering (integrity)
    • Repudiation (non-repudiation / logging)
    • Information Disclosure (confidentiality)
    • Denial of Service (availability)
    • Elevation of Privilege (authorization)
  4. Rate each threat:
    • Likelihood (Low/Medium/High) — considering attacker motivation, capability, and current controls.
    • Impact (Low/Medium/High) — data sensitivity, blast radius, business harm.
    • Risk = Likelihood × Impact (or use DREAD / custom matrix).
  5. Map mitigations:
    • For each high/medium risk threat, list existing or planned controls.
    • Note residual risk after mitigation.
    • Assign owners and target dates for missing mitigations.
  6. Document:
    • Executive summary.
    • DFD (Mermaid or draw.io export).
    • Threat table (ID, element, STRIDE category, description, likelihood, impact, risk, mitigation, status).
    • Assumptions and out-of-scope items.
    • Recommendations and open questions.
  7. Maintain as living doc:
    • Revisit on major architecture changes.
    • Link findings to tickets or ADRs.
    • Review before pentests or launches.
  8. Output:
    • Complete threat model document (Markdown) for a realistic web application (SPA + API + DB + background jobs + third-party integrations).
    • Mermaid DFD source.
    • Threat enumeration worksheet (table template).
    • Risk rating guidance.
    • Example mitigations for common web threats.

Examples

A full threat model for a typical SaaS application (user-facing web app, REST/GraphQL API, Postgres, Redis, background workers, S3, third-party payment + email providers) with ~25-30 enumerated threats, risk ratings, and mitigations is included, along with the DFD and a maintenance checklist.

Edge Cases & Error Handling

  • Complex microservices: Focus on inter-service trust boundaries and authz between services.
  • Third-party services: Treat as external entities; document what you trust them with and what compensating controls you have.
  • Evolving architecture: Version the threat model alongside the architecture docs.

Verification

  1. The DFD accurately reflects the current (or planned) architecture (validated by engineers).
  2. All major trust boundaries and data flows are covered.
  3. High-risk threats have concrete mitigations (or explicit acceptance with compensating controls).
  4. The document is understandable by both security and engineering teams.
  5. New team members can read it and understand the key security considerations.
  6. Success: Security is designed in from the start (or gaps in an existing system are clearly documented and prioritized).

References

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.