Beyond Context Engineering: The Scaffolding AI Agents Actually Need

The scaffolding matters as much as the model.

That has become clear as teams move from simple prompt chains to multi-step autonomous agents. Around 2023, the conversation focused on prompt engineering — how to write instructions a language model would follow reliably. By 2024, context engineering had taken over: how to give a model the right information, tools, and memory at the right moment. Both skills remain real, and both are now largely table stakes.

The emerging layer above them has a name: harness engineering. Where context engineering fills the model’s working memory, harness engineering builds everything around the model — the workflow it follows, the state it maintains between steps, the team of agents it collaborates with, the sandbox it operates in, and the feedback loops that let the system improve over time.

Nine components, not one

Breaking the practice into components makes it actionable. A well-built agent harness typically involves:

Context engineering — prompts, tools, and memory. The foundation, and now insufficient on its own.

Workflow and loop — the sequencing of steps. Even something as simple as a `process.md` file the agent reads at startup dramatically improves consistency and reduces drift across long runs.

State management — how the agent tracks progress between steps. Markdown files work surprisingly well here; coding agents use this pattern extensively.

Sub-agents — specialist agents called from the primary agent to handle specific tasks. A dedicated reviewer agent, for example, that reads what the builder produced and returns structured feedback before the next step begins.

Agent teams — multiple independent agent loops running collaboratively, each with a defined role and scope.

Permissions and sandboxing — defining what the agent is allowed to do. Running inside a Docker container (a lightweight, isolated computing environment) keeps experiments safe and reproducible.

Observability and evaluations — letting the model score its own outputs and iterate based on those scores. For coding agents, this is one of the highest-leverage additions available and one of the easiest to add.

Self-improvement — the agent updates its own workflow file after each run, encoding what it learned for the next one.

Recursive self-improvement — the agent also updates the instructions that govern how it improves. The workflow gets better; the improvement process itself gets better too.

Off-the-shelf agentic platforms cover most of this list automatically. General-purpose coding tools cover some of it. The rest requires deliberate engineering.

What this looks like in practice

A recent demonstration built a full sales CRM — pipeline stages, probability-weighted revenue, Kanban drag-and-drop, contact management — using two open-weight models: Qwen 3.8 Max as the primary builder and Kimi K3 as a dedicated reviewer. Total cost: $8.71.

The harness was four files. A `process.md` describing the build-verify-review-improve loop. An `opencode.json` wiring the two-model team together. A `self-improve.md` guiding how the agent should update its own instructions. And a dev container configuration providing an isolated sandbox with a browser skill for self-testing.

After roughly an hour of autonomous work, the agent had not just built the CRM — it had expanded both `process.md` and `self-improve.md` with substantive learnings: architectural recipes, verification loop notes, guidance on when unit tests mislead, and a new meta-section on how to self-improve effectively. That last section advised the agent to categorise every learning before writing it down, express it as an executable instruction, distinguish durable lessons from project-specific ones, and re-read the file after writing to close the loop.

The result was assessed as the best output produced across multiple model experiments on the same task. The difference was attributed not to which model was used, but to how the harness was structured.

Why this matters now

Model choice is increasingly a second-order variable. A well-engineered harness running a mid-tier model will often outperform a frontier model running with a thin prompt and no feedback loop. The quality ceiling is set more by structure than by parameters.

Most teams are still working with only the first two or three layers of the list above — context and maybe a workflow loop. The groups building fluency across the full stack — evaluations, agent teams, and recursive self-improvement in particular — are likely to find themselves well ahead as the field matures over the next year.

Text summarized and optimized using Anthropic’s models and reviewed by a human.