Timeout
What is a timeout?
A timeout is a limit after which an operation is treated as incomplete or failed because it did not finish within the allowed time. Agent systems use timeouts around model calls, tool execution, retrieval, network requests, sandboxes, individual steps, and complete workflows.
Timeouts prevent one stalled dependency from blocking an agent indefinitely. They also create a clear point for cancellation, retry, fallback, or escalation.
How it works
Timeout design usually includes more than one clock:
- a connection timeout for establishing communication;
- a request or execution timeout for one operation;
- an idle timeout when no progress is observed;
- an overall deadline for the user’s task.
When time expires, the system should attempt to cancel work where supported and mark the result clearly. A timeout does not prove that nothing happened. The remote service may have completed the action while its response was delayed or lost.
Simple example
An agent asks a reporting tool to generate a file with a 60-second limit. The client stops waiting after the deadline. Before retrying, it checks the job identifier because the report may still be running. If no job exists, it retries once; otherwise, it polls the existing job.
Timeout versus stopping condition
A [stopping condition](/glossary/stopping-condition/) defines when an agent loop should finish based on goals, limits, state, or policy. A timeout is a specific time-based boundary on an operation or workflow.
A five-minute overall deadline can be one stopping condition, but a two-second database timeout is usually an execution control inside the loop.
Timeout versus latency
[Latency](/glossary/latency/) is the observed time an operation takes. A timeout is the maximum wait the system allows. Setting the limit below normal latency creates false failures; setting it too high produces slow recovery and poor user experience.
Why it matters
Without timeouts, agents can hang, consume resources, and keep users uncertain. Poorly handled timeouts can create duplicate actions when a system retries work that actually succeeded.
Builders should combine deadlines with idempotency, status checks, cancellation, retry limits, and user-visible progress. See [How AI Agents Work](/how-ai-agents-work/) for the broader execution loop.
Learn More
How AI Agents WorkContinue with the full AIRundown guide →