Agents that fail safely
Timeouts, retries and partial failures handled like in any other distributed system: idempotent tools, checkpoints, and a human in the loop where it matters.
I’m Saurav Modi, a Senior Software Engineer with 10+ years designing event-driven, cloud-native platforms for fintech, insurance and higher education. I care about the unglamorous part: systems that stay correct when things fail. Now I’m bringing that discipline to AI agents.
LLM agents fail the way microservices fail: timeouts, partial writes, retries that double-send, silent drift. I design agentic systems with the guardrails I’ve spent a decade building into event pipelines.
Timeouts, retries and partial failures handled like in any other distributed system: idempotent tools, checkpoints, and a human in the loop where it matters.
Prompt and model changes ship like code changes: tested against real cases, not judged by eye.
An agent is only as good as the facts it is given. Context should be checked, scoped and kept current, not assumed.
The patterns carry over almost one to one.
| Event platform | Agent system | Why it matters |
|---|---|---|
| Dead-letter queue | Failed-run queue | Bad tool calls get parked and reviewed, not lost or looped. |
| Idempotency key | Safe tool retries | A retried “send notice” never sends twice. |
| Event replay | Trace replay for evals | Yesterday’s failures become tomorrow’s regression tests. |
| Backpressure | Token & rate budgets | One runaway agent can’t exhaust shared model quota. |
| Exponential backoff | Model fallback chain | Provider hiccups degrade gracefully to a smaller model. |
Small, practical tools for running AI agents reliably: deterministic, tested, and installable in one line.
Catches stale facts in the files AI agents trust.
uv tool install driftcheck-mcpTen years across fintech, insurance and higher education.
Designing the backbone other teams build on. Most recently, an event-driven platform carrying a bank’s customer communications at over a million events a day, where losing or duplicating a message is not an option.
Moving critical systems without stopping the business: a monolith into services, millions of records off legacy databases, workloads onto the cloud with failover. Small, reversible steps, with a way back at every one.
Treating failure as a design input: retries, dead-letter queues, replay, failover and deliberate chaos testing, so incidents become routine instead of dramatic.
Making the right way the easy way for other engineers: API gateways, delivery pipelines and shared component libraries.
In banking and insurance, a lost record or a duplicate message is a customer problem, not a bug ticket.
Services rarely fail alone. Outages come from the seams: timeouts, retries, mismatched assumptions.
The technology is the easy part. Ordering the moves and keeping a way back is where they succeed or fail.
Proven tools, plain designs and fewer moving parts survive the 3am page.
A few honest signals beat a wall of dashboards: is it correct, is it fast enough, what does it cost.
AI agents draft; people decide. I use them every day, and I still own what ships.
Short pieces on how I think about building things that hold up.
Have a project in mind or want to collaborate? I’d love to hear from you.