NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Code as Agent Harness

Xuying Ning, Katherine Tieu, Dongqi Fu, Tianxin Wei, Zihao Li, Yuanchen Bei, Jiaru Zou, Mengting Ai, Zhining Liu, Ting-Wei Li, Lingjie Chen, Yanjun Zhao, Ke Yang, Bingxuan Li, Cheng Qian, Gaotang Li, Xiao Lin, Zhichen Zeng, Ruizhong Qiu, Sirui Chen, Yifan Sun, Xiyuan Yang, Ruida Wang, Rui Pan, Chenyuan Yang, Dylan Zhang, Liri Fang, Zikun Cui, Yang Cao, Pan Chen, Dorothy Sun, Ren Chen, Mahesh Srinivasan, Nipun Mathur, Yinglong Xia, Hong Li, Hong Yan, Pan Lu, Lingming Zhang, Tong Zhang, Hanghang Tong, Jingrui HearXiv 2026

TL;DR

This paper introduces "Code as Agent Harness" (CAH), a paradigm shift that reframes code from being a mere output of Large Language Models (LLMs) to the fundamental operational substrate for AI agents. By centering code as the medium for reasoning, acting, and environment modeling, the authors provide a comprehensive roadmap for building agentic systems that are truly executable, verifiable, and stateful.

What Problem Does This Paper Address?

While LLMs have become remarkably good at writing code, turning a stateless model into a functional, reliable agent remains a massive engineering challenge. Traditional approaches often treat code as the "end product," but in complex, long-running tasks—like fixing a bug in a massive repository or conducting a scientific experiment—the agent needs more than just a final script. It needs a way to externalize its thoughts, interact with tools, maintain memory, and verify its progress.

The authors argue that the current bottleneck in AI autonomy isn't just the reasoning ability of the base model, but the "harness"—the software layer surrounding the model. They address the lack of a unified framework for "harness engineering," proposing that code itself is the best possible interface to connect models to the real world.

Methods

The paper organizes the vast landscape of agent research into a three-layered taxonomy:

  1. Harness Interface: This is how code connects the agent to its task. It includes Code for Reasoning (externalizing logic into verifiable steps), Code for Acting (translating intent into executable policies or robot commands), and Code for Environment Modeling (using codebases and simulators to represent the world).
  2. Harness Mechanisms: These are the "internal organs" of the agent. The authors detail how code supports Planning (breaking down tasks), Memory (storing reusable skills and trajectories), and Control (the "Plan-Execute-Verify" loop that allows agents to self-correct).
  3. Scaling the Harness: This layer explores multi-agent systems (MAS). Here, code acts as a shared substrate—like a "blackboard" or a shared repository—allowing multiple specialized agents (e.g., a "Coder," a "Reviewer," and a "Tester") to coordinate and synchronize their beliefs about the task.
Figure 1: Taxonomy of code as agent harness.

Datasets

As a survey paper, it synthesizes results across dozens of benchmarks. Key datasets and environments mentioned include:

  • Software Engineering: SWE-bench (repository-level issue resolution).
  • General Agency: AgentBench (OS, databases, and games).
  • GUI/Web: WebArena and Mind2Web (interacting with browsers).
  • Scientific Discovery: DiscoveryBench and MLAgentBench.
  • Embodied AI: Voyager (Minecraft) and various robotic simulation environments.

The authors highlight a trend toward "executable evaluation environments" where success is measured by whether the code actually works in a sandbox, rather than just matching a text string.

Key Insights and Ideas

  • Code as a "Cybernetic Governor": The harness isn't just a wrapper; it’s a control layer. By using deterministic sensors (linters, unit tests, compilers), the harness regulates the agent's trajectory, deciding when to continue, when to backtrack, and when to ask a human for help.
  • The "Tax" of Implicit State: A major "aha moment" in the paper is the observation that systems lacking a formal, shared code substrate often develop overly complex communication topologies to compensate for agents being "out of sync."
  • Executability vs. Hallucination: Unlike natural language reasoning, code provides an objective "oracle" signal. If the code doesn't compile or the test fails, the agent has an unambiguous ground truth to learn from, bypassing the hallucination issues common in text-only models.
  • Evolution Agents: The paper introduces the concept of meta-agents that don't just solve tasks, but use "deep telemetry" (logs of costs, errors, and latencies) to optimize the harness itself—rewriting tool descriptions or adjusting memory policies to make future agents more efficient.
Figure 2: Overview of code as the harness interface, connecting agents to reasoning, action, and environment modeling through executable programs, tool calls, state tracking, and feedback traces.

Key Results

The paper synthesizes several high-impact findings from the field:

  • Performance Gains: Systems like AlphaCodium show that test-driven flow engineering can significantly outperform single-shot prompting in competitive programming.
  • Real-world Deployment: In production settings, agents like LingmaAgent are already resolving 16.9% of in-house software issues at Alibaba Cloud fully autonomously.
  • Simulated Execution: Surprisingly, some research (e.g., QualityFlow) shows that LLMs can "imagine" execution with 98%+ precision, suggesting that actual execution might only be necessary for the most complex corner cases.

Limitations and Future Work

The authors identify several "open problems" that define the next frontier:

  • Oracle Adequacy: Just because a test passes doesn't mean the code is correct or safe. We need better "verification stacks" that go beyond simple unit tests.
  • Semantic Conflict Resolution: In multi-agent systems, how do we handle two agents making incompatible changes to the same codebase? We need "transactional" shared states.
  • Human-in-the-Loop (HITL) Safety: As agents take more consequential actions (e.g., in finance or healthcare), the harness must include robust, auditable "permission tiers" that require human approval for high-risk operations.
  • Multimodal Grounding: Future harnesses must manage visual and tactile data as persistent, queryable state, not just passive input.
Overview of planning mechanisms for agent harnesses.

Summary updated

BibTeX
@misc{ning2026code,
  author = {Xuying Ning and Katherine Tieu and Dongqi Fu and Tianxin Wei and Zihao Li and Yuanchen Bei and Jiaru Zou and Mengting Ai and Zhining Liu and Ting-Wei Li and Lingjie Chen and Yanjun Zhao and Ke Yang and Bingxuan Li and Cheng Qian and Gaotang Li and Xiao Lin and Zhichen Zeng and Ruizhong Qiu and Sirui Chen and Yifan Sun and Xiyuan Yang and Ruida Wang and Rui Pan and Chenyuan Yang and Dylan Zhang and Liri Fang and Zikun Cui and Yang Cao and Pan Chen and Dorothy Sun and Ren Chen and Mahesh Srinivasan and Nipun Mathur and Yinglong Xia and Hong Li and Hong Yan and Pan Lu and Lingming Zhang and Tong Zhang and Hanghang Tong and Jingrui He},
  title = {{Code as Agent Harness}},
  year = {2026},
  eprint = {2605.18747},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.18747},
}
Figure