AI threat modeling

Also known as: ML threat modeling

On this page 7

AI threat modeling is the structured process of identifying how an AI or machine learning system could be attacked or misused, which assets are at risk and which controls reduce that risk, before the system reaches production. In AI security, it extends classic software threat modeling to assets that conventional methods overlook: training data, model weights, prompts, embeddings and autonomous tool access.

The practice keeps the familiar cycle of describing the system, finding threats, choosing responses and validating the result. What changes for AI is the threat discovery step, because model behavior itself becomes an attack surface that can be manipulated through data and natural language.

How AI threat modeling extends classic methods

AI threat modeling starts from the same foundation as conventional work: a data flow diagram with trust boundaries, followed by a systematic search for threats at each boundary. The difference is that AI systems contain probabilistic components that follow instructions hidden in data, learn from untrusted sources and produce output that other systems may execute.

Teams therefore add AI-specific elements to the diagram: data collection and labeling pipelines, training jobs, the model registry, inference endpoints, retrieval stores and every tool an agent can call. Each element receives its own trust level, and every path from untrusted content to a privileged action is treated as a candidate threat.

The table below maps the six STRIDE categories to their typical AI counterparts.

STRIDE categoryClassic exampleAI-specific counterpart
SpoofingStolen credentialsForged instructions in retrieved documents
TamperingModified filesData poisoning or a backdoored model artifact
RepudiationMissing audit logsUntraceable agent actions without prompt logs
Information disclosureDatabase leakTraining data extraction or prompt-based exfiltration
Denial of serviceNetwork floodingSponge inputs that maximize compute per request
Elevation of privilegeExploited vulnerabilityPrompt injection that triggers privileged tools
STRIDE categories applied to AI systems

Assets and threat categories specific to AI

The asset inventory in AI threat modeling is broader than in ordinary applications. Besides user data and infrastructure, it covers the training corpus, labels, model weights, system prompts, vector embeddings and the permissions granted to agents. Each asset maps to distinct attack classes described in references such as MITRE ATLAS and NIST AI 100-2.

AssetMain threatTypical control
Training dataPoisoning and backdoorsProvenance checks, data validation, anomaly filtering
Model weightsTheft or serialization attacksModel signing, safe formats, access control
Inference APIEvasion, extraction, abuseRate limits, monitoring, output filtering
System prompt and contextDirect and indirect prompt injectionInstruction hierarchy, spotlighting, isolation
Retrieval storeRAG poisoningSource allowlists, ingestion review
Agent toolsUnauthorized actionsLeast privilege, human approval for risky calls
AI assets, threats and typical controls

A useful shortcut for language model agents is the lethal trifecta: access to private data, exposure to untrusted content and the ability to communicate externally. When all three appear in one component, data exfiltration through prompt injection becomes a realistic threat that should drive architecture decisions.

Frameworks and reference catalogs

No single standard defines AI threat modeling, so practitioners combine a process method with an AI threat catalog. The process method structures the work, and the catalog ensures that known attack techniques are not missed.

FrameworkTypeBest use
STRIDEThreat classification methodSystematic review per diagram element
MITRE ATLASCatalog of adversary tactics and techniquesMapping realistic attack paths
OWASP Top 10 for LLM ApplicationsRisk list for language model appsQuick coverage check for LLM products
OWASP Machine Learning Security Top 10Risk list for classic MLCoverage for training and inference risks
NIST AI 100-2Taxonomy of adversarial machine learningConsistent terminology and attack classes
Secure AI FrameworkControl frameworkLinking threats to organizational controls
Frameworks commonly used in AI threat modeling

Attack trees remain valuable for high-impact scenarios, such as an agent sending customer data to an external address. They break the goal into concrete steps, which makes it easier to see where a single control breaks the chain.

Running an AI threat modeling session

An effective session brings together ML engineers, application developers, security specialists and a product owner, because no single role understands both the model behavior and the business impact. The output is a prioritized list of threats with owners, not a one-time document.

  1. Scope the system, including data sources, model provenance, third-party APIs and agent permissions.
  2. Draw the data flow diagram and mark every trust boundary, especially where untrusted text enters a prompt.
  3. Enumerate threats per element with STRIDE and an AI catalog such as MITRE ATLAS.
  4. Rate likelihood and impact, considering attacker access: white-box, black-box or only indirect content.
  5. Assign mitigations and owners, then verify them through red teaming and automated scanners such as garak or PyRIT.
  6. Revisit the model whenever data sources, tools, models or permissions change.

Prioritization should favor architectural controls over filters. A classifier that blocks malicious prompts reduces risk, but removing an unnecessary tool permission or requiring human confirmation for irreversible actions removes entire threat classes.

Limitations and common mistakes

AI threat modeling faces a fundamental limit: model behavior cannot be fully specified, so no list of threats is complete. New jailbreak techniques appear regularly, and a mitigation that works for one model version may fail after an update. The analysis must therefore be treated as a living artifact, not a compliance checkbox.

  • Modeling only the model, while ignoring data pipelines, plugins and the surrounding application.
  • Assuming the system prompt is secret or that it reliably constrains behavior.
  • Trusting model output as safe input for code execution, SQL queries or web pages.
  • Ignoring the supply chain, including pretrained weights, datasets and serialized model files.
  • Performing the exercise once at design time and never updating it after new tools are added.

In plain words

Before building a bank vault, engineers ask how a thief could get in. AI threat modeling asks the same question about an AI system. It is planned thinking about attacks before they happen.

AI systems have unusual weak points. Someone can feed them bad training data. Someone can hide commands in a document that the AI reads. An AI assistant with access to email could be tricked into sending private files. Threat modeling lists these risks. It then decides which defenses matter most. The list is updated whenever the system changes.

A real-world example

A software company plans an AI assistant that reads support tickets, searches internal documentation and can issue refunds of up to 200 dollars. Before launch, the security team runs a two-hour threat modeling session with the ML engineers and the support product owner.

The data flow diagram shows that customer-written ticket text flows directly into the prompt, while the assistant also holds a refund tool and email access. The team identifies indirect prompt injection as the top threat: a ticket could instruct the model to refund an attacker or forward account data.

The mitigations follow from the diagram. Email access is removed, refunds above 50 dollars require human approval, ticket text is marked as untrusted data in the prompt, and every tool call is logged. A red team test with 300 injection attempts afterward produces no unauthorized refunds, and the threat model is scheduled for review with each new tool.