Chapter 4.2 — Threat modeling for ML, LLMs and agents¶
🎯 Objective¶
Adapt STRIDE / PASTA for AI systems, integrating the vocabulary of OWASP LLM Top 10, NIST AI RMF, the NIST GenAI Profile and MITRE ATLAS. The goal is not to cover all the theory; it is to give the architect a set of questions that cannot be forgotten in a design review.
🧠 STRIDE adapted to AI systems¶
| Category | Typical AI attack | Where to mitigate |
|---|---|---|
| Spoofing | An agent impersonates a user; a user impersonates an agent; another tenant's token | Strong identity (Ch. 4.8), audit trail, on-behalf-of |
| Tampering | Manipulation of a dataset, RAG index, memory, model artifact, policy bundle | Data contracts, hashes, signing, supply chain (Ch. 4.9) |
| Repudiation | An action executed without a trail; user/agent denies it | Immutable audit log, attribution via token + policy decision |
| Information disclosure | PII leak via prompt, log, response; cross-tenant via RAG | DLP, redaction, tenant filter in storage, limited retention |
| Denial of service | Agent loop; token explosion; retrieval abuse | Budgets, circuit breakers, max steps, per-tenant rate limit |
| Elevation of privilege | Agent runs a tool outside scope; tool description deceives the model | Per-role allowlist, policy, HITL, minimal scopes |
🧠 OWASP LLM Top 10 (2026 edition) — quick mapping¶
Most items of the OWASP Top 10 for LLM Applications, 2026 edition (published in August 2026), correspond to specific chapters of this book:
| OWASP LLM (2026) | Chapter of this book |
|---|---|
| LLM01 — Prompt Injection (direct and indirect) | Ch. 4.3 |
| LLM02 — Sensitive Information Disclosure | Ch. 4.6 |
| LLM03 — Excessive Agency | Ch. 3.2, Ch. 4.4 |
| LLM04 — Supply Chain | Ch. 4.9 |
| LLM05 — Data and Model Poisoning | Ch. 4.5 (vector poisoning), Ch. 4.9 (supply chain) |
| LLM06 — Unbounded Consumption | Ch. 6.2, Ch. 6.5, Ch. 3.2 |
| LLM07 — Misinformation | Ch. 5.6, and the book's central thesis |
| LLM08 — Hidden Context Exposure (formerly System Prompt Leakage) | Ch. 2.3, Ch. 4.3 |
| LLM09 — Vector and Embedding Weaknesses | Ch. 4.5, Ch. 2.8 |
| LLM10 — Improper Output Handling | Ch. 2.4, Ch. 4.7 |
The 2025 edition had the same ten items in a different order, with System Prompt Leakage in place of Hidden Context Exposure; the 2023 list (Insecure Output Handling, Model Denial of Service, Insecure Plugin Design, Model Theft) is superseded.
🧠 Reference frameworks¶
- OWASP Top 10 for LLM Applications (2026 edition). A practical, developer-oriented catalog.
- NIST AI Risk Management Framework 1.0. An organizational structure for risk governance.
- NIST Generative AI Profile. A cut of the RMF for generative AI.
- MITRE ATLAS. A taxonomy of tactics and techniques for attacks on ML.
🧪 How to apply it in an architecture review¶
In a design review, go through the six verbs of adapted STRIDE and, for each system component, answer:
- Who talks to whom? A diagram of trust boundaries.
- What data crosses which boundary? Includes PII, secrets, tenant content.
- What is the control, what is the mitigation? Mark explicitly.
- What is the residual risk? If unaccepted risk remains, stop and re-architect.
🏢 Hermes Logística — wave 4¶
The first serious security review at Hermes began when the team tried to map "what happens if the FAQ document contains
IGNORE INSTRUCTIONS ABOVE". The discussion produced three things: a threat model in adapted STRIDE, a list of five deterministic controls (tenant filter in storage, schema validation, Rego policy, egress allowlist, HITL for high risk) and an accepted-residual-risk sheet. It was the first time security stopped being "let's add a guardrail" and became part of the architecture.
📚 References¶
- OWASP — Top 10 for LLM Applications (project page): https://owasp.org/www-project-top-10-for-large-language-model-applications/
- OWASP GenAI Security Project — OWASP Top 10 for LLM Applications 2026 (accessed 2026-10-25): https://genai.owasp.org/resource/owasp-genai-llm-top-10-2026/
- NIST AI RMF 1.0: https://nvlpubs.nist.gov/nistpubs/ai/nist.ai.100-1.pdf
- NIST — AI Risk Management Framework: Generative AI Profile: https://www.nist.gov/itl/ai-risk-management-framework
- MITRE ATLAS: https://atlas.mitre.org/
- Microsoft — STRIDE Threat Model: https://learn.microsoft.com/en-us/azure/security/develop/threat-modeling-tool-threats