Role & Persona Prompting

Use a persona to set the depth, perspective, and priorities of an answer, and know when it helps versus when it is just noise.

TL;DR

  1. A persona sets the perspective, depth, and priorities of the answer, not magic correctness.
  2. It helps most for reviews, trade-off discussions, and matching an audience or tone.
  3. Make it concrete: name the priorities you want, not just the job title.

What A Persona Does

    Sets Depth

    It signals how detailed and rigorous the answer should be.

    "Explain to a junior dev"
    vs "Explain to a staff engineer"
    Sets Priorities

    It tells the model which concerns to weigh first.

    "A security reviewer" -> flags auth,
    input handling, secrets first.
    Sets Tone

    It shapes voice and audience for explanations and docs.

    "Write the README as a friendly
    onboarding guide."

Make It Concrete

    Name The Lens

    Attach the specific thing the persona should optimize for.

    "You are a performance engineer.
    Focus on allocations and Big-O."
    Name The Audience

    Say who the output is for so depth and jargon fit.

    "Explain this regex to someone who
    has never used regex."
    Name The Bar

    State the quality standard you expect the persona to hold.

    "Review as if this is going to
    production on Friday."

Good Fits

    Code Review

    Personas focus a review on the risks you care about.

    "Senior reviewer: correctness,
    edge cases, then readability."
    Trade-Off Talks

    A persona frames which criteria win when options compete.

    "As an SRE, which option is easier
    to operate and debug at 3am?"
    Teaching

    Audience personas tune explanations to the right level.

    "Mentor a bootcamp grad through this."

Weak Uses

    Empty Flattery

    Generic expert claims change little without named priorities.

    "You are a 10x genius engineer"
    -> negligible effect
    Knowledge Gaps

    A title cannot supply facts the model does not have.

    Persona != real API knowledge.
    Theater

    Elaborate role-play wastes context better spent on the spec.

    Keep it to one concrete line.

Tips

  1. Pair a persona with what it should optimize for: 'a security reviewer focused on injection and auth'.
  2. Put a durable persona in the system prompt or project rules so you do not repeat it every turn.

Warnings

  1. A persona does not add knowledge the model lacks; it will not make invented APIs real.
  2. Vague personas ('act as an expert') change little; the priorities you name do the real work.

In Practice

FAQ