Prompt engineering
Prompt engineering is the practice of designing and refining the instructions given to a large language model to elicit better, more accurate, or more useful outputs. It focuses on how a task is phrased – the wording of the prompt, the examples provided, the output format requested, and the way constraints are expressed. Because LLMs are sensitive to the structure and content of their input, even small changes in phrasing can produce materially different responses.
Prompt engineering is a subset of context engineering, which takes a broader view of everything in a model’s context window – system prompts, retrieved documents, conversation history, and tool outputs. Where prompt engineering tunes the words of a single instruction, context engineering curates the information the model sees across a session. Harness engineering builds the machine that assembles and manages that context on each turn. And loop engineering sits above all three, deciding when and how often an agent runs at all.
Common prompt engineering techniques include providing few-shot examples – sample inputs and outputs that demonstrate the desired pattern – and chain-of-thought prompting, which asks the model to reason step by step before giving an answer. Prompts can also specify output formats, set persona or role instructions, and define guardrails to steer the model away from unhelpful or unsafe responses. The discipline is largely empirical. Practitioners iterate on prompts, observe the results, and adjust.
The rise of generative AI and vibe coding – where developers describe what they want in natural language and let an AI coding assistant generate the code – has made prompt engineering a practical skill for a much wider audience than AI researchers alone.