Agent Harness: Should It Be Heavy or Light?

    This article examines whether an AI agent harness should be heavy or light by comparing two common definitions, analyzing why agent failure modes create demand for runtime infrastructure, and explaining why scenario-specific knowledge favors a thin wrapper. It concludes that the harness should get heavier on the control plane and lighter on the data plane, and provides a selection checklist along with common pitfalls to avoid.

    1. Defining the Boundaries: Three Layers and the Real Role of the Harness

    Before debating “heavy” versus “light,” we need a shared vocabulary. The industry usually abstracts the agent technology stack into three layers:

    • Framework layer: Provides building blocks such as prompt templates, tool abstractions, memory interfaces, and message models. It focuses on development efficiency and expressiveness.
    • Runtime layer: Provides the “engine” capabilities for durable execution, streaming output, checkpoint recovery, and human-in-the-loop collaboration. It focuses on how a single run is driven reliably.
    • Harness layer: An opinionated composition for a specific task scenario, with preset prompt strategies, tool sets, context management strategies, and integration patterns. It focuses on out-of-the-box usability and result stability.

    Another definition, closer to engineering practice, treats the harness as “the runtime infrastructure around the agent main loop”: retries, state persistence, event routing, concurrency control, and observability. A minimal kernel is often just a think → act → observe loop that does not depend on any heavy framework.

    The two definitions do not conflict: the former emphasizes scenario packaging, while the latter emphasizes runtime support. The real point of disagreement is whether these capabilities should be consolidated into a platform-level heavy foundation or exist as a thin layer of external code hugging the business logic.

    2. Why “Heavy” Has Strong Demand: Agent Failure Modes Differ from Traditional Services

    Failures in traditional request-response services are “point-like,” whereas agent failures are “chain-like”: a single tool call timeout can make an entire reasoning process drift, an overly long context can make the model forget a critical constraint, and a concurrency hiccup can cause duplicate side effects. This means the harness must meet four hard requirements:

    1. State and recovery: Long-running tasks need to externalize intermediate state so that after a process restart, execution can resume from the checkpoint instead of starting over.
    2. Idempotency and side-effect governance: Actions such as writing files, placing orders, and sending messages must be deduplicable and compensable; otherwise, retries themselves become a source of risk.
    3. Context budget: Tokens are a finite resource, requiring retrieval, compression, summarization, and eviction strategies to work together.
    4. Observability and evaluation: Without fine-grained tracing and offline evaluation, it is impossible to pinpoint exactly which step went wrong.

    These capabilities are clearly infrastructure-like: reusable across scenarios, requiring high availability, and needing unified governance. Making them a heavy foundation yields benefits at scale; the cost is abstraction leakage and slower iteration.

    3. Why “Light” Also Holds: Scenario Differences Outweigh Commonalities

    Conversely, much of an agent’s “intelligence” relies heavily on scenario-specific knowledge: domain terminology, internal system interfaces, compliance phrasing, and specific output formats. A general-purpose foundation cannot anticipate these, and forcing them into a platform only produces a configuration system with exploding parameters.

    The value of a lightweight external layer lies in:

    • Staying close to the code repository: Strategies evolve in the same repository as business code, and review, rollback, and canary release all follow existing processes.
    • Low lock-in risk: The main loop is only a few dozen lines, so replacing the model, storage, or scheduler is cost-controlled.
    • Intuitive debugging: The path of a single run is the code path, so breakpoints, logs, and unit tests can be reused directly.

    A minimal kernel, for illustration:

    1. def agent_loop(goal, tools, memory, max_steps=20):
    2. state = memory.load(goal.id)
    3. for step in range(max_steps):
    4. if state.done:
    5. return state.result
    6. decision = llm.decide(goal, state, tools) # think
    7. outcome = tools.run(decision, idem_key=state.next_key()) # act
    8. state = memory.append(state, decision, outcome) # observe
    9. return state.result

    This code depends on no framework, yet it already leaves interface slots for “recoverable, idempotent, and traceable.”

    4. Conclusion: Diverge Along the Control Plane and Data Plane, Not Either/Or

    A more accurate judgment is that the harness will get heavier on the control plane and lighter on the data plane.

    • Control plane (heavy): State storage, task orchestration, retries and compensation, concurrency and quotas, audit and permissions, metrics and tracing. These are platform-level capabilities, suitable for a unified runtime foundation or general cloud capabilities (such as object storage, message queues, container platforms, logging services, and monitoring/alerting).
    • Data plane (light): Prompt strategies, tool selection, context trimming rules, and output validation. These hug the scenario closely and should stay thin, readable, and replaceable.

    In other words, the mainstream form in the future is “thin wrapper + strong foundation“: the business side keeps only a clear main loop and a few strategy hooks, while the remaining reliability capabilities sink downward.

    5. Implementation Advice: A Selection Checklist

    • Does the task exceed a single session? Yes → prioritize externalized state and recovery.
    • Are there irreversible side effects? Yes → idempotency keys and compensation mechanisms must exist before retries.
    • Does the context frequently overflow? Yes → layered memory and summarization/compression strategies are needed.
    • Is multi-person collaboration and auditing required? Yes → control plane capabilities should be platformized.
    • Is scenario knowledge highly private? Yes → keep the packaging layer lightweight to avoid the generalization trap.

    6. Common Pitfalls

    1. Treating a framework as a harness: A complete set of building blocks does not mean reliable execution.
    2. Over-packaging: Solidifying prompts and tool sets into the foundation means every requirement change requires modifying the platform.
    3. Ignoring evaluation: Without offline evaluation and a regression set, any “optimization” is blind tuning.
    4. Assuming retries equal idempotency: Retries without deduplication and compensation amplify failures.

    Ultimately, the criterion is not a stance on “heavy” or “light,” but whether capabilities are placed in the right layer: reliability sinks down, strategies float up, and only then can an agent system be both stable and fast.