Skip to course content
Free agentic AI fundamentals course

Introduction to Agentic AI and Workflow Automation

Unit 02.02: The stopping rule everyone forgets

A task with a goal and no ceiling ends when something outside your design ends it.

Four conditions, one of which is success

Goal reached, step ceiling, time ceiling, action ceiling. Each catches a shape the others miss.

The example below runs a loop until one of them fires.

step 1: 0.9 min
step 2: 1.8 min
step 3: 2.7 min
step 4: 3.6 min
step 5: 4.5 min
step 6: 5.4 min  STOP -- time ceiling (5 min)

ended by: time ceiling (5 min)

The action ceiling is the one specific to agents that act. A run can be cheap in steps and tokens and still perform three irreversible actions, which is the failure that costs most - so bounding actions separately from steps is not redundancy.

Note that success is checked first. A run that reaches its goal on the final permitted step should report success rather than exhaustion, and getting that order backwards is easy.

The mistake this prevents

The mistake is relying on a single wall-clock timeout. It has to be generous enough for the slowest legitimate run, which makes it useless for catching a loop that starts early - and it tells you nothing about why the run ended.

Takeaway

Bound steps, time and actions independently, check success before the ceilings, and record which one fired. Actions need their own ceiling because they are the expensive failure.