Telling an AI "you are an expert in X" is the oldest prompt trick in the book — and there is a reason it survived. Done well, role prompting and persona assignment shape vocabulary, depth, tone, and even the safety posture of every answer that follows. Done badly, they become decorative fluff. This tutorial separates the two.
When you write
Act as a senior security auditor
at the top of a prompt, you are not flattering the model. You are doing something much more useful — you are anchoring the conditional probability distribution it draws from. The model now generates text that is statistically closer to how senior security auditors actually write: cautious language, references to threat models, attention to attack surfaces. The vocabulary shift alone changes the answer in ways a plain prompt cannot match.
This tutorial covers the difference between a role (a job or expertise) and a persona (a character with personality, voice, and constraints), how to combine them, when to skip them entirely, and the patterns professionals use to make these prompts reliable rather than gimmicky.
A role tells the model what kind of expertise to apply. Example:
You are a tax accountant specialising in UK small businesses.
A persona tells the model who to sound like. Example:
You are Maya, a friendly career coach who uses short sentences and ends every reply with one question. Most real systems layer the two: a role for expertise plus a persona for voice.
The mechanism is conditioning. Every token the model generates is influenced by everything that came before it. A role at the top of the prompt biases every later token toward the language patterns associated with that role in the training data. It is not "pretending" in any human sense — it is a statistical lean.
A role-less prompt forces the model to pick a default voice — usually a generic, helpful-assistant tone that is fine for trivia but flat for any specialised task. The deeper the domain, the more the absence of a role hurts.
No role
Review this contract clause and tell me if it is okay.
"Either party may terminate this agreement at any time
with or without cause upon written notice. Termination
shall be effective immediately upon receipt of such
notice."
The model returns a vague summary — "This clause allows either party to terminate at any time, which is common but you may want to seek legal advice". Useful at the bus-stop level. Useless if you actually need to negotiate the clause.
Layered role prompt
You are a senior commercial contracts lawyer with
fifteen years of experience advising SaaS companies
in the UK. [ROLE]
Style: blunt, plain-English, no Latin phrases unless
necessary. Use bullet points. Always flag risk levels
as Low / Medium / High. [PERSONA + FORMAT]
Constraints:
- Do not give legal advice in the formal sense.
- Always recommend the user consult a qualified solicitor
for binding decisions.
- If a clause is genuinely standard, say so. [CONSTRAINTS]
Task: Review the clause below. Identify (1) what it means
in plain English, (2) the main risk to a small SaaS vendor,
and (3) one safer alternative wording.
Clause:
"""
Either party may terminate this agreement at any time
with or without cause upon written notice. Termination
shall be effective immediately upon receipt of such notice.
"""
Now you get a useful answer: "This is a 'termination for convenience' clause with zero notice period. Risk: High for a SaaS vendor — a customer could terminate mid-implementation and you lose all sunk costs. Safer wording: '...upon thirty (30) days' prior written notice, except in the case of material breach…'"
Tip: For production systems, put the role and persona in the system message and leave user messages for actual tasks. This keeps the persona stable across many turns and prevents users from accidentally overwriting it in a single message.
Pick a single task — for example, "explain why interest rates affect the housing market". Run it three times with three roles: "a friendly economics teacher for 15-year-olds", "a Bank of England policy advisor", and "a cynical newspaper columnist". Compare the vocabulary, structure, and depth.
Design a full persona for a product mascot — name, voice, signature phrases, three things they never say. Use it to write five short customer-support replies. Have a friend read them and guess which persona traits you defined.
Take a role prompt that works well in your usual model and run the same prompt on a different model family. Note which parts transfer and which break. This reveals which behaviours are baked into the model versus genuinely driven by your prompt.
Sign in to join the discussion and post comments.
Sign inPrompt Engineering for Content & Copywriting
Write blogs, ads, emails, and social media content ten times faster with AI. 13 practical tutorials on prompt engineering for content creators and copywriters.
Prompt Engineering for Specific AI Tools
Tool-by-tool mastery — deep dives into ChatGPT, Claude, Gemini, GitHub Copilot, Midjourney, Stable Diffusion, and more. Learn the exact prompting techniques each platform rewards.
Prompt Engineering for Education & Learning
Use AI as your personal tutor. Learn how to study faster, create lesson plans, generate practice questions, master languages, and prepare for competitive exams with smart prompts.
Prompt Engineering for Image Generation
Turn words into stunning visuals. Master AI image generation tools like Midjourney, DALL·E 3, and Stable Diffusion with 18 focused tutorials — from first prompt to full brand identity.
Prompt Engineering for Developers
Use AI as your coding co-pilot. 18 tutorials on writing prompts to generate clean code, debug faster, write tests, build APIs, and ship better software.
Foundations of Prompt Engineering
The must-know basics of prompt engineering. Learn what prompts are, how AI models read them, and how to write clear instructions that get great results.