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.
翻译:近期的大语言模型(LLMs)在代码理解与生成方面展现出强大能力,涵盖从竞赛编程到仓库级软件工程等场景。在新兴的智能体系统中,代码已不再仅是目标输出,而是日益成为智能体推理、行动、环境建模及基于执行的验证的操作基础。我们从智能体框架视角审视这一转变,提出"代码即智能体框架"的统一观点,将代码定位为智能体基础设施的核心。为系统研究这一视角,本文围绕三个关联层次展开综述。首先研究框架接口层,其中代码连接智能体与推理、行动及环境建模。其次探讨框架机制层:面向长周期执行的规划、记忆与工具使用,以及使框架可靠且自适应的反馈驱动控制与优化。第三讨论框架扩展层,从单智能体系统扩展至多智能体环境,其中共享代码构件支撑多智能体协调、审查与验证。跨层次梳理代码作为智能体框架的代表性方法与实际应用,涵盖编程助手、图形用户界面/操作系统自动化、具身智能体、科学发现、个性化推荐、开发运维及企业工作流。进一步提出框架工程面临的开放挑战,包括超越最终任务成功率的评估、不完整反馈下的验证、无衰退的框架优化、多智能体间一致共享状态、面向安全关键行动的人类监督,以及向多模态环境的扩展。通过将代码定位为智能体人工智能的框架,本综述为构建可执行、可验证、有状态的智能体系统提供了统一路线图。