# LLM-as-Code: Agentic Programming for Agent Harness

Source: [LLM-as-Code: Agentic Programming for Agent Harness](<https://www.sota2.com/research/paper/6a30d8a7d33dfb23e783cd12>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2026-06-24T05:00:31.418Z

Authors: Junjia Qi, Zichuan Fu, Jingtong Gao, Wenlin Zhang, Hanyu Yan, Xian Wu, Xiangyu Zhao

Published: 2026-06-14T15:47:27.000Z

## Abstract

Every major LLM agent framework gives the LLM the role of orchestrator; the model decides what to do next, when to call tools, and when to stop. We argue that token explosion, control-flow hallucination, and unreliable completion are not implementation bugs but architectural consequences of assigning the deterministic work of looping, branching, and sequencing to a probabilistic system. A better prompt or a stronger model cannot guarantee the reliability of the LLM agent. We therefore propose Agentic Programming, in which the program governs all control flow, and the LLM is itself part of it, an adaptive component we call LLM-as-Code and invoke only where a task calls for reasoning or generation. Within each call the model keeps full flexibility, but it cannot alter the program's execution path. With control in the program, the LLM's context is built from the execution history's call tree and forms a directed acyclic graph (DAG). Each call's context length is then determined by its call depth rather than by accumulation over steps. A case study of computer-use agents shows that the design is practical, not just a theoretical stance, substantially improving the stability of long visual operation sequences.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [GUI Automation on OSWorld](<https://www.sota2.com/research/sota/gui-automation-on-osworld.md>): GUI Automation; OSWorld; Overall Success Rate: 86.8.

- [GUI Automation on OSWorld overall](<https://www.sota2.com/research/sota/gui-automation-on-osworld-overall.md>): GUI Automation; OSWorld overall; Overall Success Rate: 86.8.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2606.15874>)

[PDF](<https://arxiv.org/pdf/2606.15874.pdf>)
