Manuscript Offprint

arXiv:2610.28380

Object-Oriented Harness: Evolving Agent Harnesses through Object-Oriented Design

Gaotang Li, Bhavana Dalvi Mishra, Yifei Ming, Yanfei Chen, Zhongying CuiZhu, Lesly Miculicich, Long T. Le, Rui Meng, Chun-Liang Li, Hanghang Tong, Chen-Yu Lee, Tomas Pfister

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Gaotang Li1,∗^{1,*}, Bhavana Dalvi Mishra2^{2}, Yifei Ming2^{2}, Yanfei Chen2^{2}, Zhongying CuiZhu2^{2}, Lesly Miculicich2^{2}, Long T. Le2^{2}, Rui Meng2^{2}, Chun-Liang Li2^{2}, Hanghang Tong1^{1}, Chen-Yu Lee2^{2} and Tomas Pfister2^{2}

1^{1}University of Illinois Urbana-Champaign, 2^{2}Google Cloud AI Research

Agent harnesses are executable code that specifies the prompts, tools, and control flow around a language model. A single global harness can struggle with heterogeneous tasks that require different execution strategies. In this work, we introduce Object-Oriented Harness (OO-Harness), a harness optimization framework that evolves a hierarchy of executable harness classes using object-oriented design. During training, an evolution agent uses execution records to create a family of specialized harnesses, each implemented as a subclass of the base or an existing specialized harness via inheritance. At test time, a harness router uses routing lessons accumulated during training to select a specific harness for each task. Across three long-horizon benchmarks spanning business workflows, workspace tasks, and tool use, OO-Harness achieves the best performance among the compared methods, with an absolute improvement of up to 15.79% over the base harness. Extensive ablation studies examine the contributions of its core components.

1. Introduction

Generalizing to tasks beyond the training distribution is a central goal of language-agent research (Xi et al., 2024; Zeng et al., 2023). Recent benchmarks illustrate the breadth of tasks agents must handle: FutureX evaluates agents on forecasting real-world events using external information (Zeng et al., 2025), while APEX-Agents evaluates cross-application workflows in investment banking, management consulting, and corporate law (Vidgen et al., 2026). These workloads differ in the tool use, context management, and completion checks they require. An agent's harness implements these choices as executable code around a language model (Yang et al., 2024).

Recent approaches automate agent design and harness optimization by refining executable code and other harness components using execution feedback (Hu et al., 2024; Jiang et al., 2026; Karten et al., 2026; Lee et al., 2026; Lin et al., 2026a; Lou et al., 2026; Nie et al., 2026; Zhang et al., 2025). Meta-Harness, for example, evolves candidate programs using discovery-set feedback and selects a global harness based on performance on that set (Lee et al., 2026). Such selection does not guarantee that the same changes remain beneficial under distribution shift. Even within a benchmark, Agentic Harness Engineering's component ablations show that adding evolved memory improves performance on hard tasks but reduces it on easy ones (Lin et al., 2026a). EvoHarnessBench further shows that adding tools, skills, and specialist agents can degrade previously effective behavior (Ke et al., 2026). These findings motivate specialized harnesses that share common code while preserving different execution strategies, with a router selecting a harness for each task.

Because harnesses are executable code (Ning et al., 2026), object-oriented design offers a natural way to express shared and specialized behavior. We introduce Object-Oriented Harness (OO-Harness), a harness optimization framework that evolves a hierarchy of executable classes (Figure 1). Each specialized harness inherits from the base or an existing specialized harness, overriding inherited methods or adding new ones.

During training, we first cluster discovery tasks by shared execution needs identified in base-harness execution records. An evolution agent iteratively selects a cluster and parent harness, creates a subclass, and evaluates it across the

∗^{*}This work was done during Gaotang Li's internship at Google Cloud AI Research.

(a) Global harness

One shared implementation

Figure

(b) Flat harness family

Independent implementations

Figure

(c) OO-Harness

Inherited implementations

Figure

Figure 1 | Three ways to organize harness adaptation. (a) A single global harness serves all tasks. (b) A router selects among independent harness implementations. (c) OO-HARNESS selects among specialized harnesses that share code through inheritance.

cluster's tasks. This feedback guides subsequent revisions and accumulates as design and routing lessons. This offers two advantages. Efficiency: evaluating candidates on their target clusters avoids rerunning the entire discovery set. Generalization: specialized changes leave the base and other learned harnesses intact, so new tasks can use an appropriate harness without inheriting unrelated changes. At test time, polymorphism allows the executor to run a selected harness through a common execution interface. A harness router uses the task, an observable base trajectory, and routing lessons to select a specialized harness or retain the base result. The hierarchy and lessons are frozen before deployment; executor weights remain fixed in both phases.

Concurrent work also explores task-specific harness selection. Adaptive Auto-Harness routes tasks among specialized Git branches (Liu et al., 2026b). In OO-HARNESS, inheritance shares code across harnesses, and routing lessons learned during training guide selection alongside class descriptions and observable base trajectories.

We evaluate OO-HARNESS on Automation-Bench, Workspace-Bench, and Toolathlon-GYM, where it achieves the highest primary score among the compared methods.

Our contributions are:

• A harness representation combining shared code and specialized behavior through inheritance, method overrides, and new methods.

• An evolution framework that learns specialized harnesses and routing lessons from execution records to support task-specific selection.

• Strong empirical results across three long-horizon benchmarks, with extensive ablations validating individual components.

References (60)