G-Harness: Architecting and Optimizing Multi-Agent Harnesses via Dynamic Graphs
Abstract
Multi-agent systems (MAS) depend not only on model capabilities, but also on the surrounding harness—the prompts, tools, memory, and control flow that govern agent interaction and execution. In MAS, agent composition, task assignment, tool access, and model binding are tightly coupled and evolve with task progress and runtime conditions, making harness optimization a dynamic system-level problem. Jointly adapting these decisions during execution is challenging because the feasible configuration space changes with the execution state, while the effects of structural changes are often revealed only through delayed task-level feedback. In this paper, we propose G-Harness, a dynamic graph-based framework for architecting and optimizing multi-agent harnesses. G-Harness formulates MAS execution and its surrounding harness as a unified dynamic graph, enabling coupled system organization and execution state to be represented and reasoned about jointly. We develop a task-conditioned graph-edit policy that learns to construct effective task-specific harness graphs and continuously rewrites them during execution, enabling automatic harness optimization and online adaptation based on runtime feedback. We further develop a global–local optimization framework that jointly captures task-level execution utility and the contribution of individual decisions, thereby guiding the policy toward task-relevant structural optimization. Extensive experiments demonstrate three key properties of G-Harness: (1) high-performing, achieving 80.68% Score on Harness-Bench; (2) cost-efficient, achieving a favorable performance-efficiency trade-off compared with existing multi-agent and harness optimization methods; and (3) attack resilient, suffering only a 1.14% performance drop under agent-level prompt attacks.
Then back it, or bet against it.
Related papers
Open the market on this paper to see 7 more related papers.