Understanding and Mitigating Role Spoofing in LLMs
Ezra Edelman, Benjamin Edelman, Surbhi Goel, Eran Malach
- Published
- Oct 29, 2026
- Source
- arXiv
- URL
- https://arxiv.org/abs/2610.40396
This study examines prompt injections that impersonate a user through malicious tool outputs. It finds that models rely on both content and structural cues to identify conversational roles, and proposes role-prediction probes to detect spoofing.
The paper investigates how language models track who supplied text in a conversation and how attackers exploit that process. Its attacks combine fake formatting or control structure with content that resembles a higher-authority speaker. In a toy setting, adversarial training against content-based injections leaves vulnerability to structure-based attacks, illustrating a limitation of narrowly targeted defenses. The proposed detector uses linear probes trained to predict conversational roles and is reported to work across different settings.