AI for small business · 12 November 2026 · 4 min read

Stop runaway AI: limits on steps, time and spend

Key takeaways

Short version: give every AI agent hard limits on how many steps it may take, how long it may run and how much it may spend, and set them in the code that runs it, not in its instructions. When it hits a limit, it should stop, say what it was doing and hand the job to a person. It should never quietly try again.

What runaway AI looks like in a small business

An AI agent is an AI that works through a job in steps: read the message, look something up, decide, do the next thing. Most of the time it finishes in a handful of steps. Occasionally it doesn’t.

Nothing dramatic happens. It just keeps going, using up time and paid usage, and sometimes sending the same customer the same message more than once.

AI agent guardrails that actually hold

The tempting fix is a line in the instructions: “Don’t take more than ten steps.” That isn’t a limit. It’s a request, and an agent stuck in a loop is exactly the kind of agent that loses track of requests.

A real limit lives outside the AI, in the code or the automation tool that runs it. It counts the steps itself and stops the agent when the count is reached, whatever the agent thinks about it. The same idea runs through Customer messages are data, not instructions: what you rely on should be built in, not asked for.

Which AI agent limits should you set?

You don’t need the perfect settings on day one. Start tight, watch what normal jobs need for a couple of weeks, then adjust.

When an agent stops due to max iterations

Many automation tools show a message along the lines of “agent stopped due to max iterations”. It means the agent hit its step limit before finishing. That’s the limit doing its job, not the tool being broken.

What matters is what happens next. A good set-up does three things:

What it must not do is retry automatically. A job that ran out of steps once will often run out again, and an automatic retry turns one stuck job into a loop of them.

How to stop an AI agent getting stuck in a loop

Say you sell garden planters online and an agent answers delivery questions overnight. With a step cap, a time cap, a daily spend cap and a repeat limit in place, the worst a stuck job can do is stop and wait for you in the morning. That’s a much better start to the day than finding one customer has had the same email a dozen times.

Want to see which jobs in your business are worth handing to AI, and which aren’t? Grafto’s AI Tools Report works it out from a short questionnaire.

Frequently asked questions

What are AI agent guardrails?

Rules built into the system around an AI agent that it can’t talk its way past: which tools it has, how many steps it may take, how long it may run and how much it may spend. Instructions in the prompt are requests, not guardrails.

What does agent stopped due to max iterations mean?

The agent hit its step limit before finishing the job. That’s the limit working. The job should go to a person with a note of what the agent was doing, rather than being retried automatically.

How do I stop an AI agent getting stuck in an infinite loop?

Cap its steps and running time in code, stop your own automations replying to each other, limit how many messages one customer can receive in a short period, and give the agent an easy way to hand over to a person.

Questions, or want a tool we don't have yet? Email hello@grafto.co.uk — a real person replies.