Agent harness

OpenAI Codex agentic harness working under the hood with the Tauri (software framework) DOM Inspector

An agent harness, also known as agent scaffolding, is the software infrastructure surrounding a large language model (LLM) that enables it to operate as an AI agent. It manages tool use, memory, state persistence, execution environments and feedback loops, as opposed to the model's internal reasoning. The UK's AI Security Institute described an AI agent as being formed by the model plus the scaffolding back in 2023. The relationship can be expressed as agent = model + harness.

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.