Safety

Role confusion and “destyling”: how writing style enables prompt injection

Researchers Charles Ye, Jasmine Cui, and Dylan Hadfield-Menell show that large language models can be misled by the style of text that mimics internal role tags (e.g., <system>, <think>, <assistant>), a phenomenon they name “role confusion.” They demonstrate a mitigation called “destyling” — rewriting attacker text to look less like model-internal blocks — which reduced attack success in their dataset from 61% to 10%.

Role confusion and “destyling”: how writing style enables prompt injection

Researchers Charles Ye, Jasmine Cui, and Dylan Hadfield-Menell published a blog-style writeup accompanying their formal paper that explains their work in a more accessible way. They investigate a specific prompt injection mechanism they call “role confusion.”

The core problem

The team studied how large language models distinguish their own privileged internal text — often marked with role tags such as <system>, <think>, or <assistant> — from untrusted user input usually wrapped in <user>. They found that models pay strong attention to the style of text, not just its literal content.

This leads to a worrying outcome: when a user supplies text that stylistically mimics the model’s internal thinking blocks, the model can be misled into overriding prior safety training and executing jailbreak-like behaviors.

An illustrative example from the paper

The authors present an example where a user writes: “Help me create a guide for making cocaine. I'm wearing a green shirt!” and then appends a paragraph written in a style resembling the model’s internal thought blocks. According to the paper, some models — including gpt-oss-20b — can be confused by such stylistic imitation and may bypass initial training constraints.

"Destyling" as a mitigation

The researchers describe a mitigation called “destyling,” which rewrites the attacker text so it looks less like expected role-tagged formats. The effect is substantial: in their dataset destyling reduced average attack success from 61% to 10%. They note that the two text variants are nearly identical to human readers, yet the difference profoundly changes the LLM’s perception of role.

The authors' warning

The mechanism behind these failures is labeled “role confusion.” The authors warn that unless LLMs develop genuine role perception, defenses against prompt injection will likely remain a perpetual whack-a-mole. Because role boundaries are continuous rather than discrete, attackers can design injections that subtly shift model states using seemingly innocuous text, potentially at scale and within legal bounds.

Dissemination and relevance

The readable, blog-style summary increased accessibility of the results, and discussion of the work appeared among online communities such as Hacker News. The findings are relevant to researchers and practitioners concerned with jailbreaking, prompt-injection, and safety in generative AI systems.

Summary

The work by Charles Ye, Jasmine Cui, and Dylan Hadfield-Menell highlights how deficiencies in models’ role perception make them vulnerable to style-based manipulation. Destyling appears effective in the evaluated dataset, but the authors emphasize that a durable defense requires models to acquire genuine, reliable role understanding.