---
title: "Prompt engineering"
url: https://www.daytona.com/definitions/p/prompt-engineering
---

# Prompt engineering

Prompt engineering is the practice of writing and refining the instructions and examples given to a language model, so that it produces the desired output.

Prompt engineering is the work of crafting prompts that get good results from a language model. It covers how instructions are worded, what examples are included, and how the output should be formatted. Small changes in wording can change the result noticeably. Prompt engineers test variations to find what works.

Common methods include giving the model a clear role, stating the task and its constraints explicitly, and showing examples of good output. Asking the model to reason step by step can improve answers on hard problems. Structured formats, such as tags around parts of the prompt, help the model tell instructions from data. Changes are best judged with evals, because a prompt that helps one case can hurt another.

As agents took on longer tasks, prompt engineering widened into context engineering and harness engineering. Those cover everything the model sees and the environment it acts in, not only the wording of one prompt. Clear prompts remain the base, since every step of an agent starts with one. In a sandbox, an agent's prompt usually describes the environment, the tools available, and how to check its own work.

## Related terms

- [Prompt](https://www.daytona.com/definitions/p/prompt.md)
- [Context engineering](https://www.daytona.com/definitions/c/context-engineering.md)
- [LLM (Large Language Model)](https://www.daytona.com/definitions/l/llm-large-language-model.md)
- [Evals](https://www.daytona.com/definitions/e/evals.md)
- [Harness engineering](https://www.daytona.com/definitions/h/harness-engineering.md)
