Core prompting patterns
Clear, specific instructions with context, examples and an explicit output format beat clever tricks.
Stable: this rarely changes. Reviewed 17 Oct 2026.
Key ideas
- Give the model a role, the goal, who the output is for and what good looks like.
- Separate instructions from data with XML tags or delimiters, especially for untrusted input.
- Few-shot: 2 to 5 diverse examples, including edge cases. Examples steer format strongly.
- Ask for reasoning before the answer on complex tasks, or use a reasoning model.
- Say what to do rather than only what not to do, and explain why a rule exists.
- Version prompts in code, review them like code, and run evals on every change.
Common mistakes
- Long lists of ALL-CAPS rules. Modern models over-apply them.
- Changing prompts in production without a regression eval.