Threat Modelling

Finding design flaws before attackers do: the four-question framework, data flow diagrams and trust boundaries, STRIDE per element, PASTA, LINDDUN for privacy, attack trees, MITRE ATT&CK and ATLAS, risk rating with DREAD, CVSS and FAIR, threat modelling AI and agent systems, tools, and fitting it into agile delivery.

On this page

Simple definition#

Threat modelling is a structured way to answer: what are we building, what can go wrong, what are we going to do about it, and did we do a good job? It finds design-level security and privacy problems early, when fixing them is cheap.

The problem#

Scanners and pentests find implementation bugs late. They do not tell you that the design lets a support agent export every customer’s data, or that the AI assistant can be tricked into calling the payments tool. Those are architecture flaws, and finding them in production is expensive or catastrophic.

The four questions (Threat Modeling Manifesto)#

  1. What are we working on? Build a model: a data flow diagram (DFD), assets and trust boundaries.
  2. What can go wrong? Identify threats with STRIDE, attack trees, ATT&CK and so on.
  3. What are we going to do about it? Mitigate, eliminate, transfer or accept.
  4. Did we do a good enough job? Validate with tests, reviews and pentests, and keep the model updated.
Threat modelling workflow · drawn with Archify · zoom, guided views, search and SVG/PNG export. © 2026 Samir Kumar Sahoo, all rights reserved. Open full screen ↗

Step 1: the data flow diagram#

Element Symbol Examples
External entity Rectangle Customer, partner bank, card network
Process Circle Payment API, fraud service, AI agent
Data store Parallel lines Ledger DB, Kafka topic, vector store
Data flow Arrow HTTPS request, Kafka event, tool call
Trust boundary Dashed line Internet/DMZ, service mesh, PCI zone, tenant boundary, model provider
Simple DFD with trust boundaries
flowchart LR
    U["Customer<br/>(external)"] -->|"HTTPS + OAuth"| GW
    subgraph DMZ["Trust boundary: edge"]
        GW["API gateway"]
    end
    subgraph CORE["Trust boundary: internal services"]
        PAY(("Payment service")) --> DB[("Ledger DB")]
        PAY --> K[("Kafka")]
    end
    GW -->|"mTLS"| PAY
    PAY -->|"ISO 20022 over mTLS"| SCHEME["Payment scheme<br/>(external)"]

Step 2: STRIDE per element#

Threat Violates Example Typical mitigations
Spoofing Authentication Stolen token used to call the payment API MFA, OAuth/OIDC, mTLS, workload identity
Tampering Integrity Amount modified in transit or in Kafka TLS, signatures, MACs, immutable logs, input validation
Repudiation Non-repudiation “I never approved that transfer” Signed audit logs, SCA evidence, timestamps
Information disclosure Confidentiality IDOR exposes other customers’ statements Authorisation checks, encryption, masking, least privilege
Denial of service Availability Bot floods the login or the LLM endpoint Rate limits, WAF, autoscaling, quotas, circuit breakers
Elevation of privilege Authorisation Support role reaches admin functions RBAC/ABAC, least privilege, sandboxing, policy checks

STRIDE-per-element: processes are subject to all six. Data stores to T, R (logs), I and D. Data flows to T, I and D. External entities to S and R.

Other methods#

Method Focus When to use
PASTA Seven-stage, risk- and business-centric, attacker simulation High-value systems; aligns security with business impact
LINDDUN Privacy threats: Linking, Identifying, Non-repudiation, Detecting, Data disclosure, Unawareness, Non-compliance Systems processing personal data (GDPR/DPDP DPIAs)
Attack trees Goal at the root, ways to achieve it as branches Deep-dive on one critical asset (“steal funds”)
MITRE ATT&CK Real adversary tactics and techniques Detection engineering, red teaming, validating controls
MITRE ATLAS Adversarial tactics against AI/ML systems AI and agent threat models
Kill chain / Unified Kill Chain Attack stages SOC and incident response planning

Step 3: rate and respond#

Rating options:

  • Likelihood × impact (High/Medium/Low) is simple and usually enough.
  • CVSS v4.0 scores technical severity of vulnerabilities (not design risk).
  • DREAD is older and subjective; use it with care.
  • FAIR quantifies risk in financial terms (loss event frequency × loss magnitude), which suits risk committees.

Responses: mitigate (add a control), eliminate (remove the feature or data), transfer (insurance, contract) or accept (an owner signs off, recorded in the risk register).

Each mitigation becomes a backlog item with a test. Each acceptance gets an owner and a review date.

Threat modelling AI and agent systems#

Add these elements and threats to the DFD:

  • Model (external or self-hosted), prompts (system and user), retrieved context (RAG), tools (MCP servers, APIs), memory, other agents.
  • Threats: prompt injection (direct and indirect through documents and tool output), excessive agency, tool misuse, data leakage through outputs, memory poisoning, model or supply-chain compromise and unbounded consumption.
  • Use the OWASP Top 10 for LLM Applications (2025), the Top 10 for Agentic Applications (2026) and MITRE ATLAS as threat libraries. See AI security.

Fitting it into delivery#

  • When: at design (architecture review), for every significant change (a new trust boundary, data class or integration), and periodically for critical systems.
  • Who: the team that builds it, plus a security champion or architect. Threat modelling is a team sport, not an outsourced document.
  • How long: 60–90 minutes per feature-level session, iterated. Keep the model as code (Threat Dragon JSON, pytm, Threagile YAML) in the repo.
  • Tools: OWASP Threat Dragon, Microsoft Threat Modeling Tool, pytm, Threagile, IriusRisk, ThreatModeler, and AI-assisted threat generation (always reviewed by humans).
  • Evidence: regulators (DORA ICT risk management, RBI, PCI DSS 6.2 secure development) expect risk assessments of changes. Threat models provide them.

Common mistakes#

Quick check#

What are the four threat-modelling questions? What are we working on? What can go wrong? What are we going to do about it? Did we do a good enough job?

What does STRIDE stand for? Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, Elevation of privilege.

Where do most serious threats appear on a DFD? Where data flows cross trust boundaries.

Which method focuses on privacy threats? LINDDUN.

What threat libraries help with AI and agent systems? The OWASP Top 10 for LLM Applications 2025, the OWASP Top 10 for Agentic Applications 2026 and MITRE ATLAS.

What are the four responses to a threat? Mitigate, eliminate, transfer or accept (with an owner and a review date).

Summary#

  • Threat modelling answers four questions and finds design flaws early.
  • Draw a DFD with trust boundaries, then apply STRIDE per element, plus LINDDUN for privacy and ATLAS for AI.
  • Rate the risks, then mitigate with tested backlog items or accept them with an owner.
  • Keep models as code, update them with every significant change, and make it a team habit.

References#