Stage 4 · Assumes you can code · Harnesses & Orchestration
Control Loops & State Machines
How harnesses structure repeated model calls into coherent programs.
At the heart of most agentic harnesses is a control loop: call the model, inspect its output, decide what to do (call a tool, ask the user, stop), then loop again with updated context.
More complex harnesses model this explicitly as a state machine: defined states (e.g. "planning", "executing", "waiting for approval") with rules for transitioning between them. This makes behavior more predictable and easier to debug than an unstructured loop — at any point you can point to exactly which state the agent is in and which transitions are even possible from there.