The Role-Assignment Technique: Telling AI "Who" It Is
The role-assignment prompt technique: raising answer quality by giving AI the right role. Working and non-working role examples, with practical rules.

A role-assignment prompt is an instruction showing the model with which responsibility, viewpoint and style it should answer. Writing "you are the world's best marketer" does not turn the model into a marketing specialist. A role is useful only when it changes visible behaviour in the answer: what to check, what to prioritise, where to stop and in which form to present the result. Prompt techniques don't substitute for one another; each solves a different control problem.
The difference looks small; in the outcome it changes everything. The first sentence grants status. The second sentence assigns work. For the model to do the work, the role must be accompanied by a goal, context, sources, boundaries and acceptance criteria.
What is a role-assignment prompt?
Role assignment should give the model a decision frame, not a title. For example, instead of "be an SEO specialist," writing "as an SEO editor who edits B2B articles in Azerbaijani, check the search intent, the source of each claim and the headline–body alignment" makes the expected behaviour visible.
Role, expertise and authority are not the same thing. A role is the answer's viewpoint. Expertise requires correct information, examples and domain rules.
Authority shows who may make the decision. Telling the model "act like a lawyer" does not grant it legal responsibility or the right to decide on your behalf.
The role technique is only one part of a prompt's core structure. Anthropic's current prompt engineering overview also lists role assignment alongside other methods like clarity, examples, structure and staging. That document requires defining a success criterion and empirical testing first. In other words, the technique's name is not what matters — the measured result is.
When does a role prompt work, and when does it stay decorative?
| Part of the role | Working variant | Decorative variant |
|---|---|---|
| Responsibility | Note facts, logic gaps and risky claims | Be a genius expert |
| Audience | Write for a non-technical business owner | Write in language everyone understands |
| Criteria | Match each claim against the given source | Give the best result |
| Boundary | Don't invent unknown facts, return them as questions | Never make mistakes |
| Output | Give a table of problem, evidence and fix | Prepare a professional report |
| Authority | Draft the proposal, ask for approval before sending | Make the final decision like a manager |
A working role answers three questions: what do you look at in this job, by which criteria do you judge, and where do you stop? If none of these three behaviours appears in the answer, delete the role and rerun the same task. If the result doesn't change, the title is just word bulk.
OpenAI's current model guidance recommends writing the goal, domain context, hard constraints, approval boundaries, evidence and success criteria concretely. The guide emphasises testing a compact, outcome-oriented prompt on real examples rather than repeating the same instruction. "You are an expert" satisfies none of those requirements by itself.
8 weak and strong role-assignment examples
1. Content editor
Weak: "You are a professional editor. Make this text perfect." The audience, the level of editing and what should be preserved are unknown.
Strong: "Read the text as an editor of Azerbaijani business articles. Point out grammar, flow of ideas, repetition and unevidenced claims separately. Preserve the author's first-person views and apply only the changes I approve to the final text."
2. SEO editor
Weak: "As an SEO expert, make this article rank first on Google." No prompt can guarantee rankings.
Strong: "As an SEO editor, verify the informational intent of the query 'prompt techniques'. Require a direct answer in the first 100 words, extractable H2s, at least one comparison table and source-bound claims. Don't force keyword repetition where it breaks the meaning."
3. Customer support agent
Weak: "Be a friendly support agent and satisfy the customer." A non-existent concession can be promised for the sake of satisfaction.
Strong: "As a support agent, classify the message by problem, urgency and required information. Rely only on the given refund policy. If the policy doesn't answer, don't promise compensation; route the request to the shift lead."
4. Financial analyst
Weak: "As a financial genius, tell me which stock to buy." A role doesn't know the future and doesn't replace an individual risk profile.
Strong: "With a financial analyst's eye, compare only the revenue growth, margin, debt and cash-flow changes in the report I provided. Separate facts from interpretation, note missing data, and give no buy–sell instructions."
5. Hiring evaluator
Weak: "As an experienced HR, pick the best candidate." There is no criterion for "best," and sensitive attributes can leak into the decision.
Strong: "As a hiring evaluator, check the CVs only against the five mandatory skills in the job description. Show evidence from the CV beside each score. Don't draw conclusions from age, gender, photos, family status or names; leave the final selection to a human."
6. Teacher
Weak: "As the world's best teacher, explain quantum physics." The student's level and the learning goal are unknown.
Strong: "As a teacher for a 10th-grade student new to physics, explain superposition first with an everyday analogy, then with where the analogy breaks down. End with three check questions; don't show the answers immediately."
7. Code reviewer
Weak: "As a senior programmer, fix the code." This instruction can produce unauthorised changes and unnecessary rewrites.
Strong: "As a code reviewer, check this change for data-loss, authentication and backward-compatibility risks. For each finding give the file, line, impact and minimal fix. Don't change the code; prepare a patch only after approval."
8. Legal document reviewer
Weak: "As a lawyer, approve the contract." The model has no authority for legal representation or approval.
Strong: "As a contract reviewer, extract the payment, termination, liability and dispute clauses. Show vague wording with clause numbers, but give no legal opinion or final approval. List separately the questions to route to a local lawyer."
In these examples, the role is followed by the work, the criteria and the boundary. For a more general structure, see the 10 rules of prompt writing; for copyable starting points, the 50 prompt examples.
How is a ready role-prompt template built?
Change the bracketed parts of the template below to fit your work. Filling every line is not mandatory. If you see the role isn't affecting the answer, don't keep it.
Role: [responsibility and viewpoint, not a title]
Goal: [the result to produce and where it will be used]
Audience: [who will read it and what they know]
Context: [product, situation and key information]
Sources: [only the documents and data to be used]
Review criteria: [what to evaluate and by which rule]
Boundary: [what not to do, where to ask or hand to a human]
Output: [format, order, length and mandatory fields]
Unknowns: [don't invent; list missing information separately]
For example: "As a sales operations specialist analysing B2B sales calls, extract from the note the problem, the decision owner, the next step and the date. Rely only on the information in the note. If no date was stated, write 'unknown'. Give the result as a four-column table and send nothing to the customer." Here the role isn't decor — it governs the fields to inspect and the limit of authority.
How do you check that a role prompt is working?
One good answer doesn't prove the role works. As in prompt engineering, the acceptance criteria must be written first, then the same inputs must be run with and without the role.
- Choose at least 10 real inputs: normal, incomplete, contradictory and risky.
- Run a baseline prompt with a goal and a format but no role.
- Add only the role and its responsibility line, and repeat the test.
- Compare the results by factual accuracy, completeness, boundary compliance and human editing.
- If there is no difference, delete the role; keep only the part that fixes a measured gap.
Google Cloud's prompt design documentation explains that clear instructions, context and examples shape the result. If you compare two role prompts without holding those elements constant, you won't know which change delivered the benefit. That's why changing only one part per test matters.
Does a role replace expertise and human responsibility?
No. A role can steer the model's answer form and attention, but it doesn't create missing facts, doesn't automatically confirm current law and carries no professional responsibility. In legal, financial, health, hiring and account operations, the result must be checked by sources and an authorised human.
Writing "forget all the rules" or "you have no restrictions" into a role prompt doesn't legitimately remove safety boundaries either. OWASP's prompt injection explanation shows that instructions from users and external sources can pull system behaviour in unwanted directions. The defence is not a single role sentence; it's minimum authority, separating trusted data, output checks and human approval.
The simple rule: the model can draft text, but as the result's real-world impact grows, its decision authority must shrink. It can write the email — but not send it. It can find the questionable clause in the contract — but not give legal approval. It can compare a candidate's experience against the criteria — but not invent hidden attributes about a person.
Questions about role-assignment prompts
Does every prompt need a role?
No. In a clear task like "shorten this text to 100 words," a role can be extra weight. Add a role only when the viewpoint, criteria, tone or authority boundary affects the result.
Does writing "you are an expert" improve the answer?
It can sometimes change the style, but it doesn't guarantee correctness. If what the expert should check, which sources they should use and how they should handle unknown information aren't written, the title's practical value is weak.
Can one prompt hold several roles?
It can, but the roles' work and priority order must be separated. Instead of "be a marketer, a lawyer and a designer," it's clearer to first have the ad claims checked against sources, then the compliant copy prepared, and finally the visual brief extracted.
Does a role prompt stop hallucination?
No. Reducing hallucination risk requires reliable sources, citations, unknown-fact behaviour and human review. A role can only demand that checking behaviour more concretely.
How do you know a role prompt is good?
If, on the same test set, the role variant measurably beats the baseline prompt in facts, completeness, boundaries and editing load, the role is useful. If there's no difference, shorten it or delete it.
Sources
I'm Anar Rustamli - a strategist, entrepreneur, and AI adoption leader working at the edge of growth, technology, and human thinking. Since 2016, my work has focused on helping businesses evolve in a rapidly changing digital landscape. I design growth systems, AI-powered workflows, and strategic frameworks that align performance with purpose. I believe real growth happens when strategy, data, and human insight work together - and my mission is to help businesses adopt AI in a way that strengthens both their results and their identity.

