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.
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 glance | Notes |
|---|---|
| Category | Safety |
| Shape | A limit stops it |
| Plan | Free and up |
| Needs a Claude key | No |
| Limits it comes with | 4 loops, 120 seconds, $0.05 |
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
- 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.
- Choose Use this recipe. It becomes a flow of your own, so changing it never changes the recipe.
- 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.
| Notes | Typical | 1 in 10 runs | At most |
|---|---|---|---|
| Sandbox time | $0.0002 | $0.0002 | $0.0015 |
| How long it takes | 14 seconds | 16 seconds | 120 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.