quiet robot

Agent Playground

Recipe: Runaway loop

Retries something that will never work. A guard stops it and rewinds the sandbox to the last good checkpoint. What it does, when to use it, how to make it yours, and what a run costs.

View as Markdown

Retries something that will never work, on purpose, so you can see what a limit does: the loop limit stops the run, and the sandbox goes back to its last good checkpoint.

At a glanceNotes
CategorySafety
ShapeA limit stops it
PlanFree and up
Needs a Claude keyNo
Limits it comes with4 loops, 120 seconds, $0.05
Runaway loop, as it is on the canvas.Start (Run command), Try again (Run command), Check (Run command), Done (Output). Arrows: Start to Try again; Try again to Check; Check to Try again on Failed; Check to Done on Passed.FailedPassed>_ RUN COMMANDStartgo back here>_ RUN COMMANDTry again>_ RUN COMMANDCheck⚑ OUTPUTDone
Runaway loop, as it is on the canvas.
The Runaway loop recipe in the builder after a run, with each step's result on the canvas and the run's steps listed on the right.
A real run of the recipe. The panel on the right lists every step with what it printed.

When to use it

  • You're new to the Playground and want to know what happens when something goes wrong.
  • You're choosing limits for your own flows and want to see one in action.
  • Showing a teammate why every loop needs a limit.

Run it

  1. Open Agent Playground in the dashboard and find Runaway loop under Start from a recipe. In the builder, Recipes in the toolbar lists them too.
  2. Choose Use this recipe. It becomes a flow of your own, so changing it never changes the recipe.
  3. Choose Simulate to see the forecast, then Run.

What you'll see: The loop goes round four times, then the run ends as Stopped at a limit, with the loop limit named as the reason. The sandbox is rewound to the checkpoint after Start, so none of the half-finished attempts are left behind. Simulate says it before you run: nearly every run will hit the loop limit.

Make it yours

This recipe is for learning, not for changing. In your own flows:

  • Give every loop a limit you'd be happy to hit.
  • Tick Go back here if a limit stops the run (under Advanced) on the last step that leaves things clean.
  • Run Simulate before you run, and raise the limit or fix the failing step if the forecast says the limit will often stop the run.

What a run costs

These are the builder's own forecast for the recipe as it comes, with its limits, rounded. Simulate shows the same numbers for your version, and they change as you change the flow.

NotesTypical1 in 10 runsAt most
Sandbox time$0.0002$0.0002$0.0015
How long it takes14 seconds16 seconds120 seconds

A typical run uses $0.0002 of sandbox time, so about 5,500 runs cost $1, and every plan includes $5 of usage a month. At most is the most a run could cost with these limits: it stops at $0.05 or 120 seconds, whichever comes first.

  • Agent PlaygroundQuickstart: build and run your first flow
  • Agent PlaygroundBlocks
  • Agent PlaygroundRecipes
  • SandboxesQuickstart: your first sandbox
  • SandboxesMCP server
  • SandboxesAPI reference