Agent Loops & the Harness
17 questionsDONEUNLOCKEDLOCKED
Agent Loop & Harness Interview Questions
The loop at the centre of every agent: call the model, dispatch the tools it asks for, feed the results back, decide when to stop. When a fixed workflow beats an agent, what the harness owns that the model never should, and how to read a run that went wrong.
Worked answers that trace the run, put each decision on the right side of the authority line, and end with the follow-ups and scoring a panel applies.
You have 5 free answers unlocked here.Sign in free for 1 more · 11 are premium.
01–07Foundationsthe mechanisms behind this topic, and the terms a panel uses for them0/7 done
08–13Core questionsthe questions this topic is most often tested on, with full worked answers0/6 done
14–17Field scenariosopen-ended designs, incidents and trade-offs where you must state what is missing0/4 done
The concepts behind Agent Loops & the Harness
Lessons behind these answers. The opening lessons are free; deeper ones are Premium.
Foundational
The Agent LoopAn agent is a loop: the harness sends the model the conversation and the tool definitions, the model answers or asks for tool calls, the harness runs those calls and appends their results, and the loop repeats until something stops it. The model proposes every step; the harness executes every step and owns every exit.Foundational
Workflows and AgentsIn a workflow, code decides the sequence of steps and the model performs some of them. In an agent, the model decides the next step at run time. Agency buys adaptability and costs tokens, latency, variance and test surface, so the strongest designs keep a deterministic spine and give the model only the decisions that depend on what it discovers.Foundational
Stop Conditions and BudgetsA run should end for a reason the harness can name: a verified answer, a spent budget, a refused action, an unrecoverable failure or a human taking over. Budgets for steps, tokens, wall-clock time, money and per-tool calls are counted and enforced by the harness, set from the distribution of successful runs, and keep a reserve so a stopped run can still hand back a useful partial result.Core
The Harness and the Authority LineThe harness is everything wrapped around the model: context assembly, the tool registry, argument validation, authorization, execution, error translation, retries, budgets, state, tracing, human handoff and the stop decision. The authority line separates what the model may propose from what the harness will execute. Model output is untrusted input; identity, permissions and limits come from the harness, never from the model's arguments.Sign in
Advanced
Reading a TraceDebugging an agent means reading its trace: the ordered record of every model call and tool call with their inputs, outputs, timings and usage. Find the first step that went wrong, reconstruct exactly what the model saw at that step, classify where the failure entered (tool contract, context, plan, runtime or input), fix it at that location, and turn the run into a regression case. A trace is only useful if it records enough to replay a step.🔒 Premium
Advanced
Stuck-Loop Detectors: Repeats, Cycles and No ProgressA step limit catches a stuck agent at the step limit, after the budget is mostly spent. A stuck-loop detector catches it within a few calls, by watching the sequence of tool calls for a repeating pattern. Three details make it useful rather than noisy. Calls are normalised before comparison, so a changed request id or a reworded argument still counts as the same call. The detector looks for a period, not only an exact repeat, so an agent alternating between two calls is caught as well as one repeating a single call. And a repeating pattern counts as stuck only when the results repeat too: an agent polling a job whose state changes is working, not stuck. The detector's output is an action, not a flag. The first detection sends the model a short note with the evidence, because models often recover when told what they are doing; the second ends the run with a named exit the caller can count.🔒 Premium
Unlock all 17 answers · $25
All 19 topics with every worked answer, all lessons and courses, the full practice bank, and anything new that appears during your access.
6 months · One payment · No auto-renewal