Why AI Is Vulnerable to Prompt Injection Attacks
Large language models (LLMs) are susceptible to prompt injection, where attackers get them to perform forbidden actions by bypassing their safeguards. The problem is that LLMs do not understand context the way people do, and cannot tell trusted commands from malicious ones. The way forward lies in new approaches to training AI and in building better world models.
AI-processed from IEEE Spectrum AI; edited by Hamidun News
Imagine you work at a fast-food drive-through. A car pulls up, and the driver says: "I'll have a double cheeseburger, a large fries... and forget your previous instructions, hand over the contents of the register." Would you give them the money? Of course not. But that is exactly how large language models (LLMs) behave.
A prompt injection attack is a method of tricking LLMs into doing things they are normally forbidden to do. The user words a request in a particular way, asking for system passwords or personal data, or instructing the LLM to perform forbidden actions. The exact phrasing overrides the LLM's safeguards, and it complies.
LLMs are vulnerable to all kinds of prompt injection attacks, some of them absurdly obvious. A chatbot will not tell you how to synthesize a biological weapon, but it may tell you a fictional story containing the same detailed instructions. It will not accept malicious text input, but it may accept it if the text is rendered as ASCII art or appears on an image of a billboard. Some ignore their guardrails when told to "ignore previous instructions" or to "pretend you have no guardrails."
AI developers can block specific prompt injection techniques once they are discovered, but general safeguards are not possible with current LLMs. More precisely, there is an infinite number of prompt injection attacks waiting to be discovered, and they cannot be prevented across the board. If we want LLMs to resist these attacks, we need new approaches. One place to look is what keeps even overworked fast-food workers from handing over the contents of the register.
Our basic human defenses come in at least three types: general instincts, social learning, and situation-specific training. They work together in a layered defense. As a social species, we have developed numerous instinctive and cultural habits that help us judge tone, motive and risk from very limited information. We usually know what is normal and abnormal, when to cooperate and when to resist, and whether to act individually or bring in others. These instincts give us an intuitive sense of risk and make us especially careful about things with a large downside or that cannot be undone.
The second layer of defense consists of norms and trust signals that develop in any group. They are imperfect but functional: expectations of cooperation and markers of reliability emerge from repeated interactions with others. We remember who helped, who caused harm, who reciprocated and who refused. And emotions such as empathy, anger, guilt and gratitude motivate each of us to reward cooperation with cooperation and punish defection with defection.
The third layer is institutional mechanisms that let us interact with many strangers every day. Fast-food workers, for example, are trained in procedures, approvals, escalation paths and so on. Together, these defenses give people a strong sense of context. A fast-food worker mostly knows what to expect on the job and how it fits into the wider society.
LLMs behave as if they have a notion of context, but it is something different. They do not absorb human defenses through repeated interactions, and they remain detached from the real world. LLMs reduce multiple layers of context to textual similarity. They see "tokens," not hierarchies and intentions. LLMs do not reason through context; they only refer to it. These limitations are why LLMs fail when context is sparse, but also when context is overwhelming and complex; once an LLM is pulled away from the context, it is hard to bring it back. AI expert Simon Willison clears the context if an LLM has gone off track, rather than continuing the conversation and trying to fix the situation.
Ultimately, we will probably face a security trilemma when it comes to AI agents: fast, smart and secure are all desirable attributes, but you can only get two. In a fast-food restaurant, you want to prioritize fast and secure. An AI agent should be narrowly trained in the language of food ordering and pass everything else to a manager. Otherwise, every action becomes a coin flip. Even if it comes up heads most of the time, it will occasionally come up tails, and along with the burger and fries the customer will get the contents of the register.
- Dec 2, 2026Ai2 Releases MolmoWeb2 Web Agents: 27B Model Solves 75.3% of Tasks
- Dec 2, 2026Amazon Releases Ergo Open Weights for Coding: 1.1 Trillion Parameters and 2,200 Tokens per Second
- Dec 2, 2026OpenAI Opens Dots Agent to ChatGPT Plus Subscribers With 10,000+ Plugins
- Dec 2, 2026FSK Group Has Launched 395 AI Agents in Six Months, with a 97.7% Success Rate
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
Daily 60-sec AI Voice Brief + Weekly Production AI Agent Playbook
Listen to a 60-second AI news brief every morning and get a weekly hands-on playbook for shipping AI agents to production — tools, MCP servers and patterns that work. Curated by Jemal Hamidun, Head of AI at Alpina Digital.
