Turns 4–6: recovery, resolution, stop

Lesson 4 of 5 in Anatomy of a Real Agent: One Run, Every Part Named.

Turn 4 is the run’s moment of real consequence, and it shows the same policy being checked twice, by two different kinds of machine. The model checked it in its reasoning: carrier confirms loss, $89.50 is under the threshold. That check is probabilistic — it will be right nearly always. Then the runtime checked amount ≤ 100 in plain code, and that check is right always. The model’s check makes the agent behave well; the runtime’s check makes the system safe when it doesn’t. Neither replaces the other — this is defense in depth, and you met the principle back in lesson one.

Notice, too, what the gate does not evaluate: the model’s reasons. A gate that trusted stated justifications would be a gate an injected instruction could talk its way through. The gate reads arguments, not arguments-for.

And that is a stop. Nothing announced it: the model simply produced a message containing no tool call, and the runtime recognised that as the natural stopping condition. Every run ends in one of three ways — the model decides it is done (this run), a budget runs out (the 10-call cap, the clock), or the runtime halts it (a failed gate, a kill switch, an unrecoverable error). Designing an agent means making sure the first kind is common, and the other two are possible.

One more detail rewards attention: the final message. It resolves the issue, states the number the tools reported (not an invented one), respects the one-apology rule, and turns the customer’s Friday deadline — mentioned once, five turns ago — into a useful offer. Held context, not magic.

Be the runtime: gate this tool call?

Interactive decision tree — outcomes:

  • Execute, log, move on

    Reads carry privacy risk but no side effects — gating every lookup_order would add friction with no safety return. Log it and let it run.

  • Execute with an audit trail

    Reversible writes like close_ticket usually run ungated but fully logged — if the model closes a ticket prematurely, the fix is a reopen, not an incident.

  • Auto-approve — this is turn 4

    The code check passed, so the refund executes without a human. The threshold is the product decision; enforcing it in the runtime is the engineering decision. Both were made before the run started.

  • Hold for human approval

    Above the threshold, the runtime parks the call and a human approves or rejects — human-in-the-loop applied exactly where blast radius justifies the latency.

  • You just built a prompt-deep control

    The model’s policy reasoning is probably right — and "probably" is not a control. On the run where the model misreads the amount, or an injected instruction supplies the reasoning, nothing stands between the text and the money. Gates read arguments, not the model’s stated justification.

Interactive checkpoint quiz (2 questions) — open this page in a browser to take it.