Guide
Role prompting
Role prompting tells the model which job to perform and which standard to use. “Act as a staff engineer reviewing a pull request” is a role. It narrows tone and priorities. It does not give the model credentials it does not have.
Updated 2026-09-23
Before and after
Before
Act as an expert and explain this function.
After
You are a senior TypeScript engineer reviewing code for a teammate who knows JavaScript but not this repo. Explain what the function does, then list bugs and missing tests. Under 200 words. Function: [paste].
How to do it
1. Name the job and the situation
“Staff engineer, reviewing a TypeScript pull request for a payments service” beats “act as an expert.”
2. Name the audience
The reader changes the answer. A role without an audience still drifts toward a generic blog voice.
3. Give the role a checklist
What the role must look for: bugs, security, missing tests. A title alone is a weak constraint.
4. Do not use a role to pretend expertise you will not verify
Medical, legal, and financial answers still need a qualified person. The role only changes style and emphasis.
When to use this
Use a role when the same task would be done differently by different jobs: a lawyer, a copy editor, a teacher for beginners. Skip the role when the task is mechanical, such as extracting emails from a paragraph. A costume does not fix missing source text.
What a role changes
A role shifts vocabulary, what gets mentioned first, and how strict the critique is. It does not retrieve private knowledge and it does not make a calculation correct. Pair it with the source material and, for hard problems, with chain of thought.
OpenAI’s prompting guidance treats audience and persona as part of a clear instruction, not as a magic prefix. If the rest of the prompt is vague, “act as” will not save it.
Sources
Questions
What is role prompting?
Role prompting assigns the model a job, audience, and standard so the answer uses that frame. It is the “act as” pattern with enough detail to change priorities.
Does “act as an expert” work?
Barely. Name the job, the audience, and the checklist. “Expert” does not tell the model what to optimize for.
Where should the role go?
In a system prompt if you have one, so it applies every turn. Otherwise put it in the first lines of the user message, before the task.