Skip to content

Agent security 101, lesson 4

Runaway bills and loops

An agent that doesn't stop keeps spending: on every turn, every paid tool and every server it starts. This lesson shows how a small loop becomes a big bill, and the stops to set before anything runs on its own.

What do you run?

Every example below changes to fit what you pick. The businesses are made up for teaching.

The picture, one step at a time

Each box is one stage. The picture lights up as you scroll.

Step 1 of 6

A normal job is a short loop

An agent works in a loop: try something, check the result, try again, until the job is done. For answering customers, a normal job might take ten turns. Every turn is paid for, but ten turns cost very little.

Example numbers, made up for teaching: if one turn costs 2p, a ten-turn job costs 20p.

Step 2 of 6

Sometimes it does not stop

A tool keeps failing and the agent keeps retrying. Two agents reply to each other. Or it never decides the job is good enough. Nothing inside the loop says "enough", so it carries on, at night and over the weekend, when nobody is looking.

Step 3 of 6

Every turn costs something

Each turn costs a little. Some tools charge per use. Some agents can start servers, which charge by the hour until someone turns them off. Small costs, repeated thousands of times, become a real bill.

Example numbers, made up for teaching: stuck overnight, a turn every 6 seconds for 8 hours is 4,800 turns. At 2p a turn, that is £96. A server at £3 an hour, left on over a 72-hour weekend, is £216. Ten of them is £2,160.

Which is most likely to turn a small mistake into a big bill?

Step 4 of 6

Put limits inside the job

Give every job a step limit (stop after, say, 30 turns) and a time limit (stop after, say, 20 minutes). Anything the agent starts, such as a server, gets an end time too. When a limit is hit, the agent stops and tells a person, rather than trying again.

Step 5 of 6

A cap at the provider, and an alert you will see

Limits inside the job only work if the job works. So set a monthly spend cap in your AI provider's billing settings, as the last line. Then set an alert well below it, sent to a phone someone actually looks at.

Check what your cap does. On some accounts a budget only sends an alert and does not stop the spending, and the alert can arrive hours late. If yours only warns, you still need a stop button.

Step 6 of 6

A stop button anyone can press

Write down, in one place the whole team can find, how to stop your agent for answering customers: which switch, on which page, with which login. Then try it once, on a quiet day, so the first time is not at 2am.

The agent goes wrong at 2am and the person who set it up is asleep. What do you want to be true?

Which stop catches it?

Here are four things going wrong in your business. Pick the stop that would catch each one first.

  1. 1The support agent replies to a customer's out-of-office message, which replies back, and the two go round all night.

  2. 2The key that lets your agent use the AI provider is pasted into a public page by mistake, and strangers start using it.

  3. 3The agent is asked to write 40 product descriptions. Three hours later it is still going.

  4. 4You see on your phone that the agent is emailing the same customer again and again.

0 of 4 right so far, 4 to go.

Spend caps and a stop button

This is what you keep: the stops to set on every agent before it runs on its own. Most take a few minutes.

Spend caps and a stop button

  1. A step limit on every job: it stops after a set number of turns and tells a person.
  2. A time limit on every job, and an end time on anything it starts, such as a server.
  3. A monthly spend cap at the provider, as the last line when everything else fails.
  4. An alert set well below the cap, sent to a phone someone looks at.
  5. Check whether your cap stops spending or only warns. If it only warns, the stop button matters more.
  6. A stop button: written down, easy to find, tried once, and open to anyone on the team.

Nothing runs on its own until you know how it stops, and who can stop it.

Next: Lesson 5: plug-ins you didn't write. How to check a connector, plug-in or skill before you install it.