threat-modeling
Skill1 starsChanged 5 months agoMITView on GitHub
Runs design-time STRIDE threat modelling on a feature before the code exists — names the trust boundaries this stack actually has (the tenant boundary, RBAC roles inside a tenant, the auth cookie and CSRF edge, file-upload ingestion, inbound webhooks and third-party payloads, and the AI tool surface where a model-supplied argument is attacker-influenced input), walks spoofing, tampering, repudiation, information disclosure, denial of service and elevation of privilege against only the boundaries the feature crosses, then emits a short threat-to-mitigation-to-owning-skill table of work items. Use when designing a new endpoint or background job, introducing a new trust boundary or a new class of data, planning anything that touches money, PII or auth, writing an RFC or ADR, or asked "what could go wrong with this design". Not for auditing an existing diff (see security-review) or reacting after a breach or outage (see incident-response).
29 other projects use a version of this.
Adopted by
Most recently taken up by
- cellrishi-code/claude-skills-atlastheir own version, first seen Oct 4, 2026
- aws-solutions/konductortheir own version, first seen Sep 23, 2026
- robisson/build-like-amazon-agent-skillstheir own version, first seen Sep 23, 2026
- nahid-sparktales/agent-dispatchertheir own version, first seen Sep 21, 2026
- timwukp/agent-skills-best-practicetheir own version, first seen Sep 16, 2026
- millerlai/threat-modeling-mastertheir own version, first seen Sep 15, 2026
Used with
Projects with it also use supply-chain-security, performance-profiling and 3 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.
MicrosoftSkillsupply-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
conorluddySkillperformance-profiling
Instruments integration and performance analysis workflows for iOS apps. Use when profiling CPU usage, memory allocation, network activity, or energy consumption. Covers Time Profiler, Allocations, Leaks, Network instruments, and performance optimization strategies.
Also in 3 projects that use this
SentrySkillarchitecture-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
MicrosoftSkillapi-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
OpenAISkilltest-driven-development
Use when implementing any feature or bugfix, before writing implementation code
Also in 3 projects that use this
Other versions29 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 29
- briiirussell/cybersecurity-skills★ 410same name
- proflead/codex-skills-library★ 153same name
- hardw00t/ai-security-arsenal★ 104same name
- UnitOneAI/SecuritySkills★ 78same name
- nahid-sparktales/agent-dispatcher★ 59same name
- mn-youssef/security-skills★ 47same name
- kumaran-is/claude-code-onboarding★ 36same name
- nimadorostkar/Claude-Skills-collection★ 28same name
- ShieldNet-360/secure-vibe★ 22same name
- ShulkwiSEC/bb-huge★ 22same name
19 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 repository49 other files it gives its agents.
- accessibilitySkill
- ai-evalsSkill
- ai-integrationSkill
- architecture-decisionsSkill
- audit-loggingSkill
- aws-servicesSkill
- browser-e2e-testingSkill
- celery-tasksSkill
- changelogSkill
- ci-cdSkill
- codebase-guideSkill
- code-reviewSkill
- commit-messageSkill
- cookie-auth-csrfSkill
- dashboard-data-designSkill
- db-concurrencySkill
- debugSkill
- dependency-auditSkill
- deploy-awsSkill
- design-systemSkill
- drf-apiSkill
- drf-zod-contractSkill
- frontend-perfSkill
- git-workflowSkill
- i18n-rtlSkill
- incident-responseSkill
- migrationsSkill
- money-decimalSkill
- multi-tenancySkill
- nextjs-moduleSkill
- observabilitySkill
- perf-reviewSkill
- production-readinessSkill
- product-ux-designSkill
- rbac-permissionsSkill
- react-querySkill
- security-reviewSkill
- skill-authoringSkill
- tailwind-shadcnSkill
- tenant-session-switchSkill
- verifySkill
- version-checkSkill
- visual-ui-designSkill
- webhook-handlerSkill
- websockets-channelsSkill
- write-testsSkill
- zod-formsSkill
- zustand-stateSkill
- example-skillSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 27 edited versions we read keep these.
3
Distinctive
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
- Distinctive: line 9
Before the code exists. Four triggers earn a model on this stack:
- Distinctive: line 94
Stop here. One row per threat you are actually mitigating, and the skill that owns the work, so the model produces tickets a reviewer can …
- Distinctive: line 126
Threats without owners rot: If no skill and no person owns a row, it is not mitigated — it is remembered, briefly.
“Common” is measured: kept by at least 6 in 10 of the 27 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
Threat modeling (STRIDE per feature, at design time)
When to use
Before the code exists. Four triggers earn a model on this stack:
- A new endpoint or a new background job/consumer that reaches business data.
- A new trust boundary — a first webhook, a first outbound fetch, a first AI tool.
- A new class of data — PII, credentials, documents, anything you would have to disclose if it leaked.
- Anything touching money or auth — balances, invoices, sessions, tokens, roles.
A CRUD field on a model you already scope correctly does not need one. Modelling everything is how teams learn to skip modelling anything.
Pattern
Enumerate the trust boundaries the feature actually crosses, walk STRIDE across
each one, and stop at a table of work items — not a document. Threat modelling is
proactive and design-time: it changes the design while changing it is still free.
security-review is the retrospective twin that audits the diff once written; the
model you build here is what that review is checked against.
Two rules keep it honest:
- Skip boundaries the feature does not cross. A read-only internal report that never accepts an upload gets no upload row. Padding is what makes these ignored.
- Every threat ends in an owner or it is not a threat. A row with no mitigation and no skill that implements it is a decision you have not made yet.
Trust boundaries on this stack
Data crossing these lines changes from attacker-controlled to trusted. Name the ones your feature crosses, then only STRIDE those.
| Boundary | What crosses it | Attacker's position |
| Tenant | Every business row, every FK id in a body | A legitimate user of another tenant |
| RBAC inside a tenant | Endpoints, @actions, field visibility | A legitimate low-privilege colleague |
| Auth cookie / CSRF edge | Session cookie, CSRF token, login and refresh | Any origin the browser will talk to |
| File-upload ingestion | Filename, content-type, bytes, size | Anyone who can reach the upload |
| Webhook / third-party payload | Provider POSTs, callback URLs, ids | Anyone who can guess the URL |
| AI tool surface | Model-supplied tool arguments, retrieved text | Anyone whose text reaches the prompt |
The last one is the one teams miss. A model-supplied argument is attacker-influenced input, not internal input — a document, an email body, or a webhook payload that lands in the context window can steer the tool call that follows. Treat every tool argument exactly like a request body: validate it, and re-scope every id through the caller's tenant server-side. The model never carries authority.
STRIDE, boundary by boundary
For each boundary the feature crosses, ask the six questions. Concretely, here:
- Spoofing — can a caller claim an identity? A tenant id read from the body or an
X-Tenantheader, an unsigned webhook, a login that leaks which emails exist. - Tampering — can input change what it should not? A client-set
entrepriseon create, an FK pointing at another tenant's row, a webhook amount trusted as sent. - Repudiation — could you reconstruct who did this? Money moves, role changes and exports need an audit record written in the same transaction as the effect.
- Information disclosure — what does the response, the log, the error, the export and the WebSocket group say that this role should not see?
- Denial of service — unbounded uploads, unpaginated lists, an unthrottled login, a webhook retry storm, an AI call with no timeout or spend ceiling.
- Elevation of privilege — can a user become an admin, or a tenant become another?
A missing permission on a new
@actionis the classic path.
Fastest way to find the crossings is to sketch the feature and annotate it:
# DESIGN SKETCH — annotate crossings before writing the real thing.
# Feature: "ask the assistant to email a client their invoice".
@tool # BOUNDARY: AI tool surface — args are attacker-influenced, not internal.
def send_invoice(invoice_id: int, *, user) -> str:
# S: identity is `user` from the session — never an id the model passes in.
# T/E: re-scope the model-supplied id through the caller's tenant queryset.
# Unscoped `Invoice.objects.get(pk=invoice_id)` = cross-tenant read (-> multi-tenancy).
invoice = scoped_invoices(user).get(pk=invoice_id) # 404, not 403, on a foreign row
# E: sending is a privileged verb — gate it explicitly (-> rbac-permissions).
require_perm(user, "invoice_send")
# I: the recipient comes from the invoice, never from the model (-> ai-integration).
# A prompt-injected "send to attacker@x" must have nowhere to land.
# D: outbound send is queued with a retry cap, not called inline (-> celery-tasks).
# R: who asked, which invoice, which recipient (-> audit-logging).
audit(user, "invoice.sent", invoice_id=invoice.pk)
enqueue_send(invoice.pk)
return "queued"The output — a table, not a document
Stop here. One row per threat you are actually mitigating, and the skill that owns the work, so the model produces tickets a reviewer can check off:
| Threat | Mitigation | Owner |
Model passes another tenant's invoice_id | Re-scope every id through the caller's queryset, fail closed | multi-tenancy |
| Any member can trigger a send | Explicit invoice_send permission on the tool and the endpoint | rbac-permissions |
| Injected text redirects the recipient | Recipient derived server-side from the row; model never supplies it | ai-integration |
| No record of who sent what | Audit row written in the same transaction as the effect | audit-logging |
| Retry storm / unbounded spend | Queue with a retry cap and a timeout | celery-tasks |
Then feed it forward: the table is the checklist security-review audits the diff
against at merge, and the open rows are release blockers for production-readiness
at launch. A row that survives to launch unmitigated is an accepted risk — record it
in an ADR (architecture-decisions) with a name against it, don't let it evaporate.
Adapt to your repo
Rename entreprise/Entreprise and the tenant accessor to match your project, and
drop boundary rows your stack does not have — no AI surface means no AI row, and a
single-tenant app collapses the first two rows into one. Confirm what is already
enforced globally (authentication, throttling, CSRF) before modelling it as a threat;
a boundary the framework already holds is a line in the model, not a work item.
Gotchas
- The output is work items, not prose. A modelling doc nobody reads has negative value — it buys the feeling of having done security without the mitigations.
- Model the feature, not the whole system. Re-modelling the login flow for the hundredth time is how these sessions get skipped.
- "The frontend validates it" is not a mitigation at any of these boundaries, and neither is "the model wouldn't do that" at the AI one.
- Don't stop at the request. Celery tasks, WebSocket consumers and webhook handlers cross the same tenant boundary with none of the ViewSet's scaffolding.
- Threats without owners rot. If no skill and no person owns a row, it is not mitigated — it is remembered, briefly.
- A model is a snapshot. Revisit it when the feature grows a new boundary, e.g. the day the report grows an export or the tool grows a write.
See also
security-reviewmulti-tenancyai-integrationproduction-readiness
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.

