Code prompts
Code prompt

Threat-model a system with STRIDE before it ships

You have a design, or a service already running, and nobody has asked who would attack it. This walks each element and each trust boundary through the six STRIDE categories and returns threats tied to your architecture, with the three worth fixing before launch.

Works best in: Claude

Threat-model this system with STRIDE. I want threats tied to specific elements of my design, not a generic security checklist.

What the system does, and who uses it: {{two or three sentences}}
Components and data flow: {{services, databases, queues, caches, third-party APIs, and what talks to what}}
Trust boundaries I know about: {{e.g. browser to API, our API to the payments vendor, the internal admin tool; or "not sure, infer them"}}
Authentication and authorization today: {{how identity is established, what roles exist, and where authorization is actually enforced}}
Sensitive data in scope: {{e.g. card numbers, health records, session tokens, bulk customer exports}}
Deployment and exposure: {{cloud, single or multi-tenant, what is reachable from the public internet and what is not}}
Controls already ruled out: {{anything rejected for cost, latency, or product reasons, so the mitigations do not relitigate a settled decision}}

Start by restating my system as a list of elements: external entities, processes, data stores, and the flows between them. Mark every place a flow crosses a trust boundary. Where my description leaves a boundary ambiguous, name it and state what you assumed rather than picking silently.

Then sweep each element and each boundary crossing through the six categories:

- **Spoofing** — can an attacker be taken for another user, another service, or another machine?
- **Tampering** — can data or code be modified in transit, at rest, or in a cache?
- **Repudiation** — could an actor deny an action because nothing durable and trustworthy records it?
- **Information disclosure** — can data reach a party that should not read it?
- **Denial of service** — what starves this of a resource, and how cheaply can an attacker do it?
- **Elevation of privilege** — can someone reach an action their role does not permit?

Not every category applies to every element. Where one does not, write "not applicable" with one clause of reason. Do not invent a threat to fill a row.

For every threat that survives, one line in this table:

| Element or flow | Category | The attack in one sentence | What the attacker needs first | Impact if it works | Mitigation | Where that mitigation lives |

Rank the table by how reachable the precondition is against the impact, and name the three you would fix before shipping.

Then three short sections:

**Already covered.** Threats my description shows are handled, and the control that handles them. This stops me paying twice for the same control.

**Accepted on purpose.** Threats not worth fixing at my scale, written as an explicit decision with the condition that should reverse it: a user count, a new data class, a compliance obligation.

**Not assessable from what I gave you.** The questions to answer before this model is worth trusting.

Close with one test per top-three threat, written so an engineer could run it: the setup, the action, and what a vulnerable system does that a fixed one does not.
·Open in·Share

Tip: A data-flow diagram pasted as text beats prose: list each element on its own line and mark the boundary crossings, because the boundaries are where the threats concentrate. Redact hostnames and credentials; the model does not need them to reason about the flow.

securitythreat-modelingarchitecturestride

More code prompts

All code prompts

Go deeper