[2603.12277] Prompt Injection as Role Confusion
Abstract:LLMs see the world as a single stream of text, partitioned into roles like or . We trace prompt injection to role confusion: models perceive the source of text from how it sounds, not its labeled role. A command hidden in a webpage hijacks an agent simply because it sounds like text, despite its label. We design role probes to measure how LLMs internally perceive "who is speaking," and find that injected text occupies the same representational space as the trusted role it imitates. We demonstrate this with CoT Forgery, a zero-shot attack that injects fabricated reasoning into user prompts and tool outputs. Models mistake the forgery for their own thoughts, yielding 60% attack success against frontier models with near-zero baselines. Strikingly, the degree of role confusion predicts attack success before a single token is generated. This mechanism generalizes beyond CoT Forgery to standard agent prompt injections, revealing prompt injection as a measurable consequence of role perception. To the model, sounding like a role is indistinguishable from being one. Project page and writeup: this https URL
Prompt Injection as Role Confusion Charles Ye * 1 Jasmine Cui * 1 Dylan Hadfield-Menell 2 Abstract foundation of LLM security. LLMs see the world as a single stream of text, par- Yet these defenses fail conspicuously against prompt injec- titioned into roles like <user> or <tool>. We tion attacks…
related reading
- A Mechanistic Explanation of Prompt Injection (and why you should study roles) — LessWronglesswrong.com
- Prompt Injection as Role Confusionrole-confusion.github.io
- Role confusion: sounding like the cause is indistinguishable from being it. — LessWronglesswrong.com
- llm-security/README.md at main · greshake/llm-securitygithub.com
- CaMeL offers a promising new direction for mitigating prompt injection attackssimonwillison.net
- The Persona Selection Model: Why AI Assistants might Behave like Humansalignment.anthropic.com
- The lethal trifecta for AI agents: private data, untrusted content, and external communicationsimonwillison.net
- Prefill awareness: can LLMs tell when “their” message history has been tampered with? — LessWronglesswrong.com
- The Dual LLM pattern for building AI assistants that can resist prompt injectionsimonwillison.net
- [2401.05566] Sleeper Agents: Training Deceptive LLMs that Persist Through Safety Trainingarxiv.org
- HackAPromptpaper.hackaprompt.com
- Discovering Language Model Behaviors with Model-Written Evaluations — LessWronglesswrong.com