跪拜 Guibai
← All articles
Agent · Artificial Intelligence · AI Programming

Harness Engineering: The Missing Layer Between Chatbots and Working Agents

By Sailing ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Developers who see agent quality as a property of the model will misread why the same LLM produces very different results in different AI IDEs. The harness is where reliability, memory, and error recovery are actually engineered, which makes tooling choice a real engineering decision rather than a preference.

Summary

The article positions Harness Engineering as the third layer above prompt engineering and context engineering. Prompt engineering constrains the model's output with roles, rules, and formats. Context engineering manages the limited context window through recall, compression, and assembly. But neither makes the model actually do anything outside chat; that requires a harness.

The harness itself has four layers. An execution layer gives the model Bash, sandboxes, file systems, and MCP access. A memory layer pins down project goals, tech stack, and conventions, typically via rule files like CLAUDE.md. A feedback layer feeds test failures and errors back into the loop so the agent can self-correct. An orchestration layer decomposes big tasks into subtasks with clear criteria, preventing drift and infinite loops.

Practical implementation starts with a decent CLAUDE.md, or moves to a spec-driven plugin like spec-kit that updates the rule file as the work progresses. The article sees this as a role change: programmers move from writing code to writing rules and skills, and the harness around the model becomes the main engineering battleground.

Takeaways
— AI Agent = LLM + Harness Engineering; the model determines intelligence, the harness determines reliable execution.
— Prompt engineering solves unguided, rambling output; context engineering manages limited context windows; harness engineering makes the model actually work.
— Harness Engineering has four layers: execution (Bash, sandbox, file system, MCP), memory (rule files like CLAUDE.md), feedback (feeding test errors back into the loop), and orchestration (task decomposition and planning).
— Long agent loops inevitably corrupt context; a memory layer with reusable core information reduces drift.
— Context engineering follows three steps: recall, compression, and assembly; different tools implement these differently, which is why the same model seems smarter or dumber across AI IDEs.
— spec-kit applies spec-driven development, regenerating constraint files and updating CLAUDE.md per stage to keep injected context focused.
— The programmer's role shifts from writing code to writing rules and skills, making the harness design the main engineering focus.
— Rule files can be split into smaller files with lazy loading to avoid overflowing the context window.
Conclusions

The claim that the harness can get thinner as models improve but never disappear points to a permanent engineering layer around LLMs, not a temporary bridge until models become fully autonomous.

Framing memory, feedback, and orchestration as separate layers gives developers a concrete mental model for debugging agent failures: instead of tweaking prompts, you can inspect each harness layer independently.

The shift from writing code to writing rules and skills suggests the developer's value moves to encoding project constraints and workflows, which may change how software teams are measured and organized.

Concepts & terms
Harness Engineering
An engineering discipline that wraps an LLM in external layers (execution, memory, feedback, orchestration) so the model can reliably perform multi-step tasks rather than just chat.
ReAct
A reasoning-and-acting loop where the model thinks, an external program executes, and the results are fed back into the context for the next step, repeating until the task completes.
Context Corruption
The degradation of a model's performance over a long agent loop as the context window fills with mixed information, diluting original goals and causing inconsistent answers.
Spec Driven Development (SDD)
A workflow where requirements are translated into constraint and plan files before implementation, often updating rule files like CLAUDE.md at each stage, as a concrete application of Harness Engineering.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