Definition

Prompt engineering is the practice of designing the text you send to an AI model so the output is accurate, structured and usable. It matters because language models respond to phrasing, ordering and context. The same request can produce mediocre or excellent output depending on how it is written.

The pattern that works

Almost every good prompt has four elements:

  1. Frame the role. "You are a technical editor." "You are an analyst preparing a briefing."
  2. State the task. One sentence, plain language.
  3. Give the context. Paste the source material. Do not describe what is in the document — include it.
  4. Set the output shape. Length, format, tone, what to avoid.

Adding a short example of the output style is often the single biggest quality lift.

Techniques worth knowing

  • Chain-of-thought — asking the model to work through a problem step by step. Useful for reasoning tasks.
  • Few-shot prompts — including two or three input-output examples before your real request.
  • Constraint prompts — "Return only JSON with these keys. If a field is missing, use null."
  • Persona and audience — "Explain to a non-technical executive."
  • Guardrails — "Do not speculate. If the source does not contain the answer, say so."

Common failure modes

  • Vague requests produce vague answers.
  • Missing context forces the model to guess.
  • Overloaded prompts — three tasks in one — reduce quality on all three.
  • Trusting output without checking. Prompts are for the input; verification is on you.

An example

Weak:

Summarise this report.

Better:

You are preparing a briefing for a busy director. Summarise the report below into: (1) three headline findings, (2) the biggest risk, (3) two decisions the director needs to make. Under 180 words. Do not add anything that is not in the source.

[paste report]

Where to go deeper