# Threat Modeling

> Working out how bad people could break in, so you can plan the locks.

**Field:** Software Development  
**Category:** Security  
**Also known as:** Threat Model, Threat Modelling, Threat Analysis

## Think of it like

Think of it like walking round your house. You ask how a thief would get in.

## Definition

Threat modeling is a planned look at how your app could be attacked, done before or while you build it. The team draws the parts of the app and how data moves between them. Then they ask what could go wrong at each step. They list the threats, rank them and plan a defence for each. It is far cheaper to fix a weak design on paper than in live code.

## Example

Lucy's team draws their new payment page on a whiteboard. They spot that the price comes from the browser, so they move the price check to the server.

## Why it matters

Many costly holes are mistakes in the plan. Finding them before coding saves weeks of work.

## Common mistake

Doing it once and filing it away. Each new feature adds new ways in, so the model needs updates.

## Three principles

- **Draw the system.** Map the parts and how data flows.
- **Ask what can go wrong.** List the threats at each step.
- **Plan the fix.** Rank them and design defences.

## Related terms

- [Security Vulnerability](https://learn.benibix.com/term/development/vulnerability)
- [OWASP Top 10](https://learn.benibix.com/term/development/owasp-top-10)
- [Penetration Testing](https://learn.benibix.com/term/development/penetration-testing)
- [Principle of Least Privilege](https://learn.benibix.com/term/development/principle-of-least-privilege)
- [Authorization](https://learn.benibix.com/term/development/authorization)

![Five steps in a row: design, write code, push, build and launch. Lit-up boxes hang under four of them: threat modeling under design asks what could go wrong, secret scanning under push asks if keys were left in the code, a dependency scan under build asks if packages have known holes, and a pen test under launch asks if a skilled attacker can get in. A note says the earlier a hole is caught, the cheaper it is to fix.](https://learn.benibix.com/diagrams/dev2-security-checks.svg)

---

Source: https://learn.benibix.com/term/development/threat-modeling
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
