What is “Harness,” and what does it “Harness”?
The shifting narratives in the AI world are like a passing parade — constant and rapid. Before the hype surrounding OpenClaw has even…
What is “Harness,” and what does it “Harness”?

The shifting narratives in the AI world are like a passing parade — constant and rapid. Before the hype surrounding OpenClaw has even faded, a new term has gained traction, riding the coattails of the recent Claude Code source code leak: Harness.
The literal meaning of a harness is the set of straps used to control a horse or ox, directing them to plow fields or pull carts. Of course, the “beasts of burden” in this context are different; getting these modern workers to perform only requires a prompt. So, in the context of AI, what exactly does “Harness” refer to?
1. What is Harness?
If we compare an AI Agent to a car, the Model is the engine, while the Harness represents the steering wheel, gearbox, dashboard, and brakes. It is responsible for converting the engine’s raw power into controlled movement.
Both Prompt Engineering and Context Engineering are essentially parts of a broader “Harness.” Prompts were the Harness of the chat-box era; Context Engineering is the Harness of the Agent era. In September 2025, Anthropic published “Effective Context Engineering for AI Agents,” shifting the industry’s focus from “writing good prompts” to “managing the entire context state.” Key strategies include: managing System Prompts as code, optimizing tool descriptions, using RAG for on-demand retrieval, conversation summarization, sliding window strategies, and cleaning up redundant tool outputs.
However, in practical production, these measures still fail to fully solve Agent issues like “finishing prematurely,” “faking completion,” or “cross-session amnesia.” This has pushed the industry to move from “scattered context optimization” toward a “systematized Agent management and control framework” — this is Harness Engineering.
2. What does it “Harness”?
Large Language Models (LLMs) face dual uncertainties: first, their probabilistic nature (the same input doesn’t always yield the same output, much like a wild horse whose next move is unpredictable); and second, their capacity boundaries(limited context windows lead to “memory loss” during long tasks). Yet, production environments demand determinism. The core mission of the Harness is to establish certainty on top of these two uncertainties.
A. Single-Agent Workflows
For a single Agent, the Harness employs a mandatory workflow management mechanism:
- Session Awakening: Every time a new session starts, the Agent is forced to read the working directory, git history, and progress files (e.g.,
progress.txt), solving the cross-session amnesia problem. - Task Locking: Using a JSON manifest to lock the task list. The Agent can only mark tasks as “complete” but cannot arbitrarily delete or modify task definitions, preventing “faked completion” and ensuring goal determinism.
- Git Archiving and Rollback: Providing a “Time Machine” through version control. This records every operation in full, so the system doesn’t rely on the model itself to undo its own mistakes.
- Context Resetting: When memory is near overflow, the system proactively clears the context and starts a new Agent, passing along a structured hand-off list.
- Repo-as-Truth: Represented by files like
AGENTS.md, all rules the Agent must follow are written directly into the code repository and enforced via automated checks. This concept, pushed by OpenAI Codex, Google Jules, Cursor, and others, is becoming an industry standard. It ensures the environment the Agent perceives is accurate, significantly eliminating environmental uncertainty.
B. Multi-Agent Collaboration
When multiple Agents work together, issues like resource contention and overlapping work arise. Multi-Agent Harness measures include:
- Hierarchical Architecture: Introducing layers such as Planners, Executors, and Judges. Utilizing orchestration engines and gating mechanisms, an Executor cannot act without approval.
- Isolated Sub-Agents: The Main Agent assigns sub-tasks to independent Sub-Agents. Each Sub-Agent runs in its own context window and returns only the result — not the full working context — preventing risky operations from “poisoning” the Main Agent’s state.
These design philosophies are all reflected in the engineering implementation of the recently leaked Claude Code source code. The leak also exposed several unreleased functional modules:
- KAIROS: A background daemon mode. It uses periodic “tick” signals to actively decide if action is needed and features an
autoDreammemory consolidation mechanism. It transforms the Agent from a passive command-follower into a proactive, continuous assistant. - YOLO Classifier (Permission Classifier): An ML-based rapid permission decision system. Based on the risk level of a tool operation (LOW/MEDIUM/HIGH), it automatically decides whether to allow or intercept, reducing the need for constant user confirmation.
- Hooks: Reserved slots at key workflow nodes that allow developers to inject custom check scripts, turning a closed system into an extensible open platform.
The existence of these modules proves that Harness Engineering is not just a static management system built around model weaknesses; it evolves as model capabilities improve, migrating from “task execution control” toward “proactive, adaptive Agent infrastructure.”
3. The Future of the Harness
Every component of the Harness is designed to compensate for a model’s shortcomings. As model capabilities improve, some of these compensations will become dead weight. The true “moat” is not the thickness of the Harness, but the speed at which the “compensation list” is updated — knowing when to reinforce and when to dismantle, allowing the model to achieve peak efficiency.
The Harness is not a shackle; it is the gear set that releases productivity.
But… will AI always be the beast of burden?
메타데이터
- post_id
- 792ec0cab613
- slug
- what-is-harness-and-what-does-it-harness-792ec0cab613
- url
- https://medium.com/@jiyuanx/what-is-harness-and-what-does-it-harness-792ec0cab613
- canonical_url
- https://medium.com/@jiyuanx/what-is-harness-and-what-does-it-harness-792ec0cab613
- author_url
- https://medium.com/@jiyuanx
- status
- ok
- fetched_at
- 2026-07-11 11:04:43