0PricingLogin
AI Agents · Lesson

Timeouts and Circuit Breakers

Bound LLM and tool calls with strict timeouts, and use circuit breakers to stop hammering a sick dependency.

Bound Every External Call

Every network call must have a timeout. Without one, a hung connection can freeze the whole agent.

HTTP Timeouts

import requests
response = requests.get(url, timeout=(3, 10))   # 3s connect, 10s read

All lessons in this course

  1. Idempotent Tools and Side Effects
  2. Retries with Exponential Backoff
  3. Timeouts and Circuit Breakers
  4. Validating Tool Outputs (Pydantic)
← Back to AI Agents