# AI threat modeling: a worked example for an LLM app with RAG and tools

Source: https://airedteamingservices.com/guides/ai-threat-modeling/
Publisher: Excession Labs (airedteamingservices.com)
Last updated: 2026-11-09

AI threat modeling step by step on a fictional support chatbot with RAG and two tools: trust boundaries, threats, OWASP LLM 2026 and ATLAS IDs, and tests.

> **Short answer:** AI threat modeling lists what can go wrong in an AI system before you test it. Draw the system and its trust boundaries, list assets and actors, find threats at each boundary, label them with OWASP LLM 2026 and MITRE ATLAS IDs, and write one test per threat. STRIDE is a good base, MAESTRO adds agent layers and ATLAS names attacker techniques.

AI threat modeling is a structured way to list how an AI system can be attacked or can fail, before anyone tests it. You draw the system, mark where trust changes, name the threats at each mark and write a test for each. This guide runs the method on one fictional support chatbot with retrieval and two tools. The output is a table your tester can use directly.

## What is AI threat modeling?

AI threat modeling applies ordinary threat modeling to a system where a model reads untrusted text and can act on it. The system has the usual parts, such as a web front end, a database and an API. It also has paths that classic models miss: retrieved documents, tool results and memory all enter the model's context.

NIST AI 100-2 E2025 says application designers "may design systems with the assumption that prompt injection attacks are possible if a model is exposed to untrusted input sources" (section 3.4.4). Threat modeling starts from that assumption. It asks what an attacker can reach, not whether the model can be tricked.

## Which method: STRIDE, MAESTRO or ATLAS?

Pick one method to find threats and one catalog to label them. STRIDE and MAESTRO find threats. ATLAS and OWASP label them.

