← Glossary / 54 of 100

n. / Prompts and context

Prompt engineering

Definition

Prompt engineering is the practice of writing and testing prompts to get reliable results from a model. It covers instructions, examples, output formats and how context is arranged.

In more detail

Good prompt engineering is closer to testing than writing: you change one thing, run it on a fixed set of inputs, and compare scores. Without traces and an evaluation set, it turns into guessing. As agents grow, the work widens into context engineering, which decides what goes into the prompt at each step.

Example

You rewrite a vague instruction into three numbered rules, run both versions on 100 saved questions, and keep the one with fewer wrong answers.

Definitions are the start.

Open a real trace and watch these terms move.