Match each role marker to the kind of content it should carry in a well engineered context
Drag each answer to line up with its matching prompt
system
The current human turn, including the latest question and any user supplied content
developer
Tool call results, with stable identifiers, scoped to the recent tail
user
Prior model turns plus any explicit reasoning or plan blocks the agent has chosen to keep
assistant
Static persona, policies, output contract, content that does not change between turns
tool
Application level rules and tool definitions the user is not supposed to override
Role markers split the prompt by content stability and trust: system and developer hold static rules, user and tool hold dynamic input, assistant holds prior model output.
Think of a workplace where every message gets stamped before it goes on the bulletin board. The boss's stamp goes on policies and dress codes that hang there all year. The team-lead stamp goes on project-specific rules. The customer stamp goes on incoming questions. The employee stamp goes on the answers your team already gave. The system stamp goes on receipts from machines on the shop floor. Everyone on the board reads the stamp before reading the message, and decides how much weight to give it. Role markers in an LLM prompt do exactly this stamping. The model has been trained to trust and use each stamp differently.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Every modern LLM API ships a structured prompt: a list of messages, each with a role marker. The markers look like labels but they carry semantic weight. The model has been post-trained to read system messages, developer messages, user messages, assistant messages, and tool messages differently. Treating them as interchangeable string slots is one of the most common mistakes in early context-engineering work.
This card walks through the five common role markers, what each one is for, and what the model actually does when you put the wrong content in the wrong marker.
The five common role markers
system carries the static layer: persona, hard policies, refusal rules, output-schema descriptions, brand voice, language constraints. The defining property is that the content does not change between turns of the same session. Anthropic exposes this as a top-level system parameter; OpenAI and Google have analogous structures.
developer is OpenAI's newer split for application-layer rules: tool definitions, app-specific constraints, behaviors the end user is not allowed to override. On Anthropic and Google this content goes in system with explicit framing.
user carries the current human input. The latest question and any user-uploaded content for this turn.
assistant carries prior model output. Completed assistant turns from earlier in the session, plus any plan or scratchpad blocks the agent chose to retain.
tool carries tool-call results. Each entry should carry a stable identifier (tool_use_id on Anthropic, tool_call_id on OpenAI) so later assistant turns can cite it.
The structure is the contract
The model uses the role markers to decide how to read the content. That makes them part of the prompt's meaning, not a routing detail.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- OpenAI Responses API for GPT-5.5 explicitly distinguishes system, developer, and user roles with instruction-hierarchy semantics.
- Anthropic Messages API for Claude Opus 4.7 uses a top-level system parameter for static rules and a tool_result content block inside user messages for tool outputs, with structural separation.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you defend against a prompt-injection attempt that tries to override the system message from user content?
Lean on the trust hierarchy: keep all security-critical instructions in system, never echo user content into the system block, and add explicit refusal patterns for instruction-override attempts.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Putting tool results in the user message because that is where the new content arrived. The model treats user content as a request, not as evidence, and the contract blurs.
60 second bullets to scan on the way to the call.
What are the five common role markers and the purpose of each?
What is the trust hierarchy across roles?
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.