---
title: "Prompt, Context, Harness: Three Waves of Working With AI"
description: "Invest in prompts, context or a harness? A paste-in five-part context bundle, an invented hotel example, and what OpenAI's Codex experiment shows."
url: "https://staging.khoi.co.uk/en/blog/prompt-ngu-canh-harness"
lang: en-GB
author: "Lê Quốc Khôi"
date: 2026-11-03
updated: 2026-11-03
topics: ["AI for leaders"]
tags: ["Generative AI", "Context for AI", "Delegating to AI", "AI agents", "Prompt engineering"]
---

# Prompt, context, harness: three waves of working with AI

## Key takeaways

- "Three waves" of prompt, context and harness is this library's ordering; I found none of the three sources using the phrase. Only Anthropic states a relationship: it sees context engineering as the natural progression of prompt engineering (Anthropic, 2025).
- The five-part bundle is assembled from (Boonstra, n.d.) and (Anthropic, 2025); neither prescribes this exact set. Anthropic warns of "context rot".
- OpenAI reports, in its own account, three engineers, about five months, roughly 1,500 pull requests and no hand-written code; early progress was slow because the environment was underspecified (Lopopolo, 2026).

On 11 February 2026 OpenAI published an account of a small team that built an internal beta of a software product in about five months, with nobody writing a line of code by hand. The headline figure is roughly 1,500 pull requests (proposed code changes, reviewed before they are merged). The more telling line: progress at the start was slower than expected, not because the model was weak but because the environment was underspecified (Lopopolo, 2026). If you use AI to draft customer replies every week and the results are uneven, do you rewrite the prompt, feed it more documents, or do something else?

## What are prompt, context and harness, and who says they follow one another?

A prompt is how you word the request, context is the information the model sees while it works, and a harness is the environment around the model: tools, rules and feedback loops. Putting them in sequence is the ordering of this library's [three-waves framework](https://staging.khoi.co.uk/en/framework/prompt-context-harness-engineering). Of the three sources, only Anthropic speaks directly about how the first two relate.

- Google's whitepaper (Boonstra, February 2025) defines [prompt engineering](https://staging.khoi.co.uk/en/glossary#prompt-engineering) as designing high-quality prompts that guide a model to accurate output (Boonstra, n.d., p. 7). Its "contextual prompting" is one kind of prompt (Boonstra, n.d., p. 18).
- Anthropic (September 2025) describes prompt engineering as methods for writing and organising instructions, and context engineering as curating the best set of information while the model runs, including information outside the prompt. "At Anthropic, we view context engineering as the natural progression of prompt engineering," it says, because agents run over many turns (Anthropic, 2025).
- OpenAI (February 2026) has "harness engineering" in its title only. The body never defines a harness; it describes designing environments, specifying intent and building feedback loops so that agents do reliable work (Lopopolo, 2026). It also treats context management as one of the biggest challenges, so I read context as sitting inside the harness rather than beside it.

"Agent = model + harness" is a common shorthand, not a quotation from any of these sources.

