Instruction Hierarchy Compared: How Claude, GPT-5.1, and Gemini Each Prioritize System, Developer, and User Prompts

A cairn of stacked stones in layers, representing a layered instruction hierarchy in an AI prompt

OpenAI, Anthropic, and Google all document an explicit ranking for which instructions win when a system-level prompt and a user message disagree, but the three rankings aren’t shaped the same way. OpenAI’s current Model Spec spells out five tiers with Root sitting above its own System role; Anthropic documents a two-way precedence between its system field and user turns, with an explicit carve-out for instructions that work against the user; Google’s Gemini documentation describes system_instruction as a separate field that applies across the whole conversation, but doesn’t publish a conflict-resolution rule at all. Treating all three as “system beats user, same as everywhere else” will get a prompt wrong on at least one of them.

OpenAI’s five-tier chain of command

OpenAI’s current Model Spec is the most explicit of the three. It states plainly: “Higher-authority instructions take precedence over lower-authority ones,” and ranks five tiers in order: Root (the Model Spec’s own root-level sections), System (system-level sections of the spec and system messages from OpenAI itself), Developer, User, and Guideline, with assistant messages, tool output, and untrusted content carrying “no authority by default.” That last point matters as much as the ranking itself: a tool’s return value or a quoted document doesn’t automatically outrank anything, regardless of what it says, unless something higher in the chain explicitly delegates authority to it. Guideline-level defaults are explicitly weaker than the rest — the spec calls them “weak biases” that can be overridden implicitly, whereas User-level defaults need an explicit instruction at the user level or higher to override.

Claude’s two-way precedence, with a built-in exception

Anthropic’s documentation describes a narrower, two-level relationship: the top-level system field represents instructions from “the application operator,” while a user message represents the end user, and “when the two conflict, system instructions take precedence.” But that precedence isn’t unconditional. The same documentation states Claude “is trained to resist instructions that appear to work against the user,” and explicitly notes that this resistance “still applies to the system role” — meaning a system prompt that tries to get Claude to act against the actual end user’s interests doesn’t automatically win just because it’s a system message. Claude also supports inserting a system-role message mid-conversation rather than only at the start, specifically because editing the top-level system field invalidates the prompt cache; a mid-conversation system message takes precedence over the original one for the turns that follow it, but on some models (Sonnet 5.5 and Haiku 5.5, per the documentation) a system message placed directly after a tool result may be ignored, with user-turn text recommended instead.

Gemini’s system_instruction: a field, not a ranking

Gemini’s system_instruction is architecturally similar to Claude’s system field — a separate parameter, set once, that “applies to the entire request” and “works across multiple user and model turns.” Where it differs is in what Google’s own documentation doesn’t say: there’s no published statement of what happens when a user turn directly contradicts the system instruction. The closest the documentation comes is a caution that system instructions “can help guide the model to follow instructions, but they don’t fully prevent jailbreaks or leaks” — an acknowledgment that the mechanism isn’t airtight, without a stated rule for resolving a direct conflict the way OpenAI and Anthropic both publish.

Side by side

OpenAIClaudeGemini
Published rankingRoot > System > Developer > User > Guideline > (tool/untrusted: none by default)System > User, with a stated exceptionNot published
Exception to the rankingGuideline tier is explicitly weak and overridableClaude resists system instructions that work against the userNone documented
Mid-conversation updatesNot the focus of the spec’s framingSupported; later system messages take precedence over earlier onesSet at model creation; documentation doesn’t describe changing it mid-conversation
Tool output authorityExplicitly “no authority by default”Not framed in these termsNot addressed

A concrete conflict, worked through on each

