Role and Persona Prompting

Persona

Part of: Prompt Engineering

Paste a chunk of code under "Review this" and you get a polite, generic once-over. Paste the same code under "You are a senior security engineer doing a hostile review before a production deploy" and suddenly the model is hunting for injection, missing auth checks, and unsafe deserialization. Same model, same code. The only thing that changed was the role you cast it in, and the quality jumped because the role pulled in a whole pocket of training text written by people who think that way. What it is Persona prompting (also called role prompting) means assigning the model an explicit expert identity, "You are a senior security engineer," "Act as a patient kindergarten teacher", to steer the voice, depth, and priorities of its answer. It is not magic and it does not give the model new knowledge. It biases the prediction toward the slice of its training that a person in that role would have written. The role sets three things at once: vocabulary (a security engineer says "threat model," not "bad stuff"), priorities (what it looks for first), and tone (terse and skeptical vs warm and encouraging). How it works Remember the engine: the model predicts the next token conditioned on everyt

Challenge: Persona Router