← All tutorials
Harness · Loop · Graph

Harness vs loop vs graph engineer

Three mindsets for building AI-agent systems — and they differ on one axis: how much structure you impose versus how much you let the model drive. A graph engineer hand-draws the workflow; a loop engineer designs the iteration and its stop; a harness engineer builds the model's environment and gets out of the way.

Graph— you draw the flow — Loop— you set the cycle — Harness— the model drives —
Not rival camps — a dial. The same engineer moves along this dial per task: impose more structure when you need guarantees, less when you want the model's full capability. Most real systems blend all three.

The axis  The control ↔ autonomy spectrum

Each role sits at a different point between you controlling the flow and the model controlling it:

Graph, loop and harness on the control-versus-autonomy spectrum Graph engineering imposes the most structure with the model having least autonomy; loop engineering is in the middle; harness engineering imposes least structure and gives the model the most autonomy. 🗺️ Graph explicit nodes & edges 🔁 Loop iterate to a stop 🛠️ Harness environment + tools you control · high structure · deterministic model controls · high autonomy
Golden rule: impose the least structure that still gives you the control and guarantees the task needs. More structure buys predictability; less unlocks the model's capability.

Most structure  The graph engineer

🗺️ Graph engineer explicit nodes · edges · state

Builds The agent as an explicit graph: nodes (steps), edges (control flow, including branches and cycles), and a shared state object. You decide every route; the model fills in the steps you allow.

Best for Well-understood, structured, high-stakes or compliance-bound flows where you must guarantee the path — and where determinism and debuggability matter most.

Trade-off Rigid and more to build; struggles with the unexpected; gives the model the least autonomy. Tooling: LangGraph (see agent kits).

Some structure  The loop engineer

🔁 Loop engineer trigger · cycle · stop

Builds The agentic loop: a trigger, what happens each cycle (reason → act → observe), and the stop criteria. The model iterates on its own until "done." Control lives in the loop's shape and its stopping conditions — not in the route.

Best for Open-ended tasks with a measurable stop ("make the tests pass", "until no new items") — where the number of steps can't be predicted.

Trade-off Less predictable than a graph; needs solid stop criteria, turn caps and guardrails to avoid runaway. Tooling: the agent loop & goal/loop primitives (see Getting started with loops).

Least structure  The harness engineer

🛠️ Harness engineer environment · tools · context · verification

Builds The environment around the model — context management (what it sees), tools, permissions, feedback and verification — then lets the model drive autonomously. The bet: a great harness + a capable model beats hand-coded control flow.

Best for Broad, open-ended, evolving work where you want the model's full capability — coding agents, research, general assistants. It's the frontier: context engineering and harness design.

Trade-off Least predictable and hardest to constrain; leans heavily on model quality and strong verification. Tooling: agent SDKs and Claude Code-style harnesses.

Why the harness bet keeps winning — the "bitter lesson"

Rich Sutton's bitter lesson: over time, general methods that scale with compute and data beat hand-crafted structure. Applied to agents: as models get more capable, elaborate hand-drawn control flow becomes a ceiling. A thin, powerful harness — great context, tools and verification — lets a strong model do more than any graph you could draw. So effort shifts from encoding logic toward shaping the model's environment.

Side by side

🗺️ Graph🔁 Loop🛠️ Harness
You controlThe exact routeThe cycle & stopThe environment
Model autonomyLowMediumHigh
DeterminismHighMediumLow
You buildNodes, edges, stateTrigger, cycle, stop criteriaContext, tools, verification, permissions
ToolingLangGraphAgent loop · /goal · /loopAgent SDKs · Claude Code harness
Best forKnown, high-stakes flowsOpen-ended w/ clear stopGeneral, capable agents
Main riskRigidityRunaway / loose stopUnpredictability

In reality  They compose — and the trend

These nest. A production system is often a harness that contains loops, some of which run small graphs for the parts that must be deterministic:

Harnesscontains Loopswhich run Graphs (for must-be-exact steps)

The direction of travel: as models get more capable, engineering effort shifts rightward — from drawing graphs, to shaping loops, to engineering harnesses and context. You hand more to the model and spend your effort on giving it a great environment and verifying its work.

How to choose today. Need a guaranteed path (money, compliance)? Put that part in a graph. Open-ended with a clear "done"? A loop. Broad and capability-bound by the model? Invest in the harness — and always pair autonomy with verification.

Cheat sheet

QuestionShort answer
The one axis?How much structure you impose vs how much the model drives.
Graph engineer builds…Explicit nodes/edges/state — you control the route (LangGraph).
Loop engineer builds…The trigger, cycle and stop — the model iterates until done.
Harness engineer builds…The environment: context, tools, verification — the model drives.
Which is most deterministic?Graph. Most autonomous? Harness.
How do they relate?They compose (harness ⊃ loops ⊃ graphs); effort trends toward harness as models improve.

Knowledge check

Six questions on the three mindsets. Pick an answer for each, then check your score.

1. What single axis separates the three roles?

2. A graph engineer primarily builds…

3. A loop engineer's control lives mainly in…

4. A harness engineer's bet is that…

5. Which is most deterministic, and which most autonomous?

6. How do the three relate in practice?

Next steps

🔄 Getting started with loops

Loop engineering — the middle of the spectrum in depth.

🧰 Agent Development Kits

LangGraph & friends — the graph engineer's toolbox.

🔁 Anthropic architectures

Workflows vs agents — the same control-vs-autonomy idea.

📓 All tutorials

The hub — LLMs, agents, protocols, cloud & more.