Skip to content

Guide

AI Agent Threat Modeling: A Practical Guide for Developers

AI agent threat modeling: a practical, scenario-driven guide for developers shipping agents—attack surface, OWASP Top 10, MAESTRO, and where runtime guards fit.

MCP Guard7 min readUpdated
On this page (9 sections)

AI agent threat modeling is the practice of enumerating what an autonomous agent can touch—files, databases, external APIs—then scoring each path for likelihood and impact before it runs. You do it because an agent with tool access can cross your stack in one session, and the surface changes every time you add a tool. Christian Schneider's scenario-driven approach models the agent boundary, not just the model, and treats attack surface mapping as a distinct discipline.

Key takeaways

  • Threat model the agent's tools and permissions, not just the LLM weights.
  • Model concrete scenarios: data exfiltration, unauthorized writes, and tool chaining.
  • Use OWASP Top 10 for Agentic Applications and CSA MAESTRO as reference structures, not static checklists.
  • Add a runtime guard as a complement to allow-lists, least privilege, and human approval.

What is AI agent threat modeling, and who needs it?

AI agent threat modeling is the structured review of what an autonomous agent can do and what could go wrong if it is misused, compromised, or poorly prompted. You inventory the agent's tools, the data those tools can reach, and the triggers that start a run. Then you score each path for likelihood and impact and decide whether to allow it, ask a human, or block it outright.

This differs from traditional application threat modeling because the agent can chain tools across sessions without a human in the loop. Christian Schneider's scenario-driven approach treats that boundary—the agent plus its tool set—as the thing to model, rather than reviewing the model in isolation.

You need this when an agent can write to a database, call an external API, or move data between systems. If your agent is read-only and sandboxed, you can defer it. If it can send email, create issues, or update records, start now.

How does the attack surface expand when you add agents?

How does the attack surface expand when you add agents?

Adding an agent expands the surface from a single request-response loop to a multi-step, autonomous chain. Each tool you grant is a new endpoint the agent can reach, and each prompt it processes is a potential instruction source an attacker can influence. The agent can also act as a bridge: a malicious document it reads could contain instructions that cause it to exfiltrate data to an external endpoint.

Key expansion vectors:

  • Tool count: every new tool is a new attack path.
  • Tool chaining: the output of one tool becomes the input of the next, so a flaw in one tool cascades.
  • Indirect prompt injection: data the agent ingests (emails, documents, web pages) can carry instructions that override your intent.
  • Persistent state: memory and session state let an attack persist across conversations.

Model the surface before you ship, and redraw it whenever you add or remove a tool.

How do you identify AI agent vulnerabilities?

How do you identify AI agent vulnerabilities?

Start with the tools, not the model. List every tool the agent can call, what parameters it accepts, and what systems those parameters touch. Then ask: if an attacker controls the prompt, or part of the data the agent reads, what is the worst thing the agent could do with each tool?

Common vulnerability classes for agents:

  • Excessive agency: the agent can perform destructive writes without asking.
  • Indirect prompt injection: untrusted data redirects agent behavior.
  • Credential leakage: the agent sends secrets to an external tool or logs them.
  • Insecure tool use: the agent passes user input unsanitized into a tool call.
  • Tool poisoning: a compromised tool returns malicious instructions the agent follows.

Score each scenario for likelihood and impact. High-impact, high-likelihood paths get a control—allow-list, human approval, or runtime block—before production.

How do you secure AI agents against adversarial attacks?

You secure agents with layers, not a single filter. Input sanitization helps, but it cannot catch indirect prompt injection hidden in a document the agent reads later. Output validation helps, but it cannot stop the agent from calling a tool with bad arguments.

Threat patternExample scenarioControlVerdict
Indirect prompt injectionAgent reads a document containing hidden instructions to exfiltrate dataInput/output validation + runtime guardAsk / block
Excessive agencyAgent deletes records without user confirmationHuman approval + least privilegeAsk
Insecure tool useAgent passes raw user input into a shell toolTool allow-list + parameter validationBlock
Credential leakageAgent sends API keys to an external toolSecret scanning + allow-listBlock

Treat the guard as a complement, not a replacement. A guard that overpromises is worse than none because it creates a false sense of security.

What does OWASP Top 10 for Agentic Applications explained cover?

The OWASP Top 10 for Agentic Applications is a reference list of the most critical security risks for applications that use autonomous agents and LLMs. It is maintained by OWASP and intended to help teams prioritize testing and controls. It is not a standard you certify against, and it is not a checklist you can apply once and forget.

