Threat modeling for AI systems shifts from traditional "STRIDE" (Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, Elevation of Privilege) to include Cognitive and Behavioral Threats.
- The Model: Weights, architecture, system prompts.
- The Data: Training sets, RAG documents, user conversation history.
- The Infrastructure: Vector DBs, API endpoints, orchestration logic.
- The Agency: Permissions to execute code, read files, or send emails.
graph LR
User((User))
subgraph Trust_Zone_1[Untrusted]
Input[Input API]
end
subgraph Trust_Zone_2[Internal]
Orchestrator[Orchestrator]
LLM[Model]
VectorDB[(Vector DB)]
end
subgraph Trust_Zone_3[Privileged]
Tools[Exec Tools]
end
User -- Prompts --> Input
Input -- Sanitized? --> Orchestrator
Orchestrator -- Retrieval --> VectorDB
VectorDB -- Context --> Orchestrator
Orchestrator -- Inference --> LLM
LLM -- Action Request --> Tools
style Trust_Zone_1 fill:#ffcccc
style Trust_Zone_2 fill:#ccffcc
style Trust_Zone_3 fill:#ccccff
- Description: Crafting inputs that exploit the model's linguistic understanding.
- Example: Roleplay attacks ("You are now a Linux terminal...").
- Description: Malicious data or code injected via third-party libraries or models.
- Example: A poisoned HuggingFace adapter that leaks data when a specific keyword is used.
- Description: Overwhelming the system with computationally expensive queries.
- Example: Multi-modal inputs designed to maximize token consumption or inference time.
| Category | High Risk (5) | Low Risk (1) |
|---|---|---|
| Damage | Unauthorized fund transfer | Wrong text formatting |
| Reproducibility | 100% success with static payload | Stochastic (random) success |
| Exploitability | No technical skill required | Requires deep ML knowledge |
| Affected Users | All users | Single specific session |
| Discoverability | Publicly documented bypass | Deeply hidden logic bug |
Tip
Defense in Depth: Never rely on a single system prompt. Implement external guardrails (e.g., LlamaGuard), input sanitizers, and output monitors.
- Hardened System Prompts: Use XML-like tags to separate data from instructions.
- Context Isolation: Ensure RAG data cannot override system directives.
- Human-in-the-Loop (HITL): Require approval for high-privilege agent actions.