代码即智能体框架
Code as Agent Harness
May 18, 2026
作者: 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 He
cs.AI
摘要
近年来的大语言模型(LLMs)在代码理解与生成方面展现出强大能力,涵盖从竞赛编程到仓库级软件工程等场景。在新兴的智能体系统中,代码不再仅仅是目标输出,它逐渐成为智能体进行推理、行动、环境建模以及基于执行的验证的操作基底。我们通过智能体框架(agent harness)的视角来框定这一转变,并提出"代码即智能体框架"(code as agent harness)这一统一观点,将代码定位为智能体基础设施的基础。为了系统性地研究这一视角,我们围绕三个相互关联的层次组织本综述。首先,研究框架接口(harness interface),即代码如何连接智能体的推理、行动与环境建模。其次,考察框架机制(harness mechanisms):用于长周期执行的规划、记忆与工具使用,以及使框架可靠且自适应的反馈驱动控制与优化。第三,讨论如何将框架从单智能体系统扩展到多智能体场景,在此类场景中,共享的代码工件支持多智能体的协调、审查与验证。跨这些层次,我们总结了以代码为智能体框架的代表性方法与实际应用,涵盖编码助手、GUI/OS自动化、具身智能体、科学发现、个性化与推荐、DevOps以及企业工作流。我们进一步概述了框架工程面临的开放挑战,包括超越最终任务成功的评估、不完整反馈下的验证、无回归的框架改进、多智能体间一致共享状态、安全关键行动中的人类监督,以及向多模态环境的扩展。通过将代码定位为智能体AI的框架,本综述为构建可执行、可验证且具有状态性的AI智能体系统提供了统一路线图。
English
Recent large language models (LLMs) have demonstrated strong capabilities in understanding and generating code, from competitive programming to repository-level software engineering. In emerging agentic systems, code is no longer only a target output. It increasingly serves as an operational substrate for agent reasoning, acting, environment modeling, and execution-based verification. We frame this shift through the lens of agent harnesses and introduce code as agent harness: a unified view that centers code as the basis for agent infrastructure. To systematically study this perspective, we organize the survey around three connected layers. First, we study the harness interface, where code connects agents to reasoning, action, and environment modeling. Second, we examine harness mechanisms: planning, memory, and tool use for long-horizon execution, together with feedback-driven control and optimization that make harness reliable and adaptive. Third, we discuss scaling the harness from single-agent systems to multi-agent settings, where shared code artifacts support multi-agent coordination, review, and verification. Across these layers, we summarize representative methods and practical applications of code as agent harness, spanning coding assistants, GUI/OS automation, embodied agents, scientific discovery, personalization and recommendation, DevOps, and enterprise workflows. We further outline open challenges for harness engineering, including evaluation beyond final task success, verification under incomplete feedback, regression-free harness improvement, consistent shared state across multiple agents, human oversight for safety-critical actions, and extensions to multimodal environments. By centering code as the harness of agentic AI, this survey provides a unified roadmap toward executable, verifiable, and stateful AI agent systems.