This article presents a structured methodology for threat modeling AI agents before deployment, addressing the gap that classical threat modeling approaches (like STRIDE) handle agent-specific properties poorly. The article argues that agents behave fundamentally differently from traditional software because they plan autonomously, retain memory, call tools in loops, and act with delegated authority—creating attack surfaces that classic checklists miss. Learning to model these systems with evidence rather than assumptions is critical for safely deploying agents with access to sensitive data and powerful tools.
- The agent execution loop is the blind spotClassical threat modeling frameworks focus on direct data flows between components but miss the feedback loop where tool results flow back into context and steer the agent's next action. The article emphasizes that this loop, especially the tool-result-to-context arrow, is where most real agent incidents travel and where a single poisoned piece of content can initiate a chain of unreviewed actions. The example of a support agent reading a ticket is used to show how external text entering context can redirect the agent's entire behavior.
- Three frameworks combine for agent coverageThe article recommends using STRIDE as a familiar baseline for ordinary system parts like APIs and databases, MAESTRO layers (Foundation Models, Data Operations, Agent Frameworks, Deployment Infrastructure, Evaluation and Observability, Security and Compliance, Agent Ecosystem) to ensure complete stack coverage, and OWASP agentic IDs (fifteen threats T1–T15, plus the Top 10 for Agentic Applications 2026 starting with ASI01 Agent Goal Hijack) as shared vocabulary. This multi-framework approach addresses the fact that classical methods alone handle non-determinism, autonomy, agent identity and a
- Execution graph maps every data and control pathThe methodology begins by drawing five specific paths: user input to model, model to tool, tool result to context, context to next model call, and agent to downstream agent. For each path, the threat modeler records the source, destination, what travels along it, and who controls the source (user, developer, or outsider). The article uses a concrete example showing how to represent this as a simple text-based graph with edges listed by number. Any edge controlled by an outsider becomes a flag for deeper analysis in subsequent steps.
- Trust boundaries define where untrusted content entersRather than drawing trust boundaries around boxes (traditional approach), the article instructs marking boundaries wherever text from someone other than the system owner flows into the model's context—including public issues, fetched web pages, emails, retrieved documents, and tool results. Tool output is marked untrusted even when the tool itself is trusted, because data trustworthiness depends on who wrote the data behind it. The article cites OWASP guidance that authorisation decisions must never rest on model output alone; they require valid, unexpired, parameter-bound approvals in code.
- Lethal trifecta identifies high-risk agent combinationsThe article defines the trifecta as an agent that combines private data access, exposure to untrusted content, and external communication capability. The term was coined by Simon Willison in June 2025. A CSA note found this combination in 98 percent of assessed agents. The methodology requires listing which private data the agent reads, which sources supply untrusted content, and which outbound actions are available (email, pull requests, URL fetches, file writes, markdown images). Removing one leg of the trifecta is usually the cheapest mitigation.
- Tool inventory and MCP adds distinct attack surfaceThe methodology requires documenting each tool and MCP server with its permissions, side effects, owner and location. MCP (Model Context Protocol) adds specific risks: third-party servers not written in-house, tool descriptions the model reads as text, and credentials in configuration files. GitGuardian found 24,008 secrets in public MCP configuration files in 2025, with 2,117 still valid. Any tool row with no owner is flagged as a finding. Each agent must have its own unique identity with scoped credentials, and secrets must be injected at the tool layer, never stored in prompts or config fil
- Threat scenarios map to OWASP and MAESTRO for testabilityEach threat is written as a specific sentence naming the attacker, the path on the execution graph, and the outcome—for example, 'outsider files an issue with hidden instructions, agent obeys, copies private content into pull request.' Each scenario is tagged with an OWASP agentic ID (such as ASI01 Goal Hijack, ASI02 Tool Misuse, ASI03 Identity Abuse, ASI06 Memory Poisoning, ASI07 Inter-agent Trust, ASI08 Cascading Failure) and a MAESTRO layer. Scenarios are ranked by likelihood and impact. If the threat modeler cannot name the path on their execution graph, the scenario is not ready, ensuring
- Controls require paired detection signals and replay testingThe article stresses that a threat model ending in a table changes nothing. Each high-priority scenario must produce a control (such as breaking the trifecta, scoping capabilities, binding approvals to parameters, restricting egress) and a detection signal. Every control must be tested by replaying the original attack scenario after implementation; controls never tested are described as guesses. The model must live in the agent's repository and be reviewed in pull requests alongside code changes, with updates required whenever tools are added, data sources change, identities shift, or the trif
Bottom line: AI agent threat modeling is a structured, evidence-based process that maps execution graphs, marks trust boundaries, inventories tools, and writes testable threat scenarios tied to OWASP IDs and MAESTRO layers—fundamentally different from classical approaches because agents plan autonomously, retain context, and call tools in feedback loops that can amplify a single poisoned input into unreviewed actions. The methodology is only effective when paired with concrete controls, detection signals, an
⏱️ 50 min · Intermediate · 2 hands-on labs
Imagine your team has just wired an agent to your issue tracker, your private repositories and your pull request workflow, and someone asks whether it is safe to ship. AI agent threat modelling is how you answer that with evidence instead of a shrug. You sit down with a pen, draw what the agent can read and do, and find the weak paths before an attacker does.
Here is a gap I want you to watch for in how people approach this. They reach for a classic checklist, tick the boxes for the API and the database, and miss the loop where a tool result flows back into context and steers the next action. That loop is where agents behave differently from ordinary software.
So we will do this together, step by step. You will draw an execution graph, mark trust boundaries and identities, inventory tools and MCP servers, and run a lethal trifecta audit. Then you will write threat scenarios mapped to OWASP agentic IDs and MAESTRO layers, turn them into controls, and set a review cadence. Everything runs on paper, on your own diagrams, or in the SecurityElites practice lab.
🎯 What You Will Be Able to Do
✅ Before You Start
- Basic understanding of how LLMs call tools
- Familiarity with prompt injection concepts
- Awareness of general threat modelling ideas such as STRIDE
📋 In This Tutorial
- The Direct Answer: What AI Agent Threat Modelling Is
- Why Classic Methods Struggle With Agents
- Step 1: Draw the Execution Graph and Name the Assets
- Step 2: Mark Trust Boundaries and Identities
- Step 3: Inventory Tools, MCP Servers and Data Flows
- Step 4: Write Threat Scenarios and Map Them
- Worked Demo: Threat Modelling a Coding Agent
- Turning Findings Into Controls and Detection
- Practice in the Lab and Keeping the Model Current
- Your checklist
- What I want you to remember
- Questions people ask
The Direct Answer: What AI Agent Threat Modelling Is
I'll give you the short version first. AI agent threat modelling is a structured way to find out how an autonomous agent could be abused before it ships. You map what the agent can read, what it can do and who it acts for, then you write down how an attacker could bend each of those. The output is a ranked list of threats and the controls that answer them.
If you already know classic threat modelling, you have a head start. The difference is that an agent plans, remembers, calls tools and acts with delegated authority. It does not just answer a question and stop. That changes the work in three ways.
📖 Words I just used
This page is the practical method. For the wider picture of attacks and defences, read our complete guide to agentic AI security. Everything below you can practise on your own diagrams, with no live system needed.
Why Classic Methods Struggle With Agents
Let me explain where the old tools wobble. A Springer chapter on MAESTRO argues that STRIDE, DREAD, PASTA, OCTAVE and LINDDUN handle agent-specific properties poorly. The properties it names are non-determinism, autonomy, agent identity and agent-to-agent communication. STRIDE still has value, but it was built for systems whose behaviour you can enumerate.
Three newer resources fill the gap. I suggest you know all of them.
📖 Words I just used
Here is how I combine them. Keep STRIDE as a familiar checklist for ordinary parts such as APIs and databases. Use MAESTRO layers to make sure you cover the whole stack. Use the OWASP IDs as a shared vocabulary for each finding. One survey reaches a similar conclusion: defences must be coordinated across layers, because one weakness often spans several.
🧠 Quick check
If you want the fundamentals first, Day 6 on trust boundaries and threat modelling for AI apps is a good companion.
Step 1: Draw the Execution Graph and Name the Assets
We start the method here. A practical agent threat model begins with an execution graph, which maps every path that data and control can take. I want you to draw one for an agent you know, or for the example I use here: a support agent that reads tickets and can query a customer database. Everything runs on paper or in a text file on your own machine.
- User input to model
- Model to tool
- Tool result to context
- Context to next model call
- Agent to downstream agent
Pay most attention to the third and fourth arrows. A tool result flows back into context, and context drives the next call. That loop is how one poisoned web page can steer many later actions.
🧭 Draw the graph and list assets
A tiny example of the graph written as text. Yours will be longer.
🧠 Quick check
Step 2: Mark Trust Boundaries and Identities
I want you to take the execution graph from Step 1 and draw a line wherever the trust level changes. That line is a trust boundary. In AI agent threat modelling, the boundaries matter more than the boxes, because most agent attacks start with untrusted content crossing a boundary and being treated as an instruction. If you want the wider picture first, the Agentic AI Security guide covers it.
Use a pen on your own graph. Mark each arrow where text written by someone other than you flows into the model's context: a public issue, a fetched web page, an email, a retrieved document, a tool result. The model cannot reliably tell data from instructions, so all of these arrows are untrusted by default.
🧭 Mark the boundaries on your graph
Next, identities. Give each agent its own unique identity and scoped credentials, and treat it as a privileged user, as NIST's draft Cybersecurity Framework Profile for AI recommends. A shared service account makes it impossible to say which agent did what, and it widens every compromise.
Last, keep secrets out of context. GitGuardian found 24,008 secrets in public MCP configuration files in 2025, and 2,117 were still valid. If a key sits in the prompt, injected text can ask the model to repeat it. Inject credentials at the tool layer instead, and give every credential an owner.
🧠 Quick check
Step 3: Inventory Tools, MCP Servers and Data Flows
I want a list from you here. Good AI agent threat modelling needs a plain inventory of everything the agent can do, because the attack surface is the set of actions available once a boundary has been crossed. Do this on your own project or a lab, never by probing a system you do not own.
For each tool and each MCP server (Model Context Protocol, the standard that lets agents plug into tools), record the permissions it holds, its side effects, who owns it and where it runs. Side effects are what change in the world: files written, emails sent, tickets opened, code executed.
Keep this as a simple table in your repo. Any row with no owner is a finding already.
MCP adds attack surface of its own: third-party servers you did not write, tool descriptions the model reads as text, and credentials stored in configuration files. Treat each server like a dependency and a privileged account at once. The real MCP attacks case studies show how this goes wrong.
Next, trace data flows: where private data enters, where it travels, and where it can exit. Then run the lethal trifecta audit, a term Simon Willison coined in June 2025. Ask whether one agent combines three things.
☑️ Trifecta audit
External communication is wider than it sounds. It includes sending email, opening a pull request, fetching a URL, writing a file an attacker can see, or returning a markdown image the client loads. A CSA note found the trifecta in 98 percent of assessed agents, so expect to find it.
🧠 Quick check
This lab gives you an agent with several tools and a recorded hijack, which is a ready-made inventory exercise.
▸ List each tool the agent has and what side effect it carries
▸ Find which tools supply untrusted content and which can send data out
▸ Decide which combinations should never be allowed together
▸ Set your rules, then replay the traces
What to notice: Which tool was the outbound channel Whether blocking one leg was enough to stop the hijack
Step 4: Write Threat Scenarios and Map Them
I want you to turn your graph, assets, boundaries and tool inventory into stories now. A threat scenario is a short sentence that says who or what attacks, through which path, and what they gain. Good AI agent threat modelling lives or dies on these sentences, because a list of vague worries cannot be tested or ranked.
Start with six families. Each one maps onto the OWASP Top 10 for Agentic Applications 2026, which was published on December 9, 2025 and covers agents that plan, hold memory, call tools and act with delegated authority.
📖 Words I just used
For each scenario, tag the OWASP ID and the MAESTRO layer it touches, such as Agent Frameworks or Data Operations. This scenario-driven mapping keeps findings comparable across teams. Then rank by likelihood and impact, following the NIST AI RMF shape: Govern sets accountability, Map names threats and assets, Measure scores them, Manage picks controls.
A starter table. L is likelihood, I is impact, each scored High, Medium or Low.
For depth on each family, see our pillar guide on agentic AI security and the MCP attack case studies.
🧠 Quick check
Worked Demo: Threat Modelling a Coding Agent
Let me show you the whole method on one system: a coding agent that reads public issues and opens fixes. Everything here runs in the SecurityElites lab, which is intentionally vulnerable. Never point this at a real repository you do not own.
🧭 Model the coding agent
This pattern matches a known GitHub MCP exploit: public issues as untrusted content, private repos as data, pull requests as the exfiltration channel.
Now confirm your predicted attack path against the lab agent, which fixes issues labelled ai-fix.
▸ Read what the agent actually receives, not only what a maintainer sees on screen.
▸ Look for any place where the agent could receive text that a human reviewer would not see.
▸ Think about how an issue could look harmless to a maintainer yet still change the agent's task, and test your idea.
▸ Compare the result with the path you predicted.
What to notice: Which boundary your prediction named, and whether it was right Which trifecta leg carried the outcome out
Turning Findings Into Controls and Detection
A threat model that ends at a table changes nothing. I want each scenario to produce a control and a signal that proves the control works. Work down your ranked list and pair them.
🧭 Pair each threat with a control
On to detection. Log every tool call with the agent identity, parameters, and which content sat in context. Alert on odd signals: a read-only task that suddenly writes, a new outbound destination, or a pull request touching repos outside the task.
☑️ Control verification
Practise writing tool rules, then replay recorded traces of a hijack to see whether they hold.
▸ List which tools complete the trifecta for this research agent.
▸ Write rules that separate untrusted-content tools from outbound ones.
▸ Replay the traces and note which calls your rules block.
What to notice: Which rule stopped the hijack, and which was never used Whether a legitimate task broke
Practice in the Lab and Keeping the Model Current
I want you to test your AI agent threat modelling against something that fights back, because a model on paper only tells you what you believe. A lab tells you what is true. Everything below runs in a SecurityElites practice lab, never against a real system. If you want the wider picture first, my complete guide to agentic AI security covers the attack families we have been mapping.
Use this lab to check the model you built for the coding agent. Before you touch anything, write down which boundary, which asset and which outbound channel you expect the attack to use. Then see whether you were right.
▸ Draw the execution graph for the repository and agent before you open the lab, and mark where untrusted text enters context.
▸ Ask what the agent can read that a human maintainer never sees, and treat that as a boundary your model must name.
▸ Run the trifecta audit: list the private data, the untrusted source and the outbound action available to the agent.
▸ Write your scenario in one sentence, then attempt it and compare the result with your prediction.
What to notice: Which part of your model was wrong or missing, and which boundary you had drawn too loosely. Whether the agent's authority came from the model's output alone, with no check in between.
Once you have found a path, practise the defensive half. This lab asks you to set tool rules and replay recorded hijack traces against them.
▸ Read the traces and mark each tool call where the instruction came from fetched content rather than the user.
▸ Decide which tool combinations should never be available together, and why.
▸ Set your rules, replay, then tighten any rule that still lets a hijacked step through.
What to notice: Which rules blocked the attack and which only looked tidy. Whether any legitimate task broke, since over-blocking is also a finding.
Let me cover who should be in the room. Threat modelling done by security alone misses how the agent really works. Bring the engineer who built the agent loop, the owner of each connected system, someone who owns the data it touches, and a product person who knows what the agent is meant to do. Add whoever handles incident response, so detection is designed in, not bolted on.
☑️ Update the threat model when any of these happen
🧠 Quick check
For next steps, work through Day 6 on trust boundaries and threat modelling for AI apps, and read real MCP attacks dissected end to end to test your tool inventory against actual cases.
Your Checklist
☑️ Agent threat model checklist
🚫 Mistakes I See Most Often
What I Want You to Remember
🧠 Check Your Understanding
❓ Questions People Ask
What is AI agent threat modelling and how is it different from traditional threat modelling?
Is STRIDE still useful for AI agents or do I need MAESTRO?
What are the assets and trust boundaries in an AI agent system?
How should AI agents be given identities and credentials?
What is the lethal trifecta for AI agents and how do you break it?
What threats does MCP add to an agent's attack surface?
How often should an agent threat model be updated and who should be involved?
🧩 More in the Agentic AI Security series
- Start here: Agentic AI Security: Complete Guide to AI Agent Attacks, Risks and Defence — Learn agentic ai security end to end: map agent attack surfaces, model threats, hijack a lab…
- OWASP Top 10 for Agentic Applications 2026: Every Risk Explained — Learn the OWASP top 10 agentic applications ASI01 to ASI10, with examples, attack paths and fixes,…
- AI Agent Identity Security: Protecting Non-Human AI Identities — Learn ai agent identity security: inventory agent identities, lock down credentials and OAuth scopes, and test…
📚 Keep Learning on SecurityElites
- Agentic AI Security: Complete Guide to AI Agent Attacks, Risks and Defence — Learn agentic ai security end to end: map agent attack surfaces, model threats, hijack a lab agent, and…
- Secure AI Development 2026 — Build LLM Apps That Resist Attack | AI LLM Hacking Course Day 44 of 90 — Secure AI development 2026 — turn 43 days of attacks into a builder's defence: threat-model the feature, harden…
- RAG Security: Vector Database Attacks and Data Leakage — A 14-day advanced course on attacking and securing RAG systems: vector stores, cross-tenant leakage, document poisoning, retrieval manipulation…
- Advanced LLM Hacking and AI Application Pentesting in 15 Days — A 15-day advanced course on AI red teaming: threat modelling, prompt injection chains, agent and RAG attacks, data…
- Day 6: Trust Boundaries and Threat Modelling for AI Apps — Learn to mark trust boundaries on a diagram, list AI threats for each one, and set tool rules…
🔗 Sources I Checked
- Agentic AI Threat Modeling Framework: MAESTRO
- Agentic AI Threat Modeling
- OWASP Agentic AI Threats and Mitigations, Explained
- OWASP Top 10 for Agentic Applications: Credential Risk
- OWASP Top 10 for Agentic Applications 2026
- Agentic AI Threat Modeling: A Pre-Production Guide
- The Lethal Trifecta: When AI Agent Prompt Injection Becomes a Data Breach
- The AI Agent Lethal Trifecta
Written by Mr Elite. Reviewed by Mr Elite, last reviewed on .

