Lably
Skip to content

Agent harness

Digital technology which directs AI models to perform tasks

  • 3 min read
  • 3 chapters

Related on Lably

Through Large language model, Sandbox (computer security) and Reinforcement learning

Because an LLM is stateless, unaided, and produces only text, the harness is what allows a model to take actions over multiple steps, use external tools, and sustain a long-running task across sessions. Rather than repeatedly re-reading an ever-growing transcript inside the context window, a harness can offload record-keeping into a structured software environment that manages the agent's state. A minimal harness is unnecessary for a single prompt-and-response exchange, but becomes important as tasks grow multi-step, tool-oriented, or long-running.

Popular agent harnesses are focused on AI-assisted software development, including Anthropic's Claude Code, OpenAI's Codex, Google DeepMind's Antigravity, and SpaceXAI's Cursor. China's Qwen, DeepSeek, Kimi, and GLM models are also offered with official harnesses.

Architecture

The mechanisms that a harness coordinates predate the term. The pattern of a model alternating between reasoning and acting in a loop was introduced in the peer-reviewed ReAct framework, and the ability of a model to call external tools was demonstrated in Toolformer.

Components commonly grouped under a harness include tool dispatch, memory and state persistence, an isolated sandbox or workspace, context management, and guardrails such as scoped permissions, approval tiers and monitoring. In a 2026 engineering write-up, Anthropic described a worked example built from an initialiser agent that prepares the environment and a coding agent that repeatedly selects the next unfinished task, commits, and updates a progress record before stopping.

Birgitta Böckeler of Thoughtworks distinguishes an inner harness shipped by the model's builder (for example an agent SDK or a coding tool such as Cursor or Codex) from an outer harness that the user assembles on top, such as instruction files, Model Context Protocol servers and custom skills. She further separates guides, which steer the agent before it acts, from sensors, which observe the result and let the agent self-correct; each may be computational (deterministic checks such as linters or tests) or inferential (semantic checks such as an "LLM as judge").

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Computing and communication