The framework organizes risks around how agents behave: prompt injection, insecure output handling, excessive agency, and unsafe tool use are typical categories. Your job is to map those categories to your specific agent. If your agent can send email, "excessive agency" means it could send email to an external address without asking. If it can query a database, "insecure tool use" means it could inject a malicious query through user input.

Use it to structure your threat model, then score your own scenarios.

How does the CSA MAESTRO framework for AI security fit?

CSA MAESTRO is a framework for AI security that spans the lifecycle: design, development, deployment, and operations. It gives you a structure for governance, risk assessment, and control selection rather than a product to install.

For agent threat modeling, MAESTRO is useful at the governance layer. It reminds you to document who owns the agent, what data it can access, and how incidents are handled. It does not replace the technical work of mapping tools and scoring scenarios. Use MAESTRO to set policy and ownership, and use scenario-driven threat modeling to find the actual flaws.

What is a practical workflow for threat modeling autonomous agents?

Run this workflow before you ship an agent with tool access, and repeat it when you add tools:

  1. Inventory agents and tools. List every agent and every tool it can call.
  2. Map data flows. Show where data enters the agent, where tools read from and write to, and where responses go.
  3. Identify scenarios. For each tool, write the worst-case prompt or data input that could abuse it.
  4. Score likelihood and impact. Rate each scenario on a simple scale (low, medium, high).
  5. Decide allow / ask / block. Allow low-risk paths. Ask a human for medium-risk destructive actions. Block high-risk paths entirely.
  6. Implement controls. Add allow-lists, least-privilege tool scopes, and human approval steps.
  7. Add a runtime guard. Place a pre-tool-call hook that POSTs each tool invocation to the MCP Guard endpoint and enforces the verdict before the tool runs.
  8. Review on change. Re-run the workflow when you add a tool, change a permission, or connect a new data source.

This keeps threat modeling tied to the code, not to a slide deck.

Where do runtime guards fit, and what are their limits?

A runtime guard sits between the agent and the tool. When the agent decides to call a tool, your pre-tool-call hook sends the invocation to the guard. The guard returns a verdict—allow, ask, or block—often with calibrated scores for risk. You enforce the verdict before the tool executes.

The limits matter. A guard sees the invocation, not the agent's internal reasoning. It cannot catch every indirect prompt injection, and it does not know your business context the way a human reviewer does. Use it alongside allow-lists, least privilege, and human approval. Never rely on it as your only control.

If you are shipping agents with tool access, add a pre-tool-call hook that POSTs each invocation to the MCP Guard endpoint and blocks on deny. It works alongside your existing allow-lists and human approval steps, not instead of them.

FAQ

What is the difference between threat modeling an agent and threat modeling a regular app?

A regular app follows fixed code paths. An agent chooses which tools to call and in what order, so you must model the tool set and the chains between them, not just the endpoints.

Do I need threat modeling if my agent is read-only?

If the agent can only read from a single sandboxed source and cannot write or call external APIs, the risk is lower and you can defer formal modeling. If it can write, delete, or reach outside your environment, start now.

How does OWASP Top 10 for Agentic Applications differ from the LLM Top 10?

The agentic version focuses on autonomous behavior—tool use, chaining, and excessive agency—whereas the LLM Top 10 centers on model-level risks like prompt injection and training data poisoning. They overlap, but the agentic list adds the autonomy layer.

Does CSA MAESTRO replace my threat model?

No. MAESTRO provides governance and lifecycle structure for AI security. It helps you assign ownership and set policy, but it does not identify the specific scenarios where your agent could be abused.

Can a runtime guard catch every agent attack?

No. A guard inspects tool invocations and returns allow, ask, or block, but it cannot see internal reasoning or catch every indirect prompt injection. Use it as a complement to allow-lists, least privilege, and human approval.

Check tool calls before they run

One API call returns allow, ask or block for a proposed agent action. 1,000 free requests, then $0.20 per 1,000 checks.

Topics

  • AI agent threat modeling
  • threat modeling for autonomous agents
  • securing AI agents against adversarial attacks
  • OWASP Top 10 for Agentic Applications explained
  • CSA MAESTRO framework for AI security
  • AI agent attack surface expansion
  • identifying AI agent vulnerabilities
  • proactive AI agent security

MCP Guard

Check your agent's next tool call before it runs.

A verdict (allow, ask or block) and nine calibrated scores in one call. It reduces risk; it does not replace your permissions, allowlists and backups. 1,000 free requests, then $0.20 per 1,000 checks.