Role Prompting: 5 Recipes That Ship (2026)
Five paste-ready role prompting recipes for 2026: domain expert, audience, format contract, adversary, and voice, each with its failure mode.
Updated on July 9, 2026

On this page
> Quick answer (2026): Role prompting means telling the model who to be before you tell it what to do, like "You are a senior SQL reviewer." It reliably shapes tone, format, and register. It does not reliably make the model smarter. Use roles to control voice and audience; use few-shot examples, chain of thought, or tools to control accuracy. Below are five paste-ready role prompts, each with the failure mode nobody prints.
Both Anthropic's system-prompt guidance and
OpenAI's prompting guide tell you to set a role. What they skip: a role changes how the model writes far more than how well it reasons. Assign roles on purpose, for the thing they actually do.
Recipe 1: The domain expert
Set expertise to raise precision and vocabulary.
You are a senior Postgres DBA with 15 years on high-write systems.
Review this schema. Flag anything that will not scale past 10M rows.
Why it works: the role pulls domain vocabulary and the right level of detail to the front. You get "partial index" and "bloat," not "consider indexing."
Fails when: you expect the persona to add knowledge the model lacks. It will not. A confident "senior DBA" hallucinates just as confidently, and now it sounds authoritative. Verify the claims; the title is not evidence.
Recipe 2: The audience, not the expert
Set who the answer is for, not who writes it.
Explain this deploy failure to a backend engineer who has never used Kubernetes.
No k8s jargon without a one-line definition.
Why it works: audience roles control register better than expert roles. "Explain to a CFO" and "explain to a junior" produce genuinely different, useful outputs from the same facts.
Fails when: the audience is so simple the model drops detail you needed. "Explain to a five year old" is cute and lossy. Pick the least-expert reader who still needs the real answer.
Recipe 3: The strict format contract
Use the role as a behavioral contract, not a personality.
You are a JSON API. You return only valid JSON matching this shape:
{"verdict": "pass|fail", "reasons": string[]}
No prose. No markdown fences. No apology.
Why it works: framing the model as a machine suppresses the chatty preamble instruct-tuned models love. "You are an API" beats "please respond in JSON" for compliance.
Fails when: the role alone still drifts on edge cases. A role is not a schema. For anything you parse, pair it with real structured output, the way the structured-output recipes do, so a bad response fails loudly instead of silently.
Recipe 4: The adversary
Assign a hostile reviewer to surface what a helpful one hides.
You are a skeptical security reviewer who assumes this code is exploitable.
Find the three most likely ways it breaks in production. Be specific.
Why it works: the default assistant is agreeable. An adversarial role gives it permission to disagree, which surfaces real failure modes a "helpful assistant" smooths over.
Fails when: it manufactures nitpicks to satisfy the role. Ask for the top three, ranked, with a concrete trigger for each. A cap forces prioritization instead of theater.
Recipe 5: The voice, on purpose
Use a persona for style transfer, and know that is all it is.
Rewrite this changelog as a terse senior engineer. Short sentences.
No adjectives. State what changed and what breaks. Nothing else.
Why it works: personas are excellent at tone. Style, length, and formality transfer cleanly. This is the thing role prompting is genuinely best at.
Fails when: you expect the terse-senior voice to also be more correct. It changes the wrapper, not the content. Voice and accuracy are separate dials.
When role prompting is theater
The consensus says "you are an expert" makes the model perform better. The evidence is thinner than the advice.
Multiple 2024 and 2025 studies found that adding an expert persona to the system prompt does not reliably improve accuracy on reasoning and knowledge benchmarks, and sometimes nudges it down. PromptHub's roundup of the persona research is a fair summary: personas move tone reliably and accuracy barely.
So spend roles where they pay:
- Voice, register, and audience: yes. This is what roles do best.
- Format compliance: yes, as a contract, backed by a schema.
- Accuracy and reasoning: no. Reach for few-shot examples, chain of thought, or a tool call instead.
On modern instruction-tuned and reasoning models the persona effect is smaller still. Assign the role for what it does. Do not pay it to do what it cannot.
Cost to test: $0.01 to run all five roles once on a small 2026 model.
Written by
Sam Q.Sam Q. ships prompt recipes at PromptAttic. Terse by default. Tests everything before writing it down.
FAQ
What is a role prompt?
A role prompt tells the model who to be before you tell it what to do, usually in the system message, like "You are a senior Postgres DBA." It sets vocabulary, tone, and register for the response. It shapes how the model writes; it does not add knowledge the model does not already have.
Does role prompting actually work?
Partly. Multiple 2024 and 2025 studies found that adding an expert persona reliably changes tone, format, and register but does not reliably improve accuracy on reasoning or knowledge benchmarks, and sometimes lowers it. Use roles for voice and audience control, not as a shortcut to correctness.
What are the three types of prompting?
The three most cited are role (or persona) prompting, few-shot prompting, and chain-of-thought prompting. Role prompting sets who the model is, few-shot shows examples of the task, and chain of thought asks the model to reason step by step. They are complementary and often combined.
What is the difference between a role prompt and a system prompt?
A system prompt is the top-level instruction slot that persists across the conversation. A role prompt is one common thing you put in it, assigning an identity like "You are a code reviewer." So role prompting is usually delivered through the system prompt, but a system prompt can also hold rules, format contracts, and constraints that are not roles.
What is an example of role prompting?
"You are a skeptical security reviewer who assumes this code is exploitable. Find the three most likely ways it breaks in production." The adversarial role gives the model permission to disagree, which surfaces failure modes a default helpful assistant tends to smooth over.
When should you not use role prompting?
Skip it when you are chasing accuracy rather than voice. A persona will not make the model reason better; reach for few-shot examples, chain of thought, or a tool call instead. Also drop the role on trivial one-step tasks where it only adds tokens.
Related recipes
Claude Structured Output: 3 Prompt Recipes That Ship (June 2026)
Three production-grade Claude structured output recipes for June 2026. Invoice extraction on Sonnet 4.6, support triage on Haiku 4.5, NL to SQL on Opus 4.7. Real cost per call. Three failure modes the docs do not warn you about.
Chain of Thought Prompting: 5 Examples That Ship (2026)
Five paste-ready chain-of-thought prompting examples for 2026, each with its failure mode, plus when reasoning out loud makes the answer worse.
Prompt Chaining: 5 Recipes That Ship (2026)
Five paste-ready prompt chaining recipes for 2026: extract-then-reason, draft-critique-rewrite, route, map-reduce, and generate-then-gate, each with its failure mode.


