Guardrails: limits, stop conditions, and progress checks
The three controls that turn a risky loop into a dependable one.
Good agent design is really loop design. The three failure modes from the last lesson each have a matching guardrail, and together they turn an unpredictable loop into a dependable one. You do not need to code these to understand them — and knowing them helps you judge any agent tool you use.
1. A step limit (the safety net for runaway cost and infinite loops). Cap the number of times the loop may run: "stop after at most 15 steps." This guarantees the loop always ends, even if something goes wrong. It is the simplest and most important guardrail — a loop with no maximum is a loop that can run forever. When a step limit is hit, a well-built agent stops and reports where it got to, rather than silently spinning.
2. A clear stop condition (the cure for wandering). Define, in advance, what done looks like so the agent can check it: "stop when all tests pass," "stop when you have three sources that agree," "stop when the form is submitted successfully." A loop with a checkable definition of success knows when to quit; a loop without one keeps finding more to do. The clearer the stop condition, the less the agent drifts. This is where the crisp goal from Module 1 pays off directly.
3. No-progress detection (the cure for repeating). Watch for the loop making no headway: "if the last three attempts changed nothing, stop and ask for help instead of trying again." This breaks the agent out of banging on the same locked door. Detecting "I am not getting anywhere" and escalating to a human is far better than looping uselessly.
How they work together. A well-designed loop has all three: it cannot run past its step limit, it knows when it has succeeded, and it notices when it is stuck. With those in place, the worst case is not a runaway disaster — it is an agent that stops early and tells you it needs help. That is exactly the behavior you want.
Judging tools by this. When you evaluate an agent product, these guardrails are a maturity signal. Does it show its steps? Can you set a limit? Does it stop and ask when stuck, or spin silently? A tool that surfaces and controls the loop is more trustworthy than one that hides it.
Recap. Each failure mode has a guardrail: a step limit caps iterations so the loop always ends (curbing runaway cost and infinite loops); a clear, checkable stop condition tells the agent when it is done (curing wandering); and no-progress detection makes it stop and ask for help instead of repeating a failed action. Together they mean the worst case is an agent that halts early and asks for help, not a runaway. These controls are also how you judge whether an agent tool is built responsibly.
Write the three guardrails for your task from the last lesson: a sensible STEP LIMIT (roughly how many actions should this ever take?), a checkable STOP CONDITION (how does the agent know it succeeded?), and a NO-PROGRESS rule (when should it give up and ask you?). These three sentences are the core of a reliable agent design.
Enjoying the free lessons? Get an email when we publish new courses and updates — no spam, unsubscribe anytime.
Discussion (0)
Ask a question or share what worked for you. Comments are reviewed before they appear.
No comments yet. Be the first to start the discussion!