Prompt engineering

Prompt engineering is the practice of designing and testing the instructions, context and examples given to a generative AI model so that it reliably produces the output you need.

A generative model's output depends heavily on what goes in. Prompt engineering is the work of shaping that input: stating the task clearly, giving the background the model needs, showing examples of good answers, specifying the format, and then testing and revising. OpenAI's developer guide describes it as writing instructions that get a model to consistently meet your requirements, and stresses iteration, because the same prompt can produce different outputs from run to run.

Much of it is ordinary clear writing. Anthropic's documentation gives a small example: instead of simply telling a model never to use ellipses, explain that the reply will be read aloud by a text-to-speech engine that cannot pronounce them. With the reason, the model can apply the rule sensibly to cases the instruction did not mention. Other staple techniques include giving a few worked examples, asking for step-by-step reasoning, assigning a role, and separating instructions from material with clear markers such as XML tags.

The term took off with ChatGPT. After its release in November 2022, prompting came to be seen as a business skill and companies advertised for "prompt engineers". The craze faded quickly. By 2025 the Wall Street Journal reported that the job, one of the hottest of 2023, had become largely obsolete, as models became better at working out what users meant and companies trained ordinary staff to prompt well. A 2024 survey still counted more than 50 distinct text prompting techniques.

For anything running in production, prompt engineering looks more like software engineering. OpenAI recommends pinning applications to a specific model snapshot and building evaluation suites, so you can tell whether a change to the prompt, or an upgrade to the model, made results better or worse. Tools such as DSPy go further and let one model search for better prompts automatically, scored against test data.

The practical picture is less mystical than the hype once suggested. There are no magic words. A good prompt is a clear brief, and the gains come from testing it against real cases. The discipline is now often discussed alongside context engineering, which covers everything else the model sees, such as retrieved documents, tool descriptions and conversation history.

Common questions

What is prompt engineering?

It is the practice of writing and refining the input to a generative AI model, including instructions, context, examples and format requirements, so the model reliably produces useful output. It combines clear writing with systematic testing.

Is prompt engineering still a job?

Rarely as a standalone title. Companies hired dedicated prompt engineers after ChatGPT launched, but by 2025 the Wall Street Journal reported the role had become largely obsolete. The skill lives on inside other jobs, such as software engineering, product work and content operations.

What are the most useful prompt engineering techniques?

Being specific about the task and audience, explaining why a constraint matters, giving a few varied examples of good output, specifying the output format, and asking the model to reason before answering on hard problems. Testing a prompt against real inputs matters more than any single trick.

What is the difference between prompt engineering and context engineering?

Prompt engineering focuses on the instructions and examples you write. Context engineering covers everything else placed in the model's input, such as retrieved documents, tool definitions, memory and conversation summaries. In real applications the two are closely linked.

Finding more

Search for "prompt engineering guide", "prompting best practices" plus the name of the model you use, or "automatic prompt optimisation". The most dependable sources are the official prompting guides published by model makers, which are updated as models change, and peer-reviewed or arXiv papers that measure techniques on benchmarks. Treat lists of secret prompts or guaranteed formulas with scepticism, since what works varies by model and version.

  • Prompt engineeringOfficialOpenAI's developer guide, with its definition and advice on message roles, examples, model snapshots and evaluations.
  • Prompting best practicesOfficialAnthropic's guide to prompting techniques, including context, examples, XML tags and roles.
  • Prompt engineeringReferenceHistory of the practice, the rise and decline of the prompt engineer job and a catalogue of techniques.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.