# Prompt engineering

> Prompt engineering is writing and testing the instructions, examples and context given to a language model so it produces the output a task needs, consistently.

- Page: https://methodcrew.com/glossary/prompt-engineering
- Last updated: 2026-10-28
- Publisher: [The Method Crew](https://methodcrew.com/)
- Also known as: prompt design

## How it works

A production prompt reads like a brief for a new hire. It states the role and the task, the inputs the model will get, the rules it must follow, what to do when information is missing, and the exact output format. Good prompts usually include:

- 2 to 5 worked examples of real inputs and correct outputs
- A defined output structure, often a JSON schema the model API can enforce
- Explicit edge cases, such as "if the invoice has no PO number, return null"
- Permission to say it does not know

Writing the prompt is the easy part. The engineering is the testing: a fixed set of 30 to 200 real cases, scored automatically where possible and rerun on every change. Without that set, an edit that fixes one case can break 5 others and nobody notices until a customer does. Anthropic's [prompt engineering guide](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/overview) starts from the same place: define success criteria and a way to test against them before you tune a prompt.

## How businesses use it

On our builds, prompts are treated as code. They live in version control with their test set beside them, and both are handed over with the runbook, because you own them.

For staff, prompting is a skill worth an afternoon of training. Our [AI workshops](https://methodcrew.com/services/ai-workshops) teach teams to give context, show an example, ask for a format and check the result, using their own documents. The [AI acceptable use policy template](https://methodcrew.com/insights/ai-acceptable-use-policy-template) covers what staff may paste into public tools.

## Where it goes wrong

The common failures are untested edits, prompts that grow into 4-page lists of special cases, prompts tuned for one model that degrade after a provider upgrade, and customer data written into prompts that end up in logs.

Prompting also has limits. If the model lacks facts, retrieval fixes that; see [RAG](https://methodcrew.com/glossary/retrieval-augmented-generation). If outputs must be exact, add validation code. And no prompt fully stops [prompt injection](https://methodcrew.com/glossary/prompt-injection). That takes permissions and checks outside the model.

## Example (hypothetical)

Hypothetical: a 30-person recruitment agency uses a prompt to turn interview notes into candidate summaries. Adding 3 example summaries and a fixed section list makes the output consistent, and a 40-case test set catches regressions whenever the model is upgraded.

## Related terms

- [Large language model (LLM)](https://methodcrew.com/glossary/large-language-model): A large language model is a neural network trained on huge volumes of text to predict the next token, which lets it write, summarize, classify and answer questions.
- [Context window](https://methodcrew.com/glossary/context-window): A context window is the maximum amount of text, measured in tokens, that a language model can read and write in one request, counting instructions, documents and its reply.
- [Fine-tuning](https://methodcrew.com/glossary/fine-tuning): Fine-tuning is further training of an existing language model on your own examples, so it learns a specific format or task without long instructions every time.
- [Prompt injection](https://methodcrew.com/glossary/prompt-injection): Prompt injection is an attack where text given to a language model, typed by a user or hidden in a document, overrides the instructions the system was built with.
- [LLM evaluation (evals)](https://methodcrew.com/glossary/llm-evaluation): LLM evaluation scores a language model system's outputs against a fixed set of real test cases, so you can tell whether a change made it better or worse.

## Services where this matters

- [AI workshops and team training](https://methodcrew.com/services/ai-workshops): Sessions where staff practice on their own emails, documents and spreadsheets. $3,000 to $12,000 per session.
- [Custom AI agents and copilots](https://methodcrew.com/services/custom-ai-agents): Agents that look things up in your CRM or helpdesk and take the next step, with approvals. $15,000 to $90,000 per project.
- [AI automation](https://methodcrew.com/services/ai-automation): Workflows where a language model reads and sorts, and your existing systems do the rest. $4,000 to $35,000 per project.

Full glossary: https://methodcrew.com/glossary
