Skip to content

Prompt Engineering Fundamentals

The building blocks of a good prompt — context, task, constraints and format — with before-and-after examples.

Editorial team 2 min read

A prompt is a brief for a capable colleague who knows nothing about your situation. Most poor results come from underspecified prompts, not weak models.

The Building Blocks

  1. Context: who you are, what you're working on and why.
  2. Task: exactly what to produce.
  3. Audience: who will read the result.
  4. Constraints: length, tone, things to include or avoid.
  5. Format: bullets, a table, JSON, a specific template.

Before and After

Summarise this report.

versus

I'm briefing our finance director before a 10-minute meeting. Summarise the attached quarterly report in five bullet points, focusing on anything that affects next quarter's budget, and flag figures that look inconsistent. Plain language, no jargon.

Habits That Help

  • Put long documents first and the question after, clearly separated (for example inside <document> tags).
  • Say what to do, not only what to avoid.
  • Explain why a constraint exists, so the model can make sensible judgement calls.
  • Allow uncertainty: "If the document doesn't say, answer not stated."
  • Iterate: treat the first answer as a draft and give specific feedback.

Common Mistakes

Vague goals, missing context the model can't know, several unrelated tasks in one prompt, and no description of what a good answer looks like.

Test Prompts Like Code

Try a prompt on a handful of realistic inputs, including awkward ones, before relying on it — and keep the versions that work.

More in Generative AI

All Generative AI guides →
Generative AI Guide · 2 min

Few-Shot Prompting With Examples

Showing a model a few examples of the input and output you want is often clearer than describing it. How to choose good examples.

Generative AI 2 min read 23 Jul 2026

Generative AI Guide · 2 min

Getting Structured Output From LLMs

How to get JSON and other machine-readable output reliably from a language model, and how to validate it.

Generative AI 2 min read 22 Jul 2026

Generative AI Guide · 2 min

Why Language Models Hallucinate

What hallucination is, why it happens, and practical ways to reduce and catch it.

Generative AI 2 min read 21 Jul 2026

Generative AI Guide · 2 min

Retrieval-Augmented Generation (RAG) Explained

How RAG grounds a language model's answers in your own documents, the components involved, and where it goes wrong.

Generative AI 2 min read 20 Jul 2026