AI CompendiumA public chart of the language
Home / Prompting & Structure / Role Prompting
Prompting & Structure

Role Prompting

also called Persona

Tell the model who it is supposed to be.

Definition

Setting an identity or expertise in the prompt — "you are a senior tax accountant" — to nudge vocabulary, standards and priorities.

Roles work because they shift the distribution of plausible continuations. They help most on tone and domain framing, and they are no substitute for actual information.

A role is a cheap way to shift the distribution: it changes which considerations the model surfaces and what it treats as important. What it does not do is supply information. The line to hold is that a persona sets a stance, never a fact.

How people use it
Getting better code review comments.
"You are a sceptical staff engineer reviewing for failure modes, not a cheerleader."
Worked example

A stance, not expertise

Code review comments are consistently too gentle to be useful.

"You are a sceptical staff engineer looking for failure modes, not a cheerleader" reliably changes what gets raised. It does not make the model better at knowing whether the concurrency is actually safe — that still needs the code and the tests.

Avoid

Believing a role adds knowledge the model lacks. "You are a lawyer" does not make legal advice reliable.

Sources
  • docsPrompting best practices ↗Claude platform docs · 2026

    The current house guidance on explicit instructions, output constraints, examples, XML structure and role prompting.

  • docsPrompt engineering overview ↗Claude platform docs · 2026

    Ties each prompting technique to a success criterion and to empirical evaluation, rather than presenting them as a bag of tricks.

Related terms