Code as Agent Harness: Why Code Is Becoming the Execution Layer of AI Agents
Code is no longer just something AI agents generate. It is increasingly becoming the execution layer through which they reason, act, manage state, use tools, and verify their own work.
That distinction matters.
A model can decide what it wants to do, but long-running agents still need a structured way to turn those decisions into actions. They need to call tools, execute code, preserve intermediate state, inspect results, recover from failures, and coordinate work across multiple steps.
The paper frames code itself as that harness.
Instead of treating planning, memory, tool use, and execution as separate pieces of infrastructure, code becomes the common interface connecting the model to all of them.
The paper breaks this into three layers:
• Harness interface: code connects the agent to reasoning, actions, and the environment it is operating in
• Harness mechanisms: planning, memory, tool use, execution feedback, and optimization keep long-running tasks reliable
• Multi-agent harness: shared code artifacts become a way for multiple agents to coordinate, review each other's work, and verify results
This applies well beyond coding agents.
The paper covers GUI and OS automation, scientific discovery, embodied agents, DevOps, personalization, enterprise workflows, and other systems where agents need to interact with an environment rather than simply generate text.
The interesting part is how this changes the role of code in AI systems.
Code used to be primarily an output of the model. Now it can also represent the agent's plan, tools, state, interaction with the environment, and even the mechanism used to verify whether an action actually worked.
That makes harness engineering a much bigger part of building reliable agents than simply wrapping an LLM with a few tool calls.
I've shared the paper in the comments!
Code as Agent Harness: Why Code Is Becoming the Execution Layer of AI Agents
Code is no longer just something AI agents generate.
Increasingly, it can serve as an operational medium through which agents reason, act, interact with environments, maintain state, use tools, execute tasks, and verify results.
That distinction matters.
An LLM can decide what it wants to do, but long-running agents need infrastructure that can turn those decisions into actual actions. They need to call tools, execute code, maintain intermediate state, observe feedback, recover from failures, and coordinate multiple steps.
The paper “Code as Agent Harness” frames code as an important part of this infrastructure.
Rather than viewing planning, memory, tool use, execution, and verification as completely separate components, the paper presents code as a common operational medium connecting these capabilities within agent systems.
The paper organizes this perspective into three connected layers:
• Harness interface: Code connects the agent with reasoning, actions, and representations of the environment.
• Harness mechanisms: Planning, memory, tool use, execution feedback, and optimization support reliable long-horizon agent behavior.
• Scaling the harness: In multi-agent systems, shared code artifacts can support coordination, review, state sharing, and verification.
The idea applies beyond coding assistants.
The survey discusses applications including GUI and OS automation, scientific discovery, embodied agents, personalization and recommendation, DevOps, and enterprise workflows.
The interesting shift is in how we think about code in AI systems.
Code is not only an output generated by a model. It can also become an executable and inspectable medium for representing actions, interacting with environments, maintaining state, incorporating feedback, and verifying progress.
This makes harness engineering an increasingly important part of building reliable agentic systems—not simply wrapping an LLM with a few tool calls.
The bigger question is no longer just:
“What code can the AI generate?”
It is increasingly:
“How can code help the AI execute, verify, remember, and improve what it is trying to accomplish?”
I’ve shared the paper in the comments.