The Evolution of Agent Harness: Thin Core and Pluggable Architecture
This article examines why the thickness of an Agent harness has become a key engineering variable. It clarifies the layering of framework, runtime, and harness, argues that the optimal thickness of each layer is a function of model capability rather than a constant, and shows how a minimal agent loop can stay thin without giving up retries, idempotency, concurrency limits, or auditing. It then defines stable contracts for pluggable modules, the role of standard protocols as the glue between core and modules, the squeeze harnesses face from upstream model capabilities and downstream automation platforms, and practical guidance plus common pitfalls for keeping a harness lean as models evolve.
1. The Problem: Why Harness Thickness Becomes a Key Variable
As Agent systems move into an engineering phase, one question keeps coming up: should the shell that hosts an Agent be a heavy piece of infrastructure, or a thin add-on? The former implies a full orchestration engine, state machines, durable scheduling, and a permission system. The latter implies almost no assumptions, offering only a minimal loop driver and tool access.
In practice, neither extreme holds up over time. A heavy design turns its abstraction layers into migration costs while capability boundaries are still unstable. A thin design struggles to meet basic requirements in real business settings, such as retries, idempotency, concurrency, and auditing. A more reasonable judgment is that the harness is converging on a middle ground: a thin core + pluggable modules + standard protocols. This article argues for that position and lays out design points that can actually be implemented.
2. Clarifying the Concepts: Layering Framework, Runtime, and Harness
A fairly common way to divide the Agent stack is into three layers:
- Framework layer: supplies building blocks, such as prompt templates, tool abstractions, memory interfaces, and message models.
- Runtime layer: supplies execution engine capabilities, such as durable execution, streaming output, interrupt and resume, and human-in-the-loop collaboration.
- Harness layer: the opinionated wrapper closest to the business, containing preset prompts, a default tool set, context management policies, integration methods, and a default memory scheme.
The three are additive, not replacements for one another. The conclusion worth noting is this: the optimal thickness of each layer is not a constant but a function of model capability. As a model internalizes more (for example, planning better, self-checking, and making better use of long context), the framework layer needs to provide fewer compensatory abstractions, and the hard-coded process steps in the harness should be deleted accordingly rather than kept piling up.
A common anti-pattern is to permanently freeze prompt flows, step-by-step validation, and fixed planning templates that were designed early on for weaker models. As models are upgraded, those steps yield diminishing returns and can even conflict with the model’s own strategy, causing duplicate planning and contradictory instructions. A harness therefore needs the ability to subtract: periodically audit which constraints have been internalized, which tools have become redundant, and which state no longer needs to be persisted.
3. The Core Structure: An Agent Loop That Is Thin Enough
No matter how complex the outer wrapper gets, the core of a harness can usually be abstracted into a minimal loop:
def agent_loop(goal, tools, memory, policy, max_steps=50):context = memory.load(goal)for step in range(max_steps):decision = policy.decide(context, tools.schema())if decision.type == "final":return decision.answerresult = tools.invoke(decision.tool, decision.args) # includes timeout, retry, sandboxcontext = memory.append(context, decision, result)return memory.summarize(context)
This loop is sufficient because it pushes complexity out into replaceable modules: policy is determined jointly by the model and the prompt, tool execution is guaranteed by the sandbox and retry policy, and context is compressed and retrieved by the memory module. The core assumes no graph structure, no role division, and no fixed state machine, which avoids locking in an architecture too early.
It is worth stressing that “thin” does not mean “crude”. A thin core means not presupposing a business orchestration paradigm, not skipping engineering safeguards. Capabilities such as retries, timeouts, idempotency, concurrency limits, and audit logs must exist; they simply belong in pluggable modules rather than being woven into the main loop.
4. Pluggable Modules: Isolating Instability at the Boundaries
The key to pluggability is defining a stable contract for each category of volatile capability. At a minimum, abstract the following modules:
- Context and memory module: responsible for retrieval, compression, summarization, and eviction; the interface exposes only write, retrieve, summarize, and purge.
- Tool and sandbox module: responsible for registration, authentication, timeouts, retries, resource limits, and output truncation; it exposes only a unified invocation protocol to the model.
- Policy and constraint module: responsible for system prompts, boundary rules, and approval policies; it should support hot updates and canary rollouts.
- Observability module: responsible for tracing, metrics, logs, and replay; it plugs in as an event stream without intruding on the main loop.
- Human-in-the-loop module: responsible for interruption, confirmation, takeover, and recovery; it is decoupled from the main loop through a checkpoint mechanism.
A sample contract definition can be quite plain:
{"tool": "run_tests","args": {"scope": "changed_files"},"timeout_ms": 120000,"retry": {"max": 2, "backoff": "exponential"},"sandbox": {"cpu": "2", "memory": "4Gi", "network": "deny"}}
Once the contracts are stable, swapping the underlying implementation (changing the sandbox form, the logging backend, or the vector retrieval scheme) does not require changes to the main loop. That is the evolution dividend that pluggability brings.
5. Standard Protocols: The Third Leg That Reduces Coupling
Between a thin core and pluggable modules, standard protocols act as the glue. Protocols should cover at least three kinds of interaction:
- Model interaction protocol: a unified message structure, tool call format, streaming events, and termination conditions.
- Tool interaction protocol: unified discovery, invocation, error codes, timeouts, and result structures.
- Event and tracing protocol: unified lifecycle events (start, decision, invocation, observation, end) so that replay across modules is possible.
The benefit of protocolization is that models, tools, storage, and observability can evolve independently. Teams can swap model vendors, adjust context compression policies, or upgrade the sandbox implementation without touching business code. In enterprise settings, protocols also let permission, audit, and compliance checks be implemented centrally instead of being scattered around.
6. Positioning Under Pressure From Both Sides
Looking at the industry structure, the harness is under pressure from two directions. Upstream, model and runtime capabilities are moving down, building planning, tool calling, and long context into the platform. Downstream, automation and integration platforms are consolidating upward, standardizing triggers, connections, and dispatch. The result is that an overly heavy standalone orchestration layer is the easiest to be replaced from both ends.
So the viable positioning for a harness is not “a bigger framework” but “a more accurate wrapper”: make business defaults, domain tools, context policies, and compliance constraints solid, and leave general execution capabilities to a standard runtime. To check whether your own harness is too thick, ask three questions:
- Is this logic merely compensation for the capabilities of an older model?
- Is this capability already replaceable by a standard protocol or a platform capability?
- Has this abstraction really been reused more than twice across the past two versions?
If most answers are “yes”, it is time to subtract.
7. Implementation Advice and Common Pitfalls
- Define protocols first, then choose implementations: avoid writing a specific storage, messaging, or sandbox interface into the business layer.
- Make reliability a module: retries must be paired with idempotency keys and deduplication, otherwise side effects get amplified.
- Make the context budget explicit: set quotas and eviction rules for prompts, history, retrieval results, and tool output.
- Constrain tool output strictly: truncate, structure, and label error types so noise does not pollute decisions.
- Put observability first: without tracing and replay, tuning is guesswork.
- Establish a deletion mechanism: build “remove constraints that have been internalized” into the release process so the harness does not grow fat in reverse.
Common pitfalls include introducing complex graph orchestration too early; hard-coding approval and permission into the loop; lacking unified error semantics for tool failures; and coupling prompt policies with business logic, which makes canary rollouts impossible.
8. Conclusion
The design of an Agent system’s harness will more likely land on the middle ground of a thin core + pluggable modules + standard protocols. Heavy infrastructure costs too much while capabilities are changing fast, and a thin add-on cannot carry engineering safeguards. The sustainable approach is to keep the core loop minimal, modularize volatile capabilities, protocolize interactions, and maintain a mechanism for continuous subtraction. With general cloud capabilities as the foundation (for example, a container platform hosting sandboxes, a message queue carrying events, and logging and monitoring carrying observability), teams can build Agent systems that are both lightweight and robust, and that keep iterating as models evolve, without locking in an architecture.
