The Agent Development Formula: Model + Harness Explained
This article breaks down the Model + Harness = Agent formula, explaining what the model contributes, what the harness handles across context management, tool calling, planning, file editing, terminal execution, feedback, and evaluation, and how a stable contract between the two lets each evolve independently. It also covers common pitfalls and a practical path to production.
1. What the Formula Really Means: From Answering to Delivering
In agent engineering practice, the industry has gradually converged on a simple but profound structural judgment: Model + Harness = Agent. This is not simple addition. It is a division of capability and a clear boundary of responsibility: the model provides cognitive ability, the execution framework provides the ability to act, and without either one, an agent cannot truly enter a production workflow.
This formula was proposed by a leading AI research team. This article abstracts it into a general engineering paradigm and does not refer to any specific vendor product.
The core metric of a traditional conversational application is “does the answer sound right,” while the core metric of an agent is “was the task actually completed.” The former requires only a single forward pass; the latter requires multiple rounds of iteration, state maintenance, and result verification. The value of the formula is that it decomposes the complex engineering of “getting things done” into two parts that can evolve independently and be optimized separately.
2. Model: The Cognitive Foundation of an Agent
In the formula, the model handles three core responsibilities: understanding, reasoning, and generation. It determines the ceiling of the agent’s capability.
- Understanding: parsing natural language instructions, code semantics, log structures, and document formats, turning unstructured input into computable internal representations.
- Reasoning: multi-step logical deduction, trade-off analysis, and causal judgment, which are prerequisites for task decomposition and root-cause analysis.
- Generation: producing structured plans, code patches, configuration snippets, or natural language explanations.
The key engineering insight is that model capability has clear boundaries. The context window is limited, long-range consistency decays, memory of exact values and state is unreliable, and hallucination cannot be fully eliminated. Betting all reliability on model upgrades is an expensive path with uncertain returns. The more robust engineering approach is to acknowledge these boundaries and fill the gaps with external mechanisms.
An illustrative division of labor looks like this:
# Pseudocode: the model decides, the framework executes and constrainswhile not task.done():decision = model.generate(context=harness.build_context(),tools=harness.tool_schema(),budget=harness.remaining_budget())result = harness.execute(decision) # execute, verify, collect feedbackharness.record(result) # persist state for the next round
3. Harness: The Underrated Engineering Component
The harness is defined as “everything other than the model itself.” It is the critical middle layer connecting the model to real workflows. As the saying goes, the model determines how the lower bound is perceived, while the framework determines how far the upper bound can be reached. The harness is the component that turns a demo into product stability.
3.1 Context Management
Context is the scarcest resource. Engineering techniques include layered loading (system constraints, long-term memory, the current task, retrieved snippets), relevance filtering, history compression and summarization, and external memory reads and writes when needed. The goal is to ensure that within a limited budget, the model sees “the information that matters most right now” on every round.
3.2 Tool Calling
Tools are the only channel through which the model reaches real systems. The design priorities are clear interface semantics, strongly constrained parameters, readable error messages, and least-privilege permissions. The tool description is itself a form of prompt engineering; a vague description directly causes call failures.
3.3 Task Planning
Break a vague goal into verifiable subtasks and maintain a task state machine. Planning does not need to be finalized in one pass. A more reliable pattern is the rolling loop of “plan, execute, replan,” which allows the path to be adjusted once failure signals appear.
3.4 File Reading/Writing and Code Modification
Real work is carried in files and code. The framework must provide a controlled read/write view, diff comparison, change rollback, and a minimal-edit principle to avoid large unintended modifications.
3.5 Terminal Execution
Command execution brings the strongest capability and the highest risk. It must be paired with sandbox isolation, resource quotas, timeout control, interception of dangerous commands, and operation auditing.
3.6 Feedback Collection
Execution results, error stacks, and test output should all be collected in a structured way and fed back into the context, forming an “observe and adjust” loop. Feedback quality directly determines self-healing ability.
3.7 Evaluation Loop
Without evaluation there is no iteration. You need a repeatable set of test cases, automated checks, regression comparison, and a repository of failure samples, turning subjective experience into quantifiable metrics.
4. How the Two Work Together: Closing the Loop
The key to making the formula work is interface design. The model and the framework should agree on a stable contract: a unified tool schema description, a unified structured output format, unified error-code semantics, and unified budget and termination conditions. Once the contract is stable, the model can be upgraded independently and the framework can be refactored independently, without blocking each other.
On general-purpose cloud infrastructure, such systems are typically carried by a few common capability categories: container platforms provide isolated runtime environments, object storage holds task artifacts and datasets, message queues decouple long-running tasks, logging services and monitoring alerts support observability, and key management capabilities protect credentials. These are all general industry categories, and specific choices should be evaluated against scale and compliance requirements.
5. Common Pitfalls and Practical Recommendations
- Pitfall 1: Only optimizing prompts. Prompts are a tiny part of the harness. Ignoring execution and evaluation means results cannot be stable.
- Pitfall 2: Chasing full automation. High-risk actions should keep human confirmation checkpoints; tiered authorization is more sustainable.
- Pitfall 3: Ignoring observability. Without tracing and cost tracking, both problem localization and capacity planning get out of control.
- Recommendation: first define verifiable success criteria, then build a minimal harness, then fill in the evaluation set, and finally open up automation permissions step by step.
6. Conclusion
The real lesson of Model + Harness = Agent is to shift the agent from “a showcase of model capability” to “the construction of an engineering system.” The model keeps getting stronger, but that is an external variable; the design quality of the harness is the core competitive advantage a team can control. By continuously refining the six directions of context, tools, planning, execution, feedback, and evaluation, and by using the general infrastructure capabilities offered by Baidu AI Cloud for isolation, storage, scheduling, and observability, an agent can reliably enter real business workflows and continuously produce measurable value.
