Development · Term

Prompt engineering

Prompt engineering is the practice of writing model instructions that produce reliable, reviewable results — specifying the outcome, the context, the constraints, and the exact output format.

The label overstates the craft. Most of what works is ordinary specification discipline: state the outcome before the background, supply the real source material, name the constraints, and define the structure you want back. Vague briefs produce vague output faster than before, not better output.

In production the durable version of this is not clever wording but stable structure — a fixed instruction, a schema for the response, and a fixed evaluation set that tells you when a model update has changed behaviour underneath you.

How it works

A good prompt answers the questions a capable new colleague would ask: what outcome is wanted, who it is for, what material to work from, what must not happen, and what shape the answer should take. Examples of good output are often the single most effective addition. For repeated tasks, the prompt becomes a template with fixed instructions and slots for the variable input.

In a product, prompts are code: they are versioned, reviewed and tested against a fixed set of inputs whenever the prompt or the model changes.

Example

"Write a product description" produces generic copy. "Write a 60-word description for this product sheet, for trade buyers comparing suppliers, in plain British English, leading with the load rating, no superlatives, returned as JSON with title and body fields" produces something usable and checkable.

Common mistakes

  • Putting background first and the actual request last, so the model latches on to the wrong thing.
  • Asking for "better" or "more engaging" without saying what good looks like.
  • Changing prompts in production without re-running the evaluation set.
Related terms

Have something worth building right?