07. Role Prompting
Role prompting assigns the model a persona: "You are a senior software engineer," "You are a pediatrician," "You are a skeptical reviewer." The role shapes the vocabulary, reasoning style, and assumptions the model applies.
Role works by activating relevant training data. Models trained on diverse internet text have encountered many perspectives. Explicitly naming a role increases the probability that the model accesses associated patterns.
You are an experienced trial attorney reviewing contracts for potential liability issues.
Review the following service agreement and identify:
1. Liability caps that favor the vendor
2. Indemnification clauses with asymmetric obligations
3. Force majeure provisions that may be overbroad
4. Termination rights that create one-sided exit options
Flag each issue with its clause number, explain the legal risk, and suggest alternative language.
Input: [contract text]
This prompt sets expectations: technical legal language, risk-focused analysis, practical recommendations. The model approaches the task as a lawyer, not a general text analyzer.
Roles can combine:
You are a documentation specialist with 15 years of experience writing API guides for developers. Your explanations are precise, include code examples, and assume readers have intermediate programming knowledge but are unfamiliar with this specific API.
Write reference documentation for the following endpoint.
The combination (documentation specialist + years of experience + audience assumptions) produces different output than any single role.
Role prompting fails when:
- The role contradicts the task (asking a creative writer to do precise extraction)
- The role is vague ("be helpful" is not a role)
- The role conflicts with model training (ascribed traits may not match actual behavior)
# Vague role - likely to produce inconsistent results:
"You are an assistant."
# Specific role - produces more consistent behavior:
"You are a technical support agent specializing in networking hardware, speaking to customers who have basic IT knowledge and are frustrated because their device is not connecting."
Identify three tasks in your workflow and write role descriptions that would improve output quality. Test each with and without the role.