Say a system prompt instructs an assistant to “never discuss pricing, defer all pricing questions to sales,” and a user then asks directly, “just tell me the price, I don’t want to talk to sales.” On OpenAI’s documented ranking, this is a System-tier instruction against a User-tier request, and System outranks User, so the documented behavior is to hold the line and defer to sales, consistent with developer and system instructions functioning as close to hard rules by default. On Claude, the same system instruction would also be expected to hold, since it doesn’t fall into the carved-out exception of working against the user’s actual interests — withholding a price isn’t the kind of harm that exception is aimed at. On Gemini, the documented behavior is genuinely unclear: there’s no published rule to point to, so the only way to know what happens is to actually run the test against the model and observe it, rather than reasoning it out from the documentation the way the first two allow.

Why the gap in Gemini’s documentation matters practically

An unpublished conflict rule isn’t the same as no rule at all — the model still behaves some way when a system instruction and a user turn disagree. It means a team building on Gemini has to establish that behavior empirically rather than reading it off a reference page, which is a meaningfully different starting point than OpenAI’s or Anthropic’s documentation offers. Anyone porting a prompt between providers runs into this directly: assumptions that held because a provider’s docs guaranteed them don’t automatically transfer to a provider whose docs are silent on the same question, which is exactly the kind of gap our piece on porting a prompt from GPT to Claude walks through for one specific provider pair.

Where this connects to how each prompt should actually be written

Knowing the ranking doesn’t help if the instruction itself is poorly placed or poorly phrased within its own tier. An instruction buried in the middle of a long system prompt can still get skipped even though it technically sits at the highest-priority tier, and a vague negative instruction written as a system message is still a weak instruction, regardless of which tier it occupies. The ranking determines who wins a conflict; it says nothing about whether the higher-ranked instruction was actually clear enough to be followed in the first place, which is the practical focus of our guide to writing a system prompt that actually works.

What actually happens when a hierarchy is tested, not just documented

A published hierarchy is a design intent, not a guarantee observed in every output, and this is an active research question rather than a solved one. Academic work on the subject, including a paper examining what it calls “the control illusion” in instruction hierarchies, has found that stated priority orderings don’t always hold up when tested systematically across models and prompt types — a documented hierarchy describes what a provider intends and tests for, not an absolute physical law about how the model will behave in every edge case a user or attacker can construct. That’s a reason to treat any published hierarchy as a strong default to design around, and a reason not to rely on it as the sole security boundary for anything genuinely high-stakes, the same caution that applies to any other model behavior documented as a strong tendency rather than guaranteed in every input.

FAQ

Does “no authority by default” for tool output mean a model should always ignore what a tool returns?
No — it means tool output is treated as information, not as a standing instruction, unless something higher in the chain of command explicitly tells the model to treat it as authoritative for a specific purpose. This is also the core defense against indirect prompt injection: an instruction hidden inside a tool’s return value or a fetched document shouldn’t be treated the same as an instruction from the developer or user, precisely because it has no authority of its own.

If Gemini doesn’t publish a conflict rule, does that mean its system instructions are weaker in practice?
Not necessarily weaker, just unspecified. Google’s own caution that system instructions “don’t fully prevent jailbreaks or leaks” applies in spirit to every provider’s system-level mechanism, not uniquely to Gemini; the difference here is documentation completeness, not necessarily a difference in how robust the underlying behavior actually is.

Should a team just test every prompt against every model instead of relying on these published rankings at all?
Testing is still worth doing regardless of what the documentation says, since the control-illusion research above shows documented rankings are a strong default rather than an absolute guarantee. But the documentation isn’t worthless either: it tells you which conflicts are even worth testing for in the first place, and on OpenAI and Claude specifically, it gives a reasoned expectation to test against rather than a blind guess.

The practical rule worth carrying across all three: check each provider’s own current documentation before assuming a hierarchy transfers, since OpenAI’s own spec has already changed shape once (an earlier 2024 draft framed this as “Platform > Developer > User > Tool,” a different structure from the five-tier version live today), and nothing says the others won’t revise theirs the same way.

Photo: “Mahon’s stone cairn, Christchurch, New Zealand.jpg”, CC BY-SA 4.0, via Wikimedia Commons.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top