> **Figure:** [Three waves: prompt, context, harness](https://staging.khoi.co.uk/en/framework/prompt-context-harness-engineering) The ordering is the library's. The documents appeared in February 2025, September 2025 and February 2026; that is publication order, not a history any source asserts.

## Where should you put effort first?

At the lowest layer that does the job. Anthropic advises finding the simplest solution, adding complexity only when needed, and says that for many applications a single model call with retrieval and in-context examples is usually enough (Anthropic, 2024).

My own pairing: a one-off task needs a clear prompt that states the output you want (Boonstra, n.d., p. 56); a weekly task needs a ready-made context bundle; work in which AI takes many steps, calls tools and runs for a long time needs a harness, as with Codex runs of more than six hours, often while people sleep (Lopopolo, 2026). [Which jobs to hand to AI](https://staging.khoi.co.uk/en/blog/viec-nao-giao-cho-ai) covers choosing the task.

## What goes into the five-part context bundle, and where do you paste it?

Role, context, examples, output spec and constraints, written once and pasted in every time you assign the same kind of task. The five parts map onto techniques in Google's whitepaper; grouping them as five is the work of the library's [context bundle framework](https://staging.khoi.co.uk/en/framework/context-bundle), not Google's or Anthropic's.

```
ROLE
You are a [position] at [organisation]. You write drafts for
[approver] to read and edit before anything is sent.

CONTEXT
[Only what this task needs: type of customer, relevant policies,
this week's situation.]

EXAMPLES
[Two or three replies you sent and were happy with, each for a
different situation.]

OUTPUT SPEC
[Language, length, structure, how to open and close.]

CONSTRAINTS
[What it must not do on its own. What to do when information
is missing.]

THIS WEEK'S TASK
[Paste the material to handle here.]
```

The last line is the week's input, not a sixth part. Where each part comes from:

1. Role: gives the model a blueprint of tone, style and expertise (Boonstra, n.d., p. 22).
2. Context: details specific to the task in hand (Boonstra, n.d., p. 18); for Anthropic, the smallest set that still suffices (Anthropic, 2025).
3. Examples: the whitepaper calls them the most important best practice (Boonstra, n.d., p. 54). The abstract of Brown and colleagues (2020) says GPT-3 was applied with demonstrations given purely as text and no gradient updates (Brown et al., 2020, p. 1), on NLP benchmarks, not customer replies.
4. Output spec: state format, length and style concretely (Boonstra, n.d., p. 56).
5. Constraints: prefer instructions that say what to do; keep constraints for harmful content or a strict format (Boonstra, n.d., p. 57).

## How would an invented hotel use the bundle, before and after?

Everything here is invented. "Hotel A" is my name for an 18-room hotel in Da Lat, a hill town in Vietnam's Central Highlands. I have not run this bundle on any model, so there is no output to compare.

Before:

```
Write a polite reply to this guest, please.
[paste the guest's review]
```

After:

```
ROLE
You are a guest-care assistant at Hotel A, an 18-room hotel in
Da Lat. You write drafts for Ms Lan, the manager, to read and
edit before sending.

CONTEXT
Guests write reviews on the booking site or message us on Zalo
(a Vietnamese messaging app). Check-in 14:00, check-out 12:00.
Free cancellation up to 3 days before arrival. Breakfast 6:30 to
9:30. The second-floor heater is being repaired this week.

EXAMPLES
[Three past replies: one compliment, one noise complaint, one
cancellation request.]

OUTPUT SPEC
English or Vietnamese to match the guest, signed "Hotel A",
80 to 120 words. Open by thanking the guest and naming the
detail they mentioned. End with the signer's name.

CONSTRAINTS
If you lack information to answer, write [NEEDS INFO: what is
missing] instead of guessing. Never promise a refund, discount
or compensation; write [MS LAN TO DECIDE] where one is needed.

THIS WEEK'S TASK
[paste reviews and messages]
```

What changed: the AI no longer guesses who reads the draft, who approves it, how long it should be or what it may promise. The draft still passes Ms Lan; [the verification ladder](https://staging.khoi.co.uk/en/blog/thang-kiem-chung-nam-bac) covers how hard she should check.

## Does giving the AI more documents always improve its answers?

Not necessarily. Anthropic describes "context rot": in needle-in-a-haystack studies, the more tokens in the context window, the worse a model recalls information accurately, and the article names no threshold (Anthropic, 2025). Its advice is to find the "smallest possible set of high-signal tokens", and it adds that minimal does not necessarily mean short (Anthropic, 2025).

For Hotel A, suppose a 40-page staff handbook exists. The bundle needs only the passages on check-in, cancellation and breakfast. Carrying a finding about recalling a fact over to drafting replies is my step, not one Anthropic tests.

## What does OpenAI's Codex experiment show about a harness?

Three things, in the company's own telling (see the library's [Codex experiment case](https://staging.khoi.co.uk/en/case/openai-codex-harness-experiment)). Every figure is OpenAI's own, unchecked by me. Five months from an empty repository, the codebase held about a million lines and roughly 1,500 pull requests from three engineers (later seven), 3.5 per engineer per day. The company estimates it took about a tenth of the time hand-writing would have; I saw no control in the article (Lopopolo, 2026).

First, early progress was slow because the environment was thin. When something failed, the fix was almost never "try harder"; the engineers asked "what capability is missing, and how do we make it both legible and enforceable for the agent?"

Second, the repository became the system of record. A single giant instruction file failed for four reasons: it crowded out the task, too much guidance became non-guidance, it went stale quickly, and it was hard to check. The team moved to a file of roughly 100 lines acting as a table of contents, pointing into a structured docs folder. Anything the agent "can't access in-context while running effectively doesn't exist", the article says, including discussions in chat or Google Docs.

Third, invariants were enforced mechanically. Custom linters and structural tests kept architectural boundaries, and error messages were written to inject fix instructions into the agent's context. Boundaries were enforced; how to work inside them was left to the agent.

The team once spent every Friday, 20 per cent of the week, cleaning up "AI slop"; it did not scale, so they moved to principles written into the repository plus recurring background tasks (Lopopolo, 2026).

## Does a team that builds no software have a harness?

There is an equivalent, but it is my analogy. OpenAI's article is about software engineers and says nothing about non-technical firms.

| Codex experiment | Equivalent for a non-software team (mine) |
|:--|:--|
| A 100-line file pointing into docs | A one-page index of procedures, one document each, with a named owner |
| Knowledge in chat does not exist for the agent | A rule agreed in a Zalo group but never written down is invisible to AI, and to new staff |
| Linters block a bad change | A send button only the manager can press; refunds above a limit need two signatures |
| Periodic clean-up | A log of drafts and edited versions; each month, move recurring corrections into the bundle |

The third row is the easiest to adopt. "Do not promise refunds" in a prompt is a request; a send button only the manager can press is a mechanism, which is the kind OpenAI chose. Google's whitepaper also advises documenting every prompt attempt (Boonstra, n.d., p. 64).

Hotel A does not need a harness yet. Anthropic separates workflows, run along predefined code paths, from agents that direct their own process and tool use (Anthropic, 2024). Drafting for Ms Lan to approve is a single model call; harness questions begin when AI replies directly, changes bookings or refunds money.

Do not copy the experiment wholesale. Software can be verified by automated tests (Anthropic, 2024); customer replies cannot. OpenAI itself says its approach of minimal blocking merge gates "would be irresponsible in a low-throughput environment" (Lopopolo, 2026).

## Going deeper: what are the three sources, what do they gain, and what did I not read?

The two frameworks here are this library's groupings: the context bundle note says Boonstra and Anthropic do not prescribe this exact set, and I found the phrase "three waves" in none of the three documents. I read the sources on 3 November 2026.

Google's whitepaper (Boonstra, February 2025) is written for users of Gemini on Vertex AI, which Google sells (Boonstra, n.d., p. 7). My copy is a PDF dated "February 2025" in its footer, hosted at innopreneur.io rather than the Kaggle page the library lists as n.d.; page numbers follow that copy. I read pages 1 to 35 and 54 to 68, not pages 36 to 53. The claim that "growing research suggests" positive instructions can outperform constraints carries no citation, and the endnotes list no study for it (Boonstra, n.d., p. 57). The passages I read contain no measured improvements.

I read Anthropic's context article (September 2025; Anthropic sells Claude) and its agents article (December 2024) in full. Both pages show edits in October 2026, so they may differ from the originals, and the agents article says much of its tooling has changed. I did not open the link behind "context rot".

I read all of OpenAI's article, written by a member of its technical staff. OpenAI sells Codex, and the post ends by pointing readers to it. It is one team's report on one internal product, with self-estimated numbers and no code or data I could check. The article itself limits its claim: driving a feature end to end depends heavily on the repository's structure and tooling and should not be assumed to generalise without similar investment (Lopopolo, 2026).

I read only the abstract of Brown and colleagues (2020); most authors list OpenAI as their affiliation.

## Frequently asked questions

### How many examples should a context bundle hold?

The sources do not agree on one number. Google's whitepaper gives two rules of thumb: at least three to five examples (Boonstra, n.d., p. 16), and, in its best-practice section, start with six and test accuracy from there (Boonstra, n.d., p. 60). Anthropic gives no number and advises curated, diverse, canonical examples rather than a list of every edge case (Anthropic, 2025). A sensible route is to begin with few and add more as failures appear, which is how Anthropic suggests building instructions.

### Has context engineering replaced prompt engineering?

Neither source I read says so. Anthropic lists system prompts and examples among the components of context, and says it still strongly advises putting examples in the prompt (Anthropic, 2025). The whitepaper's advice on writing a clear request therefore still applies; it sits inside a wider picture.

### Does a harness matter if my firm has no engineers?

It matters once you let AI act, such as sending emails, changing orders or issuing refunds, rather than only drafting for a person to approve. OpenAI's article describes a team of software engineers, and it says the ability to drive a whole feature end to end depends heavily on the structure and tooling of that repository (Lopopolo, 2026). The comparison with procedures, approval steps and logs in this post is my own inference.

### What should I record about each prompt attempt?

Google's whitepaper suggests a table with the prompt's name and version, goal, model, settings, the full prompt and the output (Boonstra, n.d., p. 66), plus a column rating each attempt OK, NOT OK or SOMETIMES OK and a column for feedback (Boonstra, n.d., p. 65). Its reasons: outputs differ across models, settings and versions (Boonstra, n.d., p. 64), and after a short break you forget more than you expect (Boonstra, n.d., p. 65).

## References

- Anthropic (2024) *Building effective AI agents*. Anthropic Research. Available at: https://www.anthropic.com/research/building-effective-agents (Accessed: 2026-11-01).
- Anthropic (2025) *Effective context engineering for AI agents*. Anthropic Research. Available at: https://www.anthropic.com/research/effective-context-engineering-for-ai-agents (Accessed: 2026-11-01).
- Boonstra, L. (n.d.) *Prompt engineering [whitepaper]*. Available at: https://www.kaggle.com/whitepaper-prompt-engineering (Accessed: 2026-11-01).
- Brown, T.B., Mann, B. and Ryder, N. (2020) *Language models are few-shot learners*. (arXiv preprint arXiv:2005.14165). https://doi.org/10.48550/arXiv.2005.14165
- Lopopolo, R. (2026) *Harness engineering: leveraging Codex in an agent-first world*. OpenAI. Available at: https://openai.com/index/harness-engineering/ (Accessed: 2026-11-01).

---

Canonical HTML version: https://staging.khoi.co.uk/en/blog/prompt-ngu-canh-harness
