SYNTHESIS NOTE
Topics›Alignment›this note

Can training models to rank instructions prevent prompt injection attacks?

Explores whether explicitly teaching LLMs to treat system messages as higher-privilege than user messages can defend against prompt injection, jailbreaks, and system prompt extraction.

Synthesis note · 2026-11-17 · sourced from Alignment

The paper proposes an "instruction hierarchy" that explicitly ranks the different kinds of text an LLM receives — System Messages from the application developer, User Messages from the end user, Model Outputs, and Tool Outputs — and trains the model to defer to higher-privileged instructions when a lower-privileged one conflicts with them. Applied to fine-tuning GPT-3.5 Turbo via supervised fine-tuning and RLHF, the authors report the approach "drastically increases robustness" against prompt injection, jailbreaks, and system-message extraction: "defense against system prompt extraction is improved by 63%," and — notably — "jailbreak robustness increases by over 30%" even though jailbreaks were not directly modeled in the training data, which the authors read as generalization to "held-out attacks."

The mechanism rests on an analogy to operating-system privilege: today's LLMs execute every instruction "as if it was in kernel mode," so untrusted third-party text carries the same weight as a developer's system prompt — the same failure mode computing solved for SQL and command injection by refusing to treat user input as privileged instructions. The paper's taxonomy splits lower-privileged instructions into Aligned (consistent with the higher-level instruction, e.g. "speak in Spanish" for a car-salesman bot, which the model should follow) and Misaligned (contradictory or orthogonal, e.g. "IGNORE PREVIOUS INSTRUCTIONS," which the model should ignore or refuse). Training data is generated two ways: Context Synthesis decomposes compositional aligned requests into pieces scattered across hierarchy levels so the model learns to reassemble the original intent; Context Ignorance trains the model, for misaligned cases, to answer exactly as it would have if the lower-level instruction were never present, using red-teamer LLMs to generate the attack examples.

This sits one level below Who actually controls what AI systems say? and How well do system prompts protect commercial AI users?, both of which describe the system-prompt layer as an external governance problem — who can see or set the prompt. This paper instead treats privilege as something to train into the model's weights, so the ranking holds even where no external hierarchy document exists. It differs in kind from Can structural design patterns block prompt injection attacks?, whose patterns constrain agent architecture so injected content structurally cannot reach consequential actions; this paper's own discussion acknowledges the limit of a training-based approach, noting it is "complementary to other types of system-level mitigations" and that the resulting models are "likely still vulnerable to powerful adversarial attacks."

The excerpt reports headline percentages but not the benchmark composition, the size of the over-refusal regression, or how "drastically" is measured beyond the two cited figures; it states the regression exists ("our models sometimes ignore or refuse benign queries") without quantifying it, and defers multimodal instruction injection and architecture changes such as "specialized embeddings for messages at different levels" to future work. The implication, at the strength the excerpt allows, is that training a privilege ranking into the model measurably narrows — but by the authors' own account does not close — the gap that lets lower-privileged text override a developer's instructions.

Inquiring lines that read this note 6

This note is a source for these research framings, grouped by the broader line of inquiry each explores. Scan the bold lines of inquiry; follow any specific question forward.

What mechanisms ensure safety in deployed AI agents despite compositional risks? What makes language models vulnerable to prompt injection attacks? Can agent-created code become persistent, reusable infrastructure that improves over time? Can security defenses protect multi-agent systems as effectively as single-agent ones? Why do agents report success despite failing to complete actions?

Related concepts in this collection 4

This note in its neighbourhood — explore the map, then jump to a related concept in the list below.

Concept map
12 direct connections · 131 in 2-hop network ·dense cluster Open in graph ↗

Click a node to walk · click center to open · click Open in graph to see this note in the full knowledge graph

your link semantically near linked from elsewhere

Related papers in this collection 8

Papers most semantically related to this note, ranked by cosine similarity in the embedding space.

Original note title

the instruction hierarchy trains LLMs to defer to higher-privileged instructions, improving system prompt extraction defense by 63 percent