Skip to content
be-human.ai
← Back to the journal

Testing & reliability

AI Agent Timeout Settings: Stop Runaway Work and Hand It to a Person

Set timeout, step and cost limits for AI agent runs, define a clean stop state, and route unfinished work to a named person with a clear handoff.

Be Human typographic cover with the title: AI Agent Timeout Settings: Stop Runaway Work and Hand It to a Person
Conceptual illustration created with AI · Be Human

An agent run timeout is a hard limit on how long, how many steps and how much spend a single task may consume before the agent must stop. Effective settings combine three independent limits, set separately for each task type, and every limit ends in a defined stop state that hands the unfinished work to a named person. The goal is not to make agents faster. The goal is to make sure a stuck run fails in a visible, recoverable way.

Key takeaways

  • Use three independent limits: elapsed time, step count and spend per run.
  • Every limit must end in a defined stop state, never in a silent failure or a false success.
  • Stop only at a safe boundary, and save progress before the run exits.
  • Route the unfinished task to a named owner with the reason, the evidence and the one decision needed.
  • Set limits per task type from measured healthy runs, then review them against real logs each month.

Why runaway agent work happens

A runaway run rarely looks dramatic from the outside. A tool returns an error the agent does not recognize, so it tries a slightly different query, then another, then rewrites its plan and tries again. Each step looks reasonable on its own. Over time the run has consumed model calls, sent duplicate messages or touched records it was never meant to change.

Prompt instructions such as 'do not repeat yourself' help, but they cannot be the only control. The failure often sits in a tool, a queue or an upstream service that the prompt never sees. A timeout is the outer boundary that still holds when the reasoning inside the agent has drifted, which is why it belongs in the design from the first day rather than after the first incident.

The three limits and what each one catches

Each limit measures a different kind of runaway, so a single setting leaves gaps. Use all three together.

  • A wall-clock limit ends any run that has been active longer than the task should take. It catches stalled tools, slow upstream services and waits that never resolve.
  • A step limit ends a run after a fixed number of tool calls or model turns. It catches loops where the agent repeats the same action with small variations, often faster than a clock would.
  • A spend limit ends a run once its model and tool costs pass an agreed ceiling. It catches expensive reasoning or large retrieval that the other two limits would allow.

A fast loop usually hits the step cap first. A stalled dependency usually hits the clock. A long but legitimate run that pulls large documents may hit the spend ceiling while behaving correctly, which is a signal to review the task design, not only to raise the number. For a deeper look at stop conditions, see AI Agent Infinite Loops: Step, Cost and Stop Caps for Company Systems.

A step-by-step plan for setting timeouts

Work through this sequence for each task type the agent handles. Start with the work itself, not with the agent's configuration.

  • Step 1: Pull the duration, step count and cost of recent runs that finished correctly. Use the logs the agent already writes, and exclude runs that were interrupted by a person.
  • Step 2: Set the wall-clock limit above the slowest healthy run, with a margin that the operations owner approves. Setting it near the average would stop ordinary slow runs.
  • Step 3: Set the step cap above the highest count a healthy run needed, plus a small margin. Count every tool call and model turn, not only the messages a user sees.
  • Step 4: Set a spend ceiling per run in the currency the business reports in, and agree who is alerted when it is reached. Review the figure with whoever owns the budget.
  • Step 5: Write the stop state for each limit. Record what is saved, which action is not executed and what the requester or queue receives.
  • Step 6: Name the person or queue that receives each handoff, and the response time that queue is expected to meet.
  • Step 7: Test each limit on purpose in a staging run with a deliberately broken tool. Confirm that the stop happens at the right boundary and that the handoff arrives with the right context.
  • Step 8: Record the final values in the agent's operating notes, with an owner and a review date beside them.

For a method to check that the limits hold under real use, see Silent Failure Detection for AI Agents: Reconciliation and Sampled Review.

A timeout that nobody owns is only a delay before the same problem returns.

What a clean stop looks like

A timeout is safe only if the agent stops at a boundary. Two rules matter most. The agent should finish or abort the action it is currently performing, never cut across it. It should also save its state before exiting, so that the next person or process knows exactly where the work stands.

An agent that is stopped in the middle of a write can leave a booking created in one system and missing in another. Tools that accept repeated requests without duplicating results make recovery far simpler. Where the provider does not offer that behavior, add a check that looks up the record before any resume. The guidance in Idempotent Tool Calls for AI Agents: Retries Without Duplicate Work covers this pattern in more detail.

