Role prompting
Definition
Telling a model to take on a role, such as a security reviewer or a patient tutor, to shape its focus, tone and level of detail.
In more detail
Roles usually go in the system prompt. A role is shorthand for many expectations at once: a security reviewer looks for injection and secrets, a tutor asks questions instead of giving answers.
Roles help most with tone and focus, and much less with factual accuracy: telling a model it is an expert does not give it knowledge it lacks. Pair the role with concrete instructions, criteria and examples. A vague role on its own often produces confident filler.
Related terms
Prompt
The input given to a model: instructions, context, examples and the question or task itself, sent as one or more messages in a request.
Prompt engineering
Designing, testing and refining prompts so a model produces the output you need reliably, across many inputs and not just one.
System prompt
Instructions set by the application developer that frame every conversation, such as the assistant's role, rules and output format.
Read more about Role prompting
- Prompting fundamentals: clear tasks, examples and formats
How to write a good prompt: frame the task, say who the output is for, show an example and specify the format, so a model's answers are useful and repeatable.
- Prompt engineering
Writing clear, testable instructions for models and checking them on real inputs.
- Prompt patterns cheat sheet
Copyable prompt patterns for Claude, ChatGPT and Gemini: briefing, examples, output formats, long documents, checking the work and avoiding made-up answers.