What is prompt engineering?

Prompt engineering is the practice of designing the input to a language model so it produces reliable, useful output. In practice it is less about clever phrasing than about supplying the right context, showing examples, specifying the output format, and testing changes against a fixed set of cases.

The techniques that actually earn their keep

Give examples. Two or three worked input-output pairs usually improve quality more than any amount of instruction rewriting. This is few-shot prompting and it is the highest-leverage single change available.

Specify the output shape. Asking for JSON matching a schema turns prose into something a workflow can branch on. Most providers support enforcing this directly.

Ask for reasoning on multi-step problems. Chain-of-thought improves accuracy where several steps must combine. It costs tokens and latency, so it is not free and not always warranted.

Assign a role only when it constrains something. "You are a senior tax accountant" helps when it narrows vocabulary and assumptions. "You are a helpful assistant" does nothing.

Say what to do, not what to avoid. Negative instructions are unreliable. "Reply in two sentences" beats "don't be verbose".

Put the instruction after long context. With a large document in the prompt, models attend better to instructions placed at the end.

What has stopped mattering

Much early prompt folklore was compensating for weaker models. Politeness, threats, offers of payment, elaborate personas — none of these hold up under measurement on current models. Neither does obsessive rewording.

What replaced it is context engineering: deciding what information goes into the window, in what order, and what gets left out. At production scale, retrieval quality and context assembly determine output quality far more than adjectives in the instruction.

System prompts vs user prompts

The system prompt sets durable rules — role, constraints, format, tone. The user prompt carries the specific request. Putting per-request detail in the system prompt, or durable rules in every user message, is a common and avoidable structural mistake.

Testing: the part that separates practice from folklore

Without an eval set, prompt engineering is superstition. The minimum viable process:

  1. Collect ten to twenty real inputs, including the awkward ones
  2. Write down what a good output looks like for each
  3. Change one thing
  4. Re-run everything and compare

This is unglamorous and it is the whole difference between knowing a prompt improved and believing it did. It is also what makes regressions visible — prompts break silently when a model version changes.

Prompt injection

Any prompt that includes untrusted content — a user upload, a retrieved page, a tool result — can be hijacked by instructions inside that content. Separate instructions from data structurally, and never let retrieved text be treated as a command. This is a security property, not a prompting nicety.

Thousands of tested prompts and prompt packs, organised by model and use case.

Browse the prompt library

Frequently asked questions

Is prompt engineering still a useful skill?
Yes, but it has shifted. Models handle vague instructions far better than they did, so the value has moved from wording toward context selection, output schemas, and systematic evaluation.
How long should a prompt be?
As long as it needs to be and no longer. Examples and necessary context are worth their tokens; restating instructions and padding are not. With very long context, place the instruction at the end.
What is the difference between a system prompt and a user prompt?
The system prompt carries durable rules — role, constraints, output format. The user prompt carries the specific request. Durable rules belong in the system prompt so they are not repeated or accidentally varied.
Does telling a model to "think step by step" still work?
On multi-step reasoning, yes — though newer reasoning models do it internally and gain less from being told. It costs tokens and latency, so apply it where accuracy on multi-step problems matters.
Prompt
The instruction text you give an AI model. Prompt quality drives output quality, which is why curated prompt libraries exist.
System prompt
The hidden instruction that sets an AI assistant's behavior, tone, and rules before any user input arrives.
Few-shot learning
Supplying a handful of worked examples in the prompt so the model infers the pattern. Usually the fastest quality improvement available.
Chain-of-thought prompting
Prompting that encourages intermediate reasoning before an answer. In production, request concise rationales or verifiable intermediate results rather than depending on hidden reasoning as proof of correctness.
Context engineering
Designing what information reaches a model, when it is included, how it is structured, and what is omitted. It includes prompts, retrieval, memory, tools, summaries, and state management.
Prompt injection
An attack or failure mode in which untrusted input changes a model's behavior or causes it to follow instructions that conflict with the application's intent.