The saved state should be a plain checkpoint: the task, the inputs, the actions completed, the action pending and the limit that fired. A status such as 'stopped at the step limit, two actions completed, confirmation not sent' tells an operator what happened without reading a transcript. Automatic retries after a timeout should be off by default. Resuming from a checkpoint is a deliberate step, and Checkpoints for Long AI Agent Tasks: Resume Without Repeating Work describes how to design it.

How to route unfinished work to a person

The handoff is the step teams most often skip. A notification that says 'agent timed out' is an alert, not a handoff. The person who receives it needs to know the task, what was completed, what remains and which decision is required from them.

A usable handoff packet contains five things:

  • The original request and the record it concerned.
  • The completed actions, with identifiers or links to where each one was recorded.
  • The pending action and the reason it was not taken.
  • The limit that fired, with the observed value next to the configured one.
  • The decision needed from the person, with the options and what each one would trigger.

Illustrative scenario: an agent prepares matches between supplier invoices and purchase records. A vendor's lookup tool begins returning partial totals, and the agent keeps retrying until the step cap ends the run. The run stops before posting anything, saves the matched lines and the list of mismatched invoices, and places the case in the accounts review queue. The accountant sees one decision: approve manual matching, or hold the batch until the vendor tool recovers. The design principle is in Human escalation for AI agents: send the decision, not the mess.

Mistakes that make timeouts worse

Several common choices turn a useful control into a source of new problems.

  • Using one global timeout for every agent and task type, which is too loose for simple tasks and too tight for long ones.
  • Recording a timed-out run as a completed task in dashboards, which hides the failure from the people who review performance.
  • Allowing the stopped run to retry automatically against tools that do not handle repeated requests.
  • Sending timeouts to a shared inbox that nobody is assigned to read.
  • Raising limits after every alert without checking whether the task changed or the agent's behavior did.

The last mistake deserves particular attention. When a limit fires repeatedly, the first question should be what changed in the inputs, the tools or the agent's instructions. Raising the number without that check hides the cause and moves the failure to a higher cost. The retry rules in An AI agent retry policy that avoids repeated mistakes are a useful companion for this review.

How Be Human handles timeouts in managed operations

In a Be Human engagement, the wall-clock, step and spend limits are defined during the first engagement, alongside the agent's role, the memory and tools it needs and the approval boundaries it must respect. The stop states and handoff queues are written into the agent's operating notes, so the team can read and act on them without the builders present. Managed operations then monitor which limits fire, check during recurring evaluations whether the values still fit the work, and review permissions when a connected tool changes. When a limit fires repeatedly, the cause is investigated before any limit is raised.

If you want to find the first task worth handing to an agent, and see where a timeout would protect it, take the free Be Human AI diagnostic.

Frequently asked questions

What timeout should I set for an AI agent? There is no universal value. Measure how long healthy runs of that specific task take, set the wall-clock limit above the slowest of them with an agreed margin, and adjust after reviewing real runs. Tasks that wait on people or on external approvals need separate, longer limits.

Is a timeout enough to stop a looping agent? No. A timeout ends the run but does not explain why it looped, so pair it with a step cap that catches repeated actions quickly and with logs that show which tool call repeated. The timeout is the outer boundary of the design, not its only control.

Should a timed-out agent retry automatically? Usually not. An automatic retry repeats the conditions that caused the stall, and it can duplicate writes when the tools are not designed for repeated requests. Resume only from a saved checkpoint, and only after checking what already happened in the connected systems.

Who should receive the handoff after a timeout? Send it to the person who owns the decision the task depends on, not to a general technical inbox. Include the original request, the completed and pending actions, the limit that fired and the single decision needed, and confirm the queue has a named owner and an expected response time.

Your next step

See where an AI agent fits in your company first.

Take the free Be Human AI diagnostic. A few questions about your work show which task to hand to an agent first, what it needs to know and where a person approves.

Be Human editorial guidance. Examples are illustrative unless explicitly attributed. Sources provide background; implementation choices depend on your workflow.

Less busywork. More room for you.

Bring us the work you wish you had time for.

Book a call to try a personalized AI agent free for 7 days ↗Or take the free AI diagnostic →