# Prompt engineering

> Prompt engineering is writing and testing a model

Canonical: https://scaplet.com/glossary/prompt-engineering

Glossary Glossary · AI search

Prompt engineering is writing and testing a model's instructions. The loop, the techniques Anthropic and OpenAI document, and when another fix is better.

3 min

read

3

sources

Oct 29, 2026

updated

Scaplet Editorial Team

author

In one line

Prompt engineering is the practice of writing, testing and revising the instructions you give a language model so its output meets your requirements. OpenAI stresses iteration because outputs are non-deterministic. Anthropic adds a limit: not every failing test is a prompt problem, and a different model can fix latency or cost more easily.

30-second check

## Is this costing your site traffic?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fprompt-engineering%20(%22Prompt%20engineering%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fprompt-engineering%20(%22Prompt%20engineering%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fprompt-engineering%20(%22Prompt%20engineering%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fprompt-engineering%20(%22Prompt%20engineering%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

## At a glance

4 facts from the sources below

Success criteria and a way to test them

Starts with

Clear instructions, examples, XML or Markdown structure, roles

Core techniques

Some latency and cost problems

Not the lever for

You change the prompt or the model

Re-test when

_01_How it works

## The loop before the techniques

Anthropic's overview assumes you already have three things: a clear definition of success for your use case, some way to test against it, and a first draft prompt. Without those, edits are guesses. [OpenAI](/ai-search/chatgpt/how-it-finds-sources) points the same way, recommending evaluation suites to measure prompt performance, especially when prompts change or models are upgraded.

1. 01

### Define success

Write down what a good output is for your case, in terms you can check: format, content, length, refusals.
2. 02

### Build a test

A small set of real inputs with expected properties. Anthropic links its own guide on defining success criteria and building evaluations.
3. 03

### Draft, run, compare

Change one [thing](/glossary/entity) at a time and rerun the same inputs.
4. 04

### Pin and re-test

OpenAI advises pinning applications to specific model snapshots. Re-run the tests whenever the snapshot changes.

_02_At a glance

## Techniques both vendors document

Technique

### Clear, direct instructions

What the docs say

Anthropic's test: show the prompt to a colleague with minimal context. If they would be confused, the model will be too.

Documented by

Anthropic

Technique

### Add context

What the docs say

Supply the data the task needs. OpenAI calls adding retrieved or proprietary documents [retrieval-augmented generation](/glossary/retrieval-augmented-generation).

Documented by

Both

Technique

### Examples (few-shot)

What the docs say

A few input and output pairs can steer a model to a new task. OpenAI says to choose examples covering a diverse range of inputs.

Documented by

Both

Technique

### Structure with tags or Markdown

What the docs say

Anthropic: XML tags separate instructions, context and input. OpenAI: Markdown for sections, XML to delimit reference content.

Documented by

Both

Technique

### Role in the [system prompt](/glossary/system-prompt)

What the docs say

A one-sentence role focuses behavior and [tone](/glossary/tone-of-voice).

Documented by

Anthropic

Technique

### Chain complex prompts

What the docs say

Anthropic lists prompt chaining as a technique for multi-step work.

Documented by

Anthropic

_03_At a glance

## Anatomy of a rewrite

Change

### Names the artifact and the ambition

Why the docs support it

Anthropic says that if you want more than the task strictly requires, ask for it explicitly rather than relying on the model to infer it.

Change

### Still short

Why the docs support it

Clarity is not length. The rewrite adds intent, not filler.

Change

### Testable

Why the docs support it

You can check whether the output has more features. A vague prompt gives no such check.

Anthropic's own less effective and more effective prompts

```
Less effective: Create an analytics dashboard More effective: Create an analytics dashboard. Include as many relevant features and interactions as possible. Go beyond the basics to create a fully-featured implementation.
```

_04_Your call

## Prompt, retrieve, or change the model

If this fits

### Prompt engineering fits when

- The output has the wrong format, tone or level of detail.
- The model is missing instructions, examples or context you can put in the request.
- You can state success in a way a test can check.

Or

### Look elsewhere first when

- Latency or cost is the problem. Anthropic says a different model can sometimes fix these more easily.
- The task needs your own documents. OpenAI treats adding them as retrieval-augmented generation.
- A one-off task needs a few examples. OpenAI says examples in the developer message can replace fine-tuning for steering.

**A good prompt does not travel between models**Anthropic's guide says a technique that names a specific model was measured on that model, and you should check it against your own evals before applying it to another. Treat every migration as a re-test.

_05_How it works

## Check it in 2 minutes

Related: how the standing instruction is set in a [system prompt](/glossary/system-prompt), and what fits in a [context window](/glossary/context-window).

1. 01

### Run the colleague test

Give the prompt to someone who has not seen the task. Note every question they ask and answer it in the prompt.
2. 02

### Write one pass or fail check

Pick one property of a good output and test five real inputs against it.
3. 03

### Record the model version

Pin a snapshot where the vendor offers one so a later change is yours, not theirs.

Sources · 3

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- claude.com
- openai.com

1. 01 [Prompt engineering overview (Claude docs)](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/overview) platform.claude.com · checked 2026-11-01
2. 02 [Prompting best practices (Claude docs)](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices) platform.claude.com · checked 2026-11-01
3. 03 [Prompt engineering (OpenAI developer docs)](https://developers.openai.com/api/docs/guides/prompt-engineering) developers.openai.com · checked 2026-11-01

Questions

## Asked a lot.

1 questions people ask next, answered from the sources on this page.

_01_ Can examples in a prompt replace fine-tuning?

For steering a model to a new task, OpenAI's guide says a few input and output examples in the developer message can do the job instead of fine-tuning. It does not claim they match fine-tuning on every task, so test against your own cases.

## Keep learning

[All glossary](/glossary)

[Learn System prompt AI search](/glossary/system-prompt) [Related Fine-tuning AI search](/glossary/fine-tuning) [Read next Structured outputs AI search](/glossary/structured-outputs) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in glossary
[Progressive web app](/glossary/progressive-web-app) [Publisher SEO](/glossary/publisher-seo)

More in AI search
[Context window](/glossary/context-window) [Conversational AI](/glossary/conversational-ai) [Embeddings](/glossary/embeddings) [Extended thinking](/glossary/extended-thinking) [Fine-tuning](/glossary/fine-tuning) [Generative engine optimization](/glossary/generative-engine-optimization) [Grounding](/glossary/grounding) [Knowledge cutoff](/glossary/knowledge-cutoff) [Large Language Model](/glossary/large-language-model) [Model Context Protocol](/glossary/model-context-protocol) [Multimodal AI](/glossary/multimodal-ai) [Prompt caching](/glossary/prompt-caching) [Prompt engineering](/glossary/prompt-engineering) [Prompt tracking](/glossary/prompt-tracking) [Reranking](/glossary/reranking) [Retrieval-Augmented Generation](/glossary/retrieval-augmented-generation) [Semantic Search](/glossary/semantic-search) [Structured outputs](/glossary/structured-outputs) [System prompt](/glossary/system-prompt) [Temperature](/glossary/temperature) [Tokenization](/glossary/tokenization) [Tool use](/glossary/tool-use) [Vector search](/glossary/vector-search) [AI Agents](/glossary/ai-agents)

Terms on this page
[Entity](/glossary/entity) [Retrieval-Augmented Generation](/glossary/retrieval-augmented-generation) [System prompt](/glossary/system-prompt) [Tone of voice](/glossary/tone-of-voice) [Context window](/glossary/context-window)

Free · 2 minutes

## Know the term. _Now check your site._

The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **+212%** organic clicks in 90 days Ledgerly
