Architecting Coding Agents: The Eight-Level Ladder from Harness to Graph
A structured breakdown of autonomous coding agents explains how harnesses, evaluation loops, and execution graphs resolve failure modes across multi-step software tasks.

Many software teams building autonomous coding systems encounter a frustrating paradox: instead of saving time, developers spend their workdays babysitting the agent. When an agent generates code, the engineer manually tests it, copies error logs back into the prompt, and decides what step comes next. In practice, the human operator ends up serving as the environment, the verification mechanism, and the workflow director. Rather than viewing agent components as an arbitrary collection of disparate tools, engineering teams can structure agent architecture as an eight-tier progression across three core layers: the harness, the loop, and the graph.
The harness and the evaluation loop
The initial transition beyond raw chat interfaces begins with providing a harness—giving the model hands through file system access, terminal shells, git integration, and test runners. As Anthropic highlights in its agent design guidance, narrow, well-documented tool sets generally outperform dozens of overlapping interfaces. However, execution capabilities quickly encounter context drift and lack of discipline. Level 2 introduces persistent memory outside the model's context window—such as markdown progress files and git commits—alongside strict operational limits. Following security guidance from Microsoft, these walls must rely on least-privilege permissions, sandboxes, and command allow-lists rather than natural language instructions.
A capable harness does not guarantee correct results. That responsibility falls on the loop layer. A reliable loop relies on an evidence hierarchy where deterministic validations, like successful builds and exiting test suites, strictly outrank unverified model self-reports. Echoing the methodology of the SWE-bench benchmark, rigorous testing requires confirming that a reproduction test fails before applying the fix and passes afterward. When tests fail, Level 4 feeds structured diagnostic data back to the model: the exact divergence between expected and observed behavior, file locations, and previously failed attempts. This evaluator-optimizer approach allows the model to converge toward a resolution while terminating runs if budget limits are reached or duplicate outcomes occur.
Structuring workflows with graphs and failure gates
When individual units of work succeed reliably, bottlenecks shift to the boundaries between multi-step tasks. In a real-world scenario requiring a bug fix, cross-service audits, and documentation updates, running every subtask inside a single sequential context leads to compounding assumptions and slow execution. Implementing a graph layer—similar to the architecture provided by LangGraph—organizes tasks into discrete nodes, real dependency edges, and isolated shared state. Developers can apply an early-start test to every dependency: if a task does not strictly depend on the output of an earlier step, it can run concurrently rather than sequentially.
Level 6 incorporates selective recovery and risk-weighted gates into the graph. When an individual node fails, a checkpointed runtime freezes previously passed nodes as read-only, rerunning only the failed path with specific feedback. Furthermore, validation thresholds should mirror the cost of reversing an action. Isolated code edits or documentation can ship once deterministic checks pass. In contrast, actions lacking a clean undo—such as irreversible database migrations or external communications—require explicit human approval regardless of internal model confidence scores.
Layer-specific learning and avoiding recurring errors
The final maturity stage focuses on cross-run learning. When an agent repeats an identical failure across multiple tickets, adjusting the system prompt rarely produces durable fixes. Instead, lessons must be incorporated directly into the architectural layer responsible for the failure. If an agent lacks runtime visibility, the harness must add an inspection tool. If it repeats deprecated patterns, the external memory must record the restriction. If audit steps duplicate work, the graph's decomposition rules need revision. The ultimate objective is not eliminating failure entirely, but ensuring that recurring classes of errors cost significantly less on subsequent attempts.
What it means for developers
For engineering teams building autonomous pipelines, this architectural ladder offers a clear diagnostic framework:
- Target the earliest missing capability: Identify the first failure forcing manual intervention. If you spend time verifying claims of completion, your setup lacks a Level 3 deterministic check. If a localized error triggers an entire workflow restart, you need Level 6 selective recovery.
- Write validation checks before code generation: Drafting unambiguous passing criteria on paper clarifies required harness tools, persistent state boundaries, and approval gates before runtime execution.
- Avoid over-orchestration: Not every use case requires graph coordination or cross-run learning; bounded tasks often perform reliably with a well-isolated Level 4 loop.
- Benchmark models across your pipeline: As agent setups evolve through loops and tool environments, developers can try top AI models cheaply through one API at https://apixoai.online to determine how different LLM backends handle tool selection and structured feedback.
Source: Harness, Loops, Graphs: What Each Layer Fixes and What It Breaks — Towards AI. Written by the Apixo team from that report.
One key for Claude, GPT, GLM, DeepSeek and more. Pay per token with crypto.
Get your API key

