The Formula for Agent Development: Model Plus Harness
This article breaks down the engineering formula Model + Harness = Agent and explains why the harness layer, not the model alone, determines how much capability actually reaches production. It covers the core harness responsibilities—context management, tool calling, task planning, environment execution, and evaluation loops—along with the rationale for a plugin-based architecture and a practical path for building a minimal, measurable, and evolvable agent system.
1. An Engineering Formula That Keeps Holding Up
In agent engineering practice, the industry has gradually converged on a simple equation:
Model + Harness = Agent
The Model is the foundation of the agent, handling semantic understanding, reasoning, and content generation. The Harness refers to all engineering elements outside the model; it is the critical middle layer that connects the model to real workflows. Only when the two are combined do you get an agent that can enter a real business environment and handle concrete tasks.
The value of this formula is that it replaces the vague expectation that “a strong model means a strong product” with an engineering structure that can be decomposed, divided into ownership, and measured. Model capability sets the ceiling; the Harness determines how much of that ceiling is actually realized in a given scenario. The same base model, paired with different harnesses, can produce products that differ several-fold in performance—which shows that the Harness is not an accessory but one of the main sources of product competitiveness.
It is worth stressing that the Harness is not a specific framework or tool, but an umbrella term for a class of infrastructure. Any cloud vendor or engineering team can implement it for their own scenarios. Common forms in the industry include AI coding tools, intelligent customer service systems, and data analysis assistants.
2. The Capability Boundaries of the Harness
The Harness’s responsibility can be summarized as making the model complete work safely, reliably, and repeatably. It typically includes the following layers of capability.
2.1 Context Management
The model has no memory; the only thing it can perceive is what is placed in the context window. Context management solves three things: what to include, how much to include, and how to compress.
- What to include: system instructions, task goals, conversation history, retrieved knowledge snippets, tool return results, and current environment state.
- How much to include: prioritize within a limited window so that critical information is not diluted.
- How to compress: summarize lengthy history, trim fields from structured data, and deduplicate repeated information.
A simplified illustration of context assembly logic:
def build_context(system, task, history, retrieved, tool_state, budget=8000):parts = [("system", system), ("task", task)]parts += [("history", h) for h in summarize(history)]parts += [("knowledge", k) for k in rank(retrieved)[:5]]parts += [("state", tool_state)]return fit_to_budget(parts, budget) # Trim by priority when over budget
2.2 Tool Calling
Tools are the model’s only channel to the real world. Engineering work here involves defining a unified tool description specification (name, purpose, parameter structure, return structure, error codes) and closing the loop of “select a tool—generate parameters—execute—parse the result—retry when necessary.” Key design points include validating parameters up front, making failures retryable, requiring a second confirmation for operations with side effects, and keeping audit records for sensitive operations.
2.3 Task Planning
Complex tasks cannot be completed in a single step; they need to be broken down into subgoals with a decided execution order. There are two common approaches: one is to have the model explicitly output a plan and then execute it step by step; the other is to use a “think—act—observe” loop driven by environment feedback to determine the next step. In practice, the two are often combined: plan at a coarse granularity first, then adjust dynamically within the loop.
2.4 Environment Interaction and Execution
This includes reading and writing files, modifying code, executing terminal commands, and making API requests. This layer carries the highest risk and must be paired with sandbox isolation, least-privilege access, resource quotas, and operation allowlists.
2.5 Feedback Collection and the Evaluation Loop
An agent must be measurable. The Harness needs to collect the input and output of each step, the tool call trace, elapsed time, and failure reasons, forming a regression evaluation set so that every adjustment to prompts, tool descriptions, and planning strategies has a quantitative basis.
3. Why Choose “Everything Is a Plugin”
The core motivation for making the Harness a plugin-based architecture is decoupling and evolvability. Models iterate, tools are added and removed, and business rules change. If this logic is hard-coded into the main flow, every change requires modifying core code, and both risk and cost become uncontrollable.
The direct benefits of a plugin architecture:
- Pluggable capabilities: adding a new tool or data source only requires implementing a unified interface and registering it, with no changes to the scheduling logic.
- Replaceable strategies: context compression strategies, planning strategies, and retry strategies can be replaced and canary-released independently.
- Controllable boundaries: each plugin declares the permissions it needs, making least-privilege authorization and auditing easier.
- An extensible ecosystem: third-party developers can contribute capabilities according to the specification, while the platform only maintains the kernel and the specification.
A minimal plugin contract illustration:
class Plugin:name: strdescription: strschema: dict # Parameter JSON Schemapermissions: list # Declared permission scopedef run(self, ctx, **params):raise NotImplementedError
The kernel is responsible for only three things: registry management, parameter validation, and execution with result collection. All concrete capabilities are implemented inside plugins, keeping the core stable while the periphery thrives.
4. Recommendations for Implementation
- Define the scenario and acceptance criteria first. Clarify the task boundary, how success is judged, and what behavior is unacceptable, and avoid chasing general-purpose capability from the start.
- Build a minimal viable Harness first. Context assembly, two or three high-frequency tools, and a basic loop are enough to get the loop running end to end; then gradually fill in planning and evaluation.
- Give evaluation the same priority as features. Without a regression evaluation set, any optimization is a blind change.
- Put security design up front. Sandboxing, permissions, auditing, and human confirmation points should exist in the first version rather than be patched in afterward.
- Focus on observability. Only by integrating common cloud capabilities such as log services, monitoring and alerting, and trace tracking can you pinpoint “why it got it wrong this time.”
5. Conclusion
“Model + Harness = Agent” reminds developers that the model is only the starting point; what truly determines product usability is that invisible layer of engineering infrastructure. Making context, tools, planning, execution, and evaluation into a pluggable, measurable, and evolvable system is what allows every upgrade in model capability to be reliably converted into an improvement in product experience.