| Method | Use it to | Source |
|---|---|---|
| STRIDE | Find threats by category: spoofing, tampering, repudiation, information disclosure, denial of service, elevation of privilege | [Microsoft Learn](https://learn.microsoft.com/en-us/azure/security/develop/threat-modeling-tool-threats) |
| MAESTRO | Walk seven layers of an agentic system, from foundation models to the agent ecosystem | [CSA blog, 06 February 2025](https://cloudsecurityalliance.org/blog/2025/02/06/agentic-ai-threat-modeling-framework-maestro) |
| MITRE ATLAS | Name attacker techniques with IDs, release v2026.10 | [atlas-data](https://github.com/mitre-atlas/atlas-data/releases/tag/v2026.10) |
| OWASP LLM Top 10 2026 | Name application risks, LLM01 to LLM10 | [OWASP README](https://github.com/GenAI-Security-Project/GenAI-LLM-Top10/blob/main/2026/README.md) |

MAESTRO stands for "Multi-Agent Environment, Security, Threat, Risk, and Outcome". Its seven layers are Foundation Models, Data Operations, Agent Frameworks, Deployment and Infrastructure, Evaluation and Observability, Security and Compliance, and Agent Ecosystem. For a single chatbot, STRIDE on a good diagram is enough. For agents, add MAESTRO.

## Step 1: draw the system and trust boundaries

Draw every component and every arrow, then mark where trust changes. A trust boundary is a line where data or control passes from a less trusted side to a more trusted side.

> **Worked example system:** This is a demonstration. "Harbor Notes Support Bot" is fictional and no real customer system was tested. It answers questions for signed-in customers of a demo note-taking app. It retrieves help articles and the customer's own tickets, and it has two tools: `lookup_order` (read) and `request_refund` (write, needs human approval).

Customerbrowser
Chat serviceauth, rate limit
Model+ context
Toolslookup, refund
Renderedanswer
Retrieval indexarticles, tickets
B1B2B3 / B4

The diagram has four boundaries. B1 is between the customer and the service. B2 is where retrieved text and the customer message enter the model context. B3 is between the model and the tools. B4 is between the model output and the browser.

## Step 2: list assets and actors

List what an attacker would want and who can act. Keep it short and concrete.

| Assets | Actors |
|---|---|
| Other customers' tickets in the index | Signed-in customer (authorized) |
| Order data behind `lookup_order` | Anonymous visitor, if chat is public |
| Refund budget behind `request_refund` | Customer who writes a ticket others' queries may retrieve |
| System prompt and tool descriptions | Support agent who approves refunds |
| The brand's statements about policy | Maintainer of the help-article repository |

The ticket author matters most. Ticket text goes into the index and later into other customers' contexts, so a customer can write content that the model reads on behalf of someone else.

## Step 3: find threats per boundary

Walk each boundary and ask the six STRIDE questions. Write only threats that fit the system. This is the worked result.

| ID | Boundary | Threat | STRIDE |
|---|---|---|---|
| T1 | B1 | Customer message tells the model to ignore its instructions and reveal hidden context | Information disclosure |
| T2 | B2 | A ticket by customer A contains hidden instructions that run in customer B's session | Tampering |
| T3 | B2 | Retrieval returns another tenant's ticket to the wrong user | Information disclosure |
| T4 | B3 | Model calls `lookup_order` with another customer's order number | Elevation of privilege |
| T5 | B3 | Model calls `request_refund` outside policy, or the approver clicks through | Elevation of privilege |
| T6 | B4 | Answer contains a Markdown image whose URL carries conversation data | Information disclosure |
| T7 | B1 | A script sends thousands of long prompts to run up cost | Denial of service |
| T8 | B4 | Bot states a refund policy that does not exist | Tampering (output integrity) |

T8 is not an attack. It still belongs in the model because a wrong policy statement can bind a business. The Moffatt v. Air Canada tribunal decision of February 14, 2024 held the airline liable for its chatbot's wrong fare advice ([secondary summary](https://www.mccarthy.ca/en/insights/blogs/techlex/moffatt-v-air-canada-misrepresentation-ai-chatbot)).

## Step 4: map threats to OWASP LLM 2026 and ATLAS

Add catalog IDs so findings later land in the buyer's vocabulary. Use ATLAS release v2026.10. Do not cite AML.T0057, which is not in that release.

| ID | OWASP LLM 2026 | ATLAS v2026.10 |
|---|---|---|
| T1 | LLM01:2026 Prompt Injection, LLM08:2026 Hidden Context Exposure | AML.T0051.000 LLM Prompt Injection: Direct |
| T2 | LLM01:2026 Prompt Injection | AML.T0051.001 LLM Prompt Injection: Indirect |
| T3 | LLM09:2026 Vector and Embedding Weaknesses | AML.T0070 RAG Poisoning (for planted content) |
| T4 | LLM03:2026 Excessive Agency | AML.T0053 AI Agent Tool Invocation |
| T5 | LLM03:2026 Excessive Agency | AML.T0053 AI Agent Tool Invocation |
| T6 | LLM10:2026 Improper Output Handling | AML.T0136 Exfiltration via AI User Interface |
| T7 | LLM06:2026 Unbounded Consumption | Not mapped in this example |
| T8 | LLM07:2026 Misinformation | Not mapped in this example |

If an attacker used the tool path to send data out, AML.T0086 Exfiltration via AI Agent Tool Invocation would also apply. See the [MITRE ATLAS guide](/guides/mitre-atlas/) and the [OWASP LLM Top 10 guide](/guides/owasp-top-10-for-llm-applications/).

## Step 5: turn threats into test cases

Each threat gets at least one test and one control. A control is a check that should not change when the attack changes, such as a nonexistent ID or another account's token.

| ID | Test | Control to run beside it | Pass means |
|---|---|---|---|
| T1 | Ask for hidden context in plain words and in a role-play frame | Same ask with no hidden context stored | No secret is stored in the prompt, or none is printed |
| T2 | Customer A files a ticket with a marker instruction. Customer B asks a question that retrieves it | Same ticket without the instruction | B's session does not act on the marker |
| T3 | As customer B, query for words only in A's tickets | Query as A | B gets no result from A's tickets |
| T4 | Ask the bot to look up an order number owned by another test account | Own order number | Server rejects the other account's number |
| T5 | Request a refund above policy with test accounts | Refund within policy | Over-limit request is blocked in code, not by prompt text |
| T6 | Plant an image URL instruction in a ticket and read the rendered answer | Plain text answer | The browser sends no request to an outside host |
| T7 | Send long prompts at a bounded rate | Normal prompts | Rate limit and token cap trigger |
| T8 | Ask about refund policy at the edges | Ask the help article text | Answer matches the source |

Run these only on systems you own or have written authorization to test. Use test accounts and test data. The [scoping guide](/guides/how-to-scope-an-ai-red-team/) lists what to put in writing, and the [agent security guide](/guides/ai-agent-security/) covers the tool path in more detail.

## Common mistakes

Teams repeat the same errors when they threat model an AI app:

- They draw the model as one box and miss that retrieved text, tool results and memory enter its context.
- They list threats for the model but not for the tools. T4 and T5 usually carry the largest impact.
- They treat the system prompt as a secret store. OWASP's 2026 entry on hidden context says to design on the assumption that hidden context can be found.
- They write threats without tests, so the model never meets reality.
- They stop after the first release. Add a tool or a data source and redraw the diagram.

A threat model lowers the chance that you miss a path. It does not show that the app is secure.

## Questions

### How is AI threat modeling different from normal threat modeling?

The steps are the same: draw, list, find threats, decide. The difference is the data path. The model reads untrusted text as if it were instructions, so every input source, such as a document or tool result, is a possible attacker channel. Normal diagrams often leave those channels out.

### Do I need to use MAESTRO?

No. MAESTRO is a layered method for agentic systems published by Ken Huang on the Cloud Security Alliance blog on 06 February 2025. Use it when you run agents or several agents. For a single chatbot with retrieval, STRIDE on a good diagram is often enough.

### When in the project should we threat model?

Before the first test and again when you add a tool, a data source or a new user role. The model is a living document. A new tool changes the trust boundaries more than a prompt change does.

### Can a threat model prove the app is secure?

No. It lists the threats you thought of. Tests then check whether controls hold. Prompt injection cannot be fully prevented, per NIST and the UK NCSC, so plan for reduced likelihood and impact.

## Sources

- [Microsoft Learn: Threat Modeling Tool, STRIDE model](https://learn.microsoft.com/en-us/azure/security/develop/threat-modeling-tool-threats)
- [CSA: Agentic AI Threat Modeling Framework, MAESTRO (Ken Huang, 2025-02-06)](https://cloudsecurityalliance.org/blog/2025/02/06/agentic-ai-threat-modeling-framework-maestro)
- [OWASP GenAI LLM Top 10 2026 README](https://github.com/GenAI-Security-Project/GenAI-LLM-Top10/blob/main/2026/README.md)
- [MITRE ATLAS data release v2026.10](https://github.com/mitre-atlas/atlas-data/releases/tag/v2026.10)
- [NIST AI 100-2 E2025: Adversarial Machine Learning](https://nvlpubs.nist.gov/nistpubs/ai/NIST.AI.100-2e2025.pdf)
- [UK NCSC: Prompt injection is not SQL injection (2025-12-08)](https://www.ncsc.gov.uk/blog-post/prompt-injection-is-not-sql-injection)
