# What is prompt engineering?

> Prompt engineering is writing and testing the instructions a model receives. What OpenAI, Anthropic and Google advise, and how it differs from context engineering.

Source: https://www.honeyhive.ai/learn/what-is-prompt-engineering (updated 2026-10-31)

Prompt engineering is the practice of writing, structuring and refining the instructions a language model receives so that it returns the output you want. OpenAI calls it ["the process of writing effective instructions for a model"](https://developers.openai.com/api/docs/guides/prompt-engineering), aimed at consistent output that meets your requirements. Anthropic describes it as ["methods for writing and organizing LLM instructions for optimal outcomes"](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents). The model stays the same; only its input changes.

## What the providers say it involves

The three major providers describe the same core moves under different names.

| Move | Anthropic | OpenAI | Google (Gemini) |
|---|---|---|---|
| Be specific | ["Be clear and direct"](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices) | ["writing effective instructions"](https://developers.openai.com/api/docs/guides/prompt-engineering) | ["clear and specific instructions"](https://ai.google.dev/gemini-api/docs/prompting-strategies) |
| Set the format | Be specific about [output format and constraints](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices) | [Markdown and XML structuring](https://developers.openai.com/api/docs/guides/prompt-engineering) | [Response format and constraints](https://ai.google.dev/gemini-api/docs/prompting-strategies) |
| Show examples | [Use examples effectively](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices) | [Few-shot examples](https://developers.openai.com/api/docs/guides/prompt-engineering) | ["always include few-shot examples"](https://ai.google.dev/gemini-api/docs/prompting-strategies) |
| Add context | [Add context to improve performance](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices) | [Retrieved context in the prompt](https://developers.openai.com/api/docs/guides/prompt-engineering) | [Background material in the prompt](https://ai.google.dev/gemini-api/docs/prompting-strategies) |
| Structure the prompt | [A role in the system prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices); XML tags split instructions, context and input | [Developer messages](https://developers.openai.com/api/docs/guides/prompt-engineering) rank ahead of user messages | [Prefixes](https://ai.google.dev/gemini-api/docs/prompting-strategies) start the output for the model |

Three notes from the docs:

- Anthropic gives a simple test: ["Show your prompt to a colleague with minimal context on the task and ask them to follow it. If they'd be confused, Claude will be too."](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices)
- For long inputs, Anthropic advises [placing long documents near the top of the prompt, above the query](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices).
- Google says prompt design [can sometimes require "a few iterations"](https://ai.google.dev/gemini-api/docs/prompting-strategies). If a result misses, it suggests rephrasing or reordering the prompt. To search for a better prompt against a metric instead of by hand, see [prompt optimization](/learn/prompt-optimization).

Examples get their own page: see [few-shot prompting](/learn/few-shot-prompting).

## Where prompt engineering stops

Writing a prompt is not the first step. Anthropic's guide assumes you already have [clear success criteria, a way to test against them, and a first draft](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/overview). It also says that [not every failing eval is best solved by prompt engineering](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/overview). Choosing a different model can sometimes improve latency and cost more easily.

Prompt engineering also differs from context engineering. Anthropic describes the latter as [the "natural progression" of the former](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents). Prompt engineering centers on how to write effective prompts, particularly system prompts. Context engineering manages the whole set of tokens the model sees, including tools, external data and message history ([guide](/learn/context-engineering)). Anthropic says that curation is iterative and happens each time you decide what to send to the model. For agents that loop over tools, see [agentic workflows](/learn/agentic-workflow).

## How to work on a prompt

1. Define what a good output looks like, in a form you can check.
2. Write a first draft with clear instructions, the output format and the context the model lacks.
3. Run it on a fixed set of test inputs and grade the outputs. See [LLM evaluation](/learn/llm-evaluation).
4. Change one thing at a time (wording, order, examples) and compare scores.
5. Keep what wins and ship it. OpenAI advises [pinning production applications to specific model snapshots](https://developers.openai.com/api/docs/guides/prompt-engineering) and [building tests and evaluation suites](https://developers.openai.com/api/docs/guides/prompt-engineering) so you can monitor performance as you iterate.

Anthropic also notes that chaining prompts into steps is [useful when you need to inspect intermediate outputs](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices).

## Iterating on prompts in HoneyHive

HoneyHive's Playground [lets you create and iterate on prompts without writing code](https://docs.honeyhive.ai/v2/prompts/overview.md): test them against sample inputs, compare models and save working versions. In Studio, under Prompts, you can deploy a prompt to an environment such as dev, staging or prod, and fetch it in your application via the SDK or a YAML export. To check a change against a dataset before it ships, run an [experiment](https://docs.honeyhive.ai/v2/introduction.md).

Related: [chain-of-thought prompting](/learn/chain-of-thought-prompting), [LLM temperature](/learn/llm-temperature).

## FAQ

### Is prompt engineering the same as context engineering?

Not quite. Anthropic calls [context engineering "the natural progression of prompt engineering"](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents). Prompt engineering is about writing instructions. Context engineering covers everything the model sees, including tools, external data and message history.

### Does prompt engineering change the model?

No. It changes only the input. Fine-tuning changes the model. Anthropic notes that [not every failing eval is best solved by prompt engineering](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/overview), and that a different model can sometimes improve latency and cost more easily.

### What do I need before I start prompt engineering?

Anthropic's guide assumes [clear success criteria, a way to test against them, and a first draft prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/overview).
