← All guides

Role prompting: when “act as a…” actually helps

"You are a world-class senior software engineer" is the most cargo-culted line in prompting. It appears at the top of thousands of prompts, and most of the time it does nothing. Understanding why it usually does nothing is what tells you the rare times it does something real.

A role is a compression device. "You are a tax accountant" is shorthand for a large bundle of assumptions — the vocabulary, the priorities, the things such a person would check before answering. When that bundle is genuinely load-bearing and hard to spell out, the role earns its place. When the bundle is empty flattery, it is decoration, and decoration does not change output.

The flattery that does nothing

"You are a brilliant, world-class expert" adds no information. The model has no dial for brilliance it was otherwise leaving off. Telling it to be excellent does not unlock a reserve of excellence it was withholding — it just spends a line of your prompt on a compliment.

Worse, vague superlative roles can pull the output toward the register of the training text that used those words: confident, sweeping, thin on specifics. A prompt that opens with "as a legendary growth hacker" is quietly asking for the tone of a LinkedIn post, whether or not you wanted it.

The role that carries constraints

Now compare a role that actually smuggles in information the model would otherwise miss:

A role that encodes real priorities
Write a review comment explaining why the change below is risky.

### Role
You are a staff engineer who has been on-call for this payments service for three years, and you have watched this exact class of bug cause an outage.

### Audience
The pull request author — a capable mid-level engineer who is in a hurry and does not want a lecture.

### Context
The change replaces `if (amount > 0)` with `if (amount)` before a charge call.

### Requirements
- Length: Under 100 words.
- Output format: Two short paragraphs, no headings.
- Name the specific input that now slips through.
- Avoid: praise, hedging, and restating what the code plainly does.

### Example of the wanted output
This drops the guard against a zero-amount charge. A cart that rounds to 0.00...

Instant checks

9 key structural practices evaluated locally

100% Coverage9/9
  • States a concrete task

    Passed
  • Avoids vague language

    Passed
  • Specifies an output format

    Passed
  • Gives context or audience

    Passed
  • Avoids dangling references

    Passed
  • Includes an example

    Passed
  • Separates data from instructions

    Passed
  • Avoids over-aggressive phrasing

    Passed
  • Defines what a good answer looks like

    Passed
The role sits alongside audience and constraints — and it still passes every check.

"A staff engineer who has been on-call for this service for three years and has watched this class of bug cause an outage" is not flattery. It encodes a stance: paranoid about production, focused on the input that breaks things, uninterested in style. That stance changes which of many true things the model chooses to say. It is doing the same job a good audience line does — narrowing the space of acceptable answers — just from the writer's side of the desk rather than the reader's.

The test is simple. Does the role change what a correct answer contains? "You are an expert" does not. "You are a copy editor who removes every word that does not change the meaning" does — you can predict how the output shifts. If you cannot predict the shift, the role is not carrying anything.

Roles are a worse way to say things you could say directly

Here is the uncomfortable part: almost anything a good role encodes, you could state outright. Instead of "act as a skeptical security reviewer," you could write "flag every input that is not validated, and assume the caller is hostile." The direct version is usually clearer and always more checkable.

So treat the role as a convenience, not a mechanism. Reach for it when the bundle of behaviour is large and familiar enough that a name is genuinely more compact than a list — "reply as a Linux man page" carries a whole format and tone in four words. Skip it when a single explicit constraint would do the same job without the ambiguity of hoping the model shares your idea of what that role does.

A short checklist

The example above passed every check live. Try your own role prompt in the checker — and if the role is the only thing carrying your intent, that is a sign to state the constraint directly instead.