The Futility of Threat Modeling AI Agents

The Futility of Threat Modeling AI Agents

There’s been a lot said recently about how to secure AI agents with every technology from sandboxes to identity touted as the solution to all of your problems. But what problems to each of these technologies address? Which of them do you actually need? And how do they fit together into a single system that makes your production AI agents secure?

To look at the complete picture I reached for my favorite tool for understanding any system: a threat model. Threat models are a great tool, and I find that creating a threat model helps me to better understand a system and how to secure it. If you’ve never heard of threat models, check out these great descriptions.

Before I show you what I came up with, I want to share my biggest takeaway: you can’t make a threat model for all AI agents. It’s like making a threat model for all software – the details of the individual application matter.

What is an AI agent? I’m talking here about any autonomous or semi-autonomous program that interacts with large language models (LLMs) to perform some action. The program is able to operate somewhat independently, with the user and agent designer setting the goal and providing tools, but not providing a deterministic algorithm for the agent.

The problem with defining a threat model for “AI agents” is that the risks associated with running an agent is a product of the stuff the agent has access to, the stuff the agent is allowed to do, and who can provide input to the agent. And all of those factors vary a lot between agents. An agent that can both read and write emails from your account has a very different profile from an agent that can only read emails. 

The best case would be that everyone creates a good threat model for every agent that they create. That way the threat model could actually account for both what that agent can do, and also what resources the agent has access to. This would be great, and if you are deploying an agent in production I absolutely encourage you to do this yourself. Grab a whiteboard, a friend, and a tea or coffee and think about each component of your agent and what the risks are if they are compromised.

But that doesn’t help with my original question: what security properties do we need for AI agents?

To answer this question, it’s still worth considering a threat model for a generic AI agent. This is not a replacement for threat modeling the individual agents you create, but it can start to clear up systemic risks to these agents. This in turn can help us build the right security toolkit that can actually secure individual agents.

The STRIDE Threat Model for AI Agents

The diagram below shows my STRIDE-inspired threat model of AI agents. To utilize best practices, this model assumes that an agent uses some sort of interface to interact with external resources, and that the agent itself does not have access to credentials. For simplicity it does not consider sub-agents or multi-agent architectures and I considered a malicious or attacker-controlled model out of scope for this analysis.

A flowchart titled “STRIDE Threats Across the Agent Runtime,” labeled “AI Agent Threat Model.” A STRIDE key on the left defines six threat categories by letter: S for Spoofing, T for Tampering, R for Repudiation, I for Information disclosure, D for Denial of service, and E for Elevation of privilege. Each threat throughout the diagram is tagged with its corresponding letter.  Three input sources on the left feed into a central container labeled “Edera Hardened Runtime.” The sources are: (1) Prompt / Input, with the threat of prompt injection (T); (3) Model API, with requests sent to other models (S), exhaustion or runaway cost (D), and leaks data to external models (I); and (5) Credentials, which can be leaked to the agent or unintended resources (I).  Inside the Edera Hardened Runtime, data flows top to bottom through three stages. First, (2) Agent: reaches resources outside its context (E), unclear ownership of agent actions (R), and self-tampering such as hallucination or lost context (T). This stage flows out to a final “Output” box on the right. Second, (4) Interface, an MCP proxy: malformed or malicious data sent to agent (T), requests or results altered in transit (T), sensitive data sent to the wrong resource (I), and credentials used incorrectly (S). Third, (6) Resources, covering files, internet, hardware, and OS: resource contents altered (T), unintended data sent externally (I), access beyond the intended scope (E), and other users blocked from the resource (D).

There isn’t a single key takeaway from this process, but a few things to note:

  • Tampering can happen at many stages: self-tampering within the agent (aka hallucination or loss of context), input tampering, and output tampering. This points to controls like those used for SQL injection prevention to ensure good inputs and outputs
  • The reputation risk of AI agents, especially those with direct or indirect access to credentials, is a big open question. Who is responsible for the outputs of the agent?
  • Which resources you give the agent matters a lot for information disclosure and tampering at each stage. This goes back to the discussion of the futility of this exercise. The less you give the agent, the less it can do if compromised or hallucinating.
  • Privilege escalation is possible at several points: this is where the agent might attack itself just to be “helpful”, so needs to be hardened even if all inputs are trusted
  • The non-deterministic nature of agents means that any controls must be hard boundaries, not politely asking the agent not to do something. We’ve seen several attacks that bypass “soft” controls in the agent’s instructions. Don’t rely on these. Use real, enforced, audited boundaries.

Mapping AI Agent Threats to Security Controls

Here is a very brief discussion of the threats identified above. Addressing all of these threats holistically is beyond the scope of this post, but I included my thoughts about which approaches could be useful in each case.

ThreatDescriptionApproach
Input
TamperingDescriptionPrompt injection by the user or included in any associated inputApproachUnsolved
Can be helped with input filtering
Agent
Privilege escalationDescriptionAgent gains access to resources outside its contextApproachMicroVM sandbox (enforced outside the agent context)
ReputationDescriptionWho has ownership of agent actions, especially when something goes wrongApproachOpen question
Who is responsible for agent behavior?
Self-tamperingDescriptionHallucination or overwriting of agent context windowApproachMemory segmentation (sandboxes), monitoring
Model API
SpoofingDescriptionSend credentials or requests to other modelsApproachSupply chain security best practices
DoS / DoWDescriptionResource exhaustion or high cost from repeated requestsApproachAPI limits
Information disclosureDescriptionLeaking data sent to external modelsApproachSupply chain security best practices, self-hosted models
Interface
Tampering with agentDescriptionSending malicious or malformed data to the agent that causes a prompt injection or tampered context windowApproachInput/output filtering, monitoring
Information disclosureDescriptionSensitive information could be passed to the wrong resourcesApproachInput/output filtering, memory segmentation (sandboxes)
Tampering with resources or resultsDescriptionMalicious inputs could be provided to resources, or results from resources could be altered before being sent back to the agentApproachSupply chain security best practices to detect tampering, input/output filtering, and monitoring for the confused deputy problem
SpoofingDescriptionUsing credentials incorrectlyApproachHardening the interface itself, ensuring strong identity management
Credentials
Information disclosureDescriptionLeaked credentials to agent or unintended resourcesApproachIdentity management
Resources
TamperingDescriptionAltering the contents of a resourceApproachIdentity management, sandboxing
Information disclosureDescriptionSending unintended data to an external sourceApproachIdentity management, input/output filtering
Privilege escalationDescriptionAccessing a resource beyond the intended scopeApproachSandboxes, identity management
DoSDescriptionDenial of service of the resourceApproachAPI limits, sandboxes

Where Edera Fits in AI Agent Security

I’ll talk more about this in a future post, but Edera provides a strong sandbox environment for AI agents including hardware enforced memory segmentation, built-in identity management, and a native object capability system. When combined with good system design, input and output filtering, and supply chain best practices for all tooling, Edera provides a strong base for AI agent security.

Cute cartoon axolotl with a light blue segmented body, big eyes, and dark gray external gills.

You know you wanna

Let’s solve this together