Free auditStart free
GlossaryGlossary · AI search

Prompt engineering

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 withChatGPTClaudePerplexityGoogleAI Mode

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
01How 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 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 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.

02At 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.
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

What the docs say
A one-sentence role focuses behavior and tone.
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
04Your 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.
05How it works

Check it in 2 minutes

Related: how the standing instruction is set in a system prompt, and what fits in a 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. 01Prompt engineering overview (Claude docs)platform.claude.com · checked 2026-11-01
  2. 02Prompting best practices (Claude docs)platform.claude.com · checked 2026-11-01
  3. 03Prompt engineering (OpenAI developer docs)developers.openai.com · checked 2026-11-01
Questions

Asked a lot.

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

01Can 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.

Free · 2 minutes

Know the term. Now check your site.

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

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • +212% organic clicks in 90 days Ledgerly