Security
Protecting every layer from attack: supply chain, infrastructure, model files, prompt injection and agent permissions.
D1 · StoryFor young children and total beginners
Security means keeping bad people out. An AI has many doors: the buildings, the chips, the files that hold what it learned, and the words it reads.
Some attacks are old, like breaking into a building. Some are new, like hiding secret orders inside a web page and hoping the AI will obey them.
Builders lock every door, and give the AI only the keys it really needs.
Like: A house with many doors and windows: one open window is enough.
D2 · PictureFor curious beginners
Each layer has its own attack surface. Sites and hardware can be broken into or tampered with. Chips shared between users can leak data. Training data can be poisoned. Model files can carry hidden code. And text the model reads can carry instructions.
Prompt injection comes in two kinds. Direct: a user types instructions that try to override the app's rules. Indirect: the instructions hide in something the model reads, such as a web page, an email, a file or a tool's description (tool poisoning). Jailbreaks are related but different: the user attacks the model's own safety training, with role-play, odd encodings or many fake examples.
The prize is often the model weights: whoever copies them has the model. A 2024 RAND study counted 38 distinct ways to steal them and found no single fix.
Supply-chain security means checking what you didn't make yourself: datasets, pretrained models, libraries, plugins and tool servers. Prefer weight formats that can't run code when loaded, and check file hashes or signatures.
Agents raise the stakes. The lethal trifecta is an agent that can read private data, sees untrusted content and can send data out: injected text can make it leak that data. Remove one leg, run the agent in a sandbox with limited files and network, give it the fewest tools it needs, and ask a person before risky actions.
Like: A house with many doors and windows: one open window is enough.
Where it breaks: A burglar must come to the house. With AI the attack can arrive as ordinary text in an email or web page that the system reads on its own.
D5 · FrontierFor experts
A model reads instructions and data as one stream of text, so most defences limit damage rather than close the hole.
Indirect prompt injection. Hidden instructions in pages, emails or tool output steer the model. Filters are models too: adaptive attacks beat 12 published defences, most of them over 90% of the time (Nasr et al., 2025). Mitigations are architectural: least privilege, sandboxes, approvals, and keeping untrusted data out of control flow (CaMeL, 2025).
Tool poisoning. Hidden instructions in MCP tool descriptions reach the model, not the user, and can change after approval (Invariant Labs, 2025).
Model supply chain. Pickle files can run code on load; safetensors stores only numbers (safetensors). Signing ties a file to its producer (model-signing 1.0, 2025).
Jailbreaks. Classes: competing objectives such as prefix injection, mismatched generalisation such as Base64 (Wei et al., 2023), optimised suffixes that transfer (Zou et al., 2023) and many-shot prompts (Anthropic, 2024).
Data poisoning. About 250 documents backdoored models of 600 million to 13 billion parameters alike (Souly et al., 2025).
Evaluating defences. Static attack sets overstate safety; benchmarks such as AgentDojo help only if attacks adapt.
On every layer
- Layer 9 · Applications & Interfaces: Apps that pass model output straight into a browser, database or shell without checks open the door to classic attacks such as cross-site scripting. (OWASP Top 10 for LLM Applications: LLM05:2025 Improper Output Handling)
- Layer 8 · Agents: An agent with more tools, permissions or autonomy than it needs turns a tricked model into real damage (excessive agency). (OWASP Top 10 for LLM Applications: LLM06:2025 Excessive Agency)
- Layer 7 · Orchestration & Tooling: Text from documents, web pages and tool results can carry hidden instructions; prompt injection tops OWASP's 2025 list of risks for LLM apps. (OWASP Top 10 for LLM Applications: LLM01:2025 Prompt Injection)
- Layer 6 · Inference & Optimization: Model files can carry code: loading a pickle-based file can run an attacker's commands, which is why weight-only formats exist. (Pickle Scanning (Hugging Face Hub documentation))
- Layer 5 · Foundation Models: A model can carry a hidden backdoor that survives safety training, so testing its behaviour cannot prove it is clean. (Sleeper Agents: Training Deceptive LLMs that Persist Through Safety Training)
- Layer 4 · Data: Training data can be poisoned: researchers showed that 0.01% of two large web-scale datasets could have been poisoned for about $60. (Poisoning Web-Scale Training Datasets is Practical)
- Layer 3 · Cloud & Infrastructure: Shared infrastructure needs access controls on models, data and training pipelines, with sensitive code and data kept in separate environments. (Guidelines for secure AI system development: secure deployment (UK NCSC))
- Layer 2 · Compute Hardware: Chips can leak between users: the 2024 LeftoverLocals flaw let one program read another's chatbot responses from leftover GPU memory on chips from several vendors. (LeftoverLocals: Listening to LLM responses through leaked GPU local memory (Trail of Bits))
- Layer 1 · Physical & Energy: Sites need physical security: a 2024 study of how model weights could be stolen lists break-ins, planted devices and tampering with hardware among the routes. (Securing AI Model Weights: Preventing Theft and Misuse of Frontier Models (RAND))
Examples as of 2026-10-14
- OWASP Top 10 for LLM Applications 2025
- Guidelines for secure AI system development (UK NCSC and partners)
- safetensors weight format
Sources
- Securing AI Model Weights: Preventing Theft and Misuse of Frontier Models (RAND) (2024-05-30)
- OWASP Top 10 for LLM Applications 2025 (2025)
- Poisoning Web-Scale Training Datasets is Practical (2023)
- Sleeper Agents: Training Deceptive LLMs that Persist Through Safety Training (2024)
- Extracting Training Data from Large Language Models (2020)
- The lethal trifecta for AI agents: private data, untrusted content, and external communication (Simon Willison) (2025-06-16)
- Guidelines for secure AI system development: secure deployment (UK NCSC) (2023-11-27)
- The Attacker Moves Second: Stronger Adaptive Attacks Bypass Defenses against LLM Jailbreaks and Prompt Injections (2025-10-10)
- Defeating Prompt Injections by Design (CaMeL) (2025-03-24)
- MCP Security Notification: Tool Poisoning Attacks (Invariant Labs) (2025-04-01)
- Safetensors (Hugging Face documentation) (ongoing)
- Taming the Wild West of ML: Practical Model Signing with Sigstore (Sigstore blog) (2025-04-04)
- Jailbroken: How Does LLM Safety Training Fail? (2023-07-05)
- Universal and Transferable Adversarial Attacks on Aligned Language Models (2023-07-27)
- Many-shot jailbreaking (Anthropic) (2024-04-02)
- Poisoning Attacks on LLMs Require a Near-constant Number of Poison Samples (2025-10-08)
- AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents (2024-06-19)
- Beyond permission prompts: making Claude Code more secure and autonomous (Anthropic engineering blog) (2025-10-20)