security-threat-model
Skill6 starsChanged 18 days agoMITView on GitHub
Produce a structured security threat model using the STRIDE framework, identify trust boundaries, enumerate attack vectors, assess risk, and define concrete mitigations. Use when reviewing security of a new feature, system, or integration.
32 other projects use a version of this.
Adopted by
Most recently taken up by
- jgeofil/agent-skillstheir own version, first seen Nov 8, 2026
- euxx/claude-skills-for-copilottheir own version, first seen Nov 8, 2026
- informaticolorenzo/skill-maestra-publictheir own version, first seen Nov 8, 2026
- dotslashsimran/simcrafttheir own version, first seen Nov 8, 2026
- thesammykins/skillstheir own version, first seen Nov 1, 2026
- lecluse-net/galaristheir own version, first seen Oct 30, 2026
Used with
Projects with it also use hf-cli, scientific-critical-thinking 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.
Hugging FaceSkillhf-cli
Hugging Face Hub CLI (`hf`) for downloading, uploading, and managing repositories, models, datasets, and Spaces on the Hugging Face Hub. Replaces now deprecated `huggingface-cli` command.
Also in 3 projects that use this
ZanderRussSkillscientific-critical-thinking
Evaluate research rigor. Assess methodology, experimental design, statistical validity, biases, confounding, evidence quality (GRADE, Cochrane ROB), for critical analysis of scientific claims.
Also in 3 projects that use this
OpenAISkillsystematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Also in 5 projects that use this
Microsoft AzureSkillhumanizer
Tone enforcement patterns for external-facing community responses
Also in 4 projects that use this
JetBrainsSkillwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
Also in 3 projects that use this
MicrosoftSkillmcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
Also in 4 projects that use this
Other versions32 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 32
- openai/skills★ 27ksame name
- deadlock-mod-manager/deadlock-mod-manager★ 584same name
- waybarrios/opencode-power-pack★ 547same name
- JetBrains/skills★ 386same name
- mtarcure/claude-vibe-squad★ 220same name
- dotslashsimran/simcraft★ 69same name
- fimoklei/pm-ai-playbook★ 42same name
- z91772524-ai/pojia-next-mac★ 39same name
- PracticalSwan/agent-skills★ 22same name
- ckorhonen/claude-skills★ 17same name
22 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- admin-access-control-specificationSkill
- api-design-documentSkill
- architecture-decision-recordSkill
- business-conceptSkill
- database-design-documentSkill
- deployment-planSkill
- design-system-specificationSkill
- disaster-recovery-planSkill
- implementation-planSkill
- incident-postmortemSkill
- project-planSkill
- slo-error-budget-documentSkill
- system-architecture-documentSkill
- technical-blueprintSkill
- technical-feasibility-studySkill
- technical-runbookSkill
- technical-specificationSkill
- test-strategy-documentSkill
- user-personas-behaviorSkill
- using-engineering-docsSkill
- ux-flow-specificationSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. 0 are common, 13 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 29 edited versions we read keep these.
13
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
- Distinctive: line 57
Always draw trust boundaries before enumerating threats.
- Distinctive: line 71
Not all attackers are equal.
- Distinctive: line 72
Opportunistic attackers: Use automated tools (scanners, credential stuffing bots).
- Distinctive: line 77
Document which actor profiles are in scope and tailor the threat analysis accordingly.
- Distinctive: line 84
Third-party service compromise: If a vendor (payment processor, CDN, auth provider) is breached, what is the blast radius?
- Distinctive: line 104
When the system processes personal data, apply privacy-specific analysis:
- Distinctive: line 139
If the document is significantly shorter than the target, check for:
- Distinctive: line 146
When your analysis conflicts with the user's stated preference:
- Very specific: line 158
Interview Mechanism: Use tool calls (e.g., AskUserQuestion) to present questions — do NOT ask inline in the conversation.
- Very specific: line 160
Context Loading: Before asking ANY questions, read ALL prior documents in .engineering-docs/ to extract already-known information.
- Distinctive: line 169
Maximum 2-3 questions per skill: Only ask about:
- Distinctive: line 174
Ask questions to resolve:
- Distinctive: line 197
If the user requests changes after reviewing the threat model:
- Distinctive: line 209
Treating all STRIDE categories equally for every component: Not every component faces all six threat categories.
- Very specific: line 229
Before marking this document as final, verify:
- Distinctive: line 238
After this document is complete, proceed to:
“Common” is measured: kept by at least 6 in 10 of the 29 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.
Files
Purpose
Produce a structured threat model that systematically identifies what can go wrong in a system from a security perspective, who would attack it, how they would do it, and what concrete controls prevent or mitigate each attack.
Security is not a feature to add at the end. A threat model performed before implementation costs hours. A security breach found after launch costs millions and destroys trust that took years to build.
Input
Works best with: The name of the system, feature, or integration being threat-modeled. Also valuable: An existing architecture document, data flow diagram, API design, or description of how data moves through the system.
Example invocation: Threat model our new webhook delivery system. Merchants register endpoint URLs. Our system sends signed HTTP POST requests with event payloads. Merchants verify signatures using a per-merchant secret. The system retries failed deliveries up to 3 times with exponential backoff.
Key Concepts
STRIDE Framework (Microsoft SDL)
The six threat categories that cover all known attack classes:
| Letter | Threat | Violates | Example |
| S | Spoofing | Authentication | Attacker impersonates a legitimate user or system |
| T | Tampering | Integrity | Attacker modifies data in transit or at rest |
| R | Repudiation | Non-repudiation | User denies performing an action with no audit trail to prove otherwise |
| I | Information Disclosure | Confidentiality | Sensitive data exposed to unauthorized parties |
| D | Denial of Service | Availability | System overwhelmed or crashed, denying service to legitimate users |
| E | Elevation of Privilege | Authorization | Attacker gains access beyond their granted permissions |
Trust Boundaries
Trust boundaries are the locations in a system where data crosses from one trust zone to another. Attackers target trust boundaries because that is where:
- Input validation is most often missing
- Authentication is most often weak
- Data is most often exposed in transit
Always draw trust boundaries before enumerating threats.
Risk Scoring
Risk = Probability * Impact. Use a simple 3x3 matrix:
- Critical: High probability + High impact (act immediately)
- High: High probability + Medium impact OR Medium probability + High impact
- Medium: Various mid-tier combinations
- Low: Low probability + Low impact (accept or defer)
Mitigations vs. Residual Risk
A mitigation reduces risk but rarely eliminates it. Document the residual risk after each mitigation - the risk that remains even with controls in place. If residual risk is still High or Critical, escalate for additional review.
Threat Actor Profiling
Not all attackers are equal. Profile the likely threat actors for the system:
- Opportunistic attackers: Use automated tools (scanners, credential stuffing bots). Low skill, high volume. Defeated by basic hygiene (rate limiting, patched software, strong passwords).
- Targeted attackers: Specific interest in the system (competitors, disgruntled insiders, fraud rings). Moderate to high skill. Require defense-in-depth.
- Advanced Persistent Threats (APTs): Nation-state or well-funded groups. High skill, patient, resourceful. Require layered security, monitoring, and incident response.
- Insider threats: Employees, contractors, or partners with legitimate access. Require least-privilege, audit logging, and anomaly detection.
Document which actor profiles are in scope and tailor the threat analysis accordingly.
Supply Chain Threats
Modern systems depend on third-party components. Analyze supply chain risks:
- Dependency vulnerabilities: Known CVEs in third-party libraries. Mitigate with dependency scanning (Dependabot, Snyk), pinning versions, and auditing updates.
- Compromised packages: Typosquatting, dependency confusion, malicious maintainer takeovers. Mitigate with lockfiles, verified publishers, and private registries.
- Third-party service compromise: If a vendor (payment processor, CDN, auth provider) is breached, what is the blast radius? Mitigate with least-privilege API keys, monitoring, and fallback procedures.
- Build pipeline attacks: Compromised CI/CD, malicious build scripts. Mitigate with signed builds, reproducible builds, and access controls on deployment.
Cryptographic Threat Analysis
Analyze cryptographic risks specifically:
- Algorithm selection: Are algorithms appropriate for the use case? (AES-256-GCM for symmetric encryption, RSA-2048+ or Ed25519 for signatures, bcrypt/argon2 for password hashing.)
- Key management: How are keys generated, stored, rotated, and revoked? Hardware security modules (HSMs) or managed KMS for production keys.
- Protocol vulnerabilities: TLS version enforcement (1.2+ minimum, 1.3 preferred), cipher suite selection, certificate pinning.
- Side-channel attacks: Timing attacks on comparison functions (use constant-time comparison for secrets), padding oracle attacks (use authenticated encryption).
Social Engineering
Technical controls cannot prevent all attacks. Document social engineering risks:
- Phishing: Attackers target employees to steal credentials. Mitigate with MFA, security awareness training, and email filtering.
- Pretexting: Attackers impersonate support staff, executives, or vendors to gain access. Mitigate with verification procedures and least-privilege.
- Baiting: Physical or digital lures (USB drops, fake login pages). Mitigate with endpoint protection and user education.
Privacy Threat Modeling
When the system processes personal data, apply privacy-specific analysis:
- Data minimization: Is every collected data element necessary? Can the system function with less data?
- Purpose limitation: Is data used only for the stated purpose? Is there function creep?
- Consent management: How is consent obtained, recorded, and revoked? Is it granular and informed?
- Data subject rights: How does the system support access, rectification, portability, and erasure requests?
- Cross-border transfers: Does data leave the jurisdiction? Are appropriate safeguards (SCCs, adequacy decisions) in place?
Incident Response Integration
The threat model must connect to incident response:
- Detection: For each high/critical threat, how would it be detected? What alerts would fire?
- Containment: What is the immediate containment procedure? (e.g., revoke API keys, block IP ranges, disable account)
- Eradication: How is the threat removed from the system?
- Recovery: How is the system restored to normal operation?
- Lessons learned: How is the incident post-mortem fed back into the threat model?
Proper DFD Notation
Data Flow Diagrams must use consistent notation:
- External entities (rectangles): Actors outside the system boundary (users, external systems).
- Processes (circles/rounded rectangles): Components that transform data (APIs, services, workers).
- Data stores (parallel lines or open-ended rectangles): Where data rests (databases, file systems, caches).
- Data flows (arrows): How data moves between components. Label with the data being transferred.
- Trust boundaries (dashed lines): Where data crosses from one trust zone to another. Mark every boundary crossing.
Document Length
Target length: 8-12 pages (excluding appendices).
Shorter is better than longer. If the document exceeds the target, check for:
- Redundant content that can be cut
- Overly verbose explanations
- Content that belongs in a separate reference document
- Material the agent already knows (don't explain what HTTP is)
If the document is significantly shorter than the target, check for:
- Missing sections
- Insufficient detail in critical areas
- Unaddressed edge cases
Conflict Resolution
When your analysis conflicts with the user's stated preference:
- Present both positions — show your analysis and their preference side by side
- Explain the trade-off — what are the consequences of each choice?
- Recommend with reasoning — state your recommendation and why
- Respect the user's decision — they own the final call
- Document the decision — record it as an
[owner-specified]override with reasoning
Application
Phase 1: Socratic Clarification & Brainstorming (Mandatory Interview)
Interview Mechanism: Use tool calls (e.g., AskUserQuestion) to present questions — do NOT ask inline in the conversation. The user selects from options rather than typing responses. One question per tool call, multiple-choice options preferred, with "I don't know, you decide" as an escape hatch.
Context Loading: Before asking ANY questions, read ALL prior documents in .engineering-docs/ to extract already-known information. Look for:
- Team size, budget, timeline (from business-plan)
- Tech stack, hosting (from system-architecture)
- Target users, JTBD (from user-personas)
- Constraints, regulatory requirements (from business-plan)
- Scope, features (from technical-specification)
If information exists in a prior document, USE IT — do not re-ask.
Maximum 2-3 questions per skill. Only ask about:
- Skill-specific details not covered in prior documents
- Technical decisions that affect this specific document
- Clarifications on ambiguous requirements
Ask questions to resolve:
- User privilege classes: Who are the actors (e.g. anonymous visitor, staff, vendor, superadmin) and what are their specific privilege limits?
- Data sensitivity: What sensitive data (PII, tokens, credit card info, passwords) is processed or stored?
Wait for the user's response to these questions before drafting the final security threat model.
Phase 2: System and Scope Definition (40-60 min)
Define what is in scope. Draw the data flow diagram and mark trust boundaries.
Phase 3: STRIDE Analysis per Component (2-3 hrs)
For each component and data flow, enumerate all threats in each STRIDE category.
Phase 4: Risk Assessment (40-60 min)
Score each threat for probability and impact.
Phase 5: Mitigation Design (1-1.5 hrs)
For each High/Critical threat, define a concrete, implementable control.
Phase 6: Risk Register and Action Items (40-60 min)
Produce the prioritized risk register with owners and deadlines.
Phase 7: Revision (After User Review)
If the user requests changes after reviewing the threat model:
- Read the user's feedback carefully — understand what they want changed
- Check for conflicts — does the requested change affect risk scores, mitigation strategies, or trust boundary definitions?
- Apply changes — update the document, cascading changes through the STRIDE analysis, risk register, and mitigation controls
- Re-run consistency check — verify all threats have specific mitigations, residual risk is documented, and the risk register is re-prioritized
- Update metadata — set
last_updatedto today's date - Confirm with user — show the changes and get approval
Gotchas
- Skipping trust boundary identification and jumping straight to STRIDE. Without drawing data flow diagrams and marking trust boundaries first, agents enumerate threats randomly and miss the most critical attack surfaces where data crosses from untrusted to trusted zones.
- Treating all STRIDE categories equally for every component. Not every component faces all six threat categories. A static content delivery endpoint does not face Elevation of Privilege the same way an admin API does. Focus analysis where each category is realistic.
- Writing mitigations that are too vague to implement. "Validate all inputs" is not a mitigation. "Rate limit login to 5 attempts/IP/10 minutes with CAPTCHA after 3 failures" is a mitigation. Every control must be specific enough for an engineer to implement directly.
- Forgetting to document residual risk. A mitigation reduces risk but rarely eliminates it. Agents that mark a threat as "mitigated" without documenting what risk remains give a false sense of security. Always note the residual risk level after controls are applied.
- Ignoring repudiation threats. Agents frequently skip the "R" in STRIDE because it seems less critical than spoofing or injection. Repudiation matters for any system with financial transactions, admin actions, or compliance requirements where audit trails are legally necessary.
Handoff
Reads from:
7-system-architecture.md— system components, trust zones, data flows8-database-design-document.md— data storage, sensitivity classification9-api-design-document.md— API surface, authentication mechanisms11-admin-access-control-specification.md— privilege model, trust boundaries
Feeds into:
13-design-system-specification.md— security UX requirements (auth flows, error states)14-technical-blueprint.md— security requirements and mitigations for feature designs15-implementation-plan.md— security controls sequenced in build phases
Quality Gate
Before marking this document as final, verify:
- Data flow diagrams with trust boundaries are drawn before any STRIDE analysis begins
- Every threat has a specific, implementable mitigation (not generic advice like "validate inputs")
- Residual risk is documented for every mitigated threat
- All six STRIDE categories are considered for each component (even if some are marked "Not Applicable" with justification)
- The risk register is prioritized with named owners and target dates for High/Critical items
Next Steps
After this document is complete, proceed to:
technical-blueprint— design feature implementations with security mitigations incorporatedimplementation-plan— sequence security controls into the build phases- Or invoke
using-engineering-docsto continue the pipeline
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
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.

