Context engineering is one layer of the harness, not a synonym for it. It's the information-selection layer: the set of strategies for curating the optimal set of tokens the model sees, as Anthropic defines it (September 2025). RAG sits inside context engineering as one retrieval technique. The harness is the whole thing, context plus orchestration.
What context engineering actually is
Context engineering is the discipline of deciding what goes into the model's context window and what stays out. Anthropic defines it as "the set of strategies for curating and maintaining the optimal set of tokens (information) during LLM inference" (September 29, 2025). The term got popular in late June 2025: Tobi Lütke used it, Andrej Karpathy amplified it as "the delicate art and science of filling the context window with just the right information", and Simon Willison documented it in his June 27, 2025 post. So it's real, and it's more than writing a good prompt. It's engineering the information the model runs on.
RAG is one technique inside context engineering
RAG and context engineering get used as if they were the same thing. They aren't. RAG (retrieval-augmented generation) is one way to get relevant information into the context: fetch documents, inject the top results. Karpathy lists it as just one element of context engineering, alongside memory, summarization, and tool output. Atlan puts it plainly: "Context engineering is a discipline, and RAG is one of its techniques" (April 2026), and context engineering "wraps retrieval with governance". So RAG is inside context engineering, and context engineering is inside something bigger.
The containment, layer by layer
| Layer | What it covers | Example |
|---|---|---|
| RAG | One retrieval technique: fetch relevant documents into the context | Vector search, inject the top results |
| Context engineering | The information-selection layer: curate the optimal tokens. Contains RAG and prompt engineering | Retrieval, memory, summarization, what to keep or drop |
| Prompt engineering | Crafting the instruction the model reads. A subset of context selection | System prompt, few-shot examples |
| Harness (orchestration) | The whole engineered environment: context plus tools, state, verification, permissions, termination | Claude Code, capivaOS |
| Model | The weights that generate tokens. What the harness wraps | gpt-5.2, Claude, Gemini |
Context engineering is a layer, the harness is the whole
Atlan describes two layers that people flatten into one. Context engineering is the information-selection layer: what the model sees. Harness engineering is the orchestration layer: state, tools, verification, permissions, and when to stop. Context engineering isn't the lesser one. It's a real discipline, and it's hard. But a model that sees the right information can still call the wrong tool, run forever, or ship output nobody checked. Those failures live in the orchestration layer. So if you've mastered context engineering, you've built one layer of the harness. A good one. Not the whole thing.
Context selection is where most people stop
Context selection is where most people stop. The orchestration layer is what comes next: tools, state, verification, permissions, and termination. A real harness ships both in the same pipeline. That's what capivaOS is, the open-source harness on top of Claude Code. For the full picture of the harness that contains context engineering, RAG, and everything else, start with What is an AI Harness.
Frequently asked questions
What is context engineering?▼
It's the discipline of curating what goes into the model's context window: which documents, memory, and instructions the model sees during inference. Anthropic defines it as the set of strategies for curating and maintaining the optimal set of tokens during LLM inference (September 2025). It's broader than writing a prompt, and it's one layer of the harness.
What's the difference between context engineering and RAG?▼
RAG is one technique; context engineering is the discipline that contains it. RAG retrieves relevant documents and injects them into the context. Context engineering decides everything that fills the context window: retrieval, memory, summarization, and what to leave out. Atlan puts it as "Context engineering is a discipline, and RAG is one of its techniques" (April 2026).
Is context engineering the same as the harness?▼
No. Context engineering is the information-selection layer: what the model sees. The harness is the whole engineered environment, which also includes orchestration: tools, state, verification, permissions, and termination (Atlan's layered model, 2026). Context engineering sits inside the harness.
Who coined the term context engineering?▼
The term got popular in late June 2025. Tobi Lütke used it, Andrej Karpathy amplified it (calling it the art and science of filling the context window with just the right information), and Simon Willison documented it in his June 27, 2025 post. It's a real discipline with a short, well-traced history.
Is context engineering the same as prompt engineering?▼
No. Prompt engineering is crafting the instruction the model reads. Context engineering is broader: it manages everything in the context window, including the prompt, retrieved documents, memory, and tool output. Prompt engineering is one piece of context engineering, not the reverse.
If I do RAG well, do I have a harness?▼
No. Good RAG gives you strong retrieval, which is one technique inside context engineering, which is one layer of the harness. A harness also needs orchestration: tools, state, verification, permissions, and a rule for when to stop. Retrieval alone won't catch a wrong tool call or a run that never ends.
RAG is inside context engineering. Context engineering is inside the harness. Master one layer and you still have to build the rest.