Run an Agent in Production Without Losing Sleep
Take Kestrel's dispatch agent through ten lessons: durable runs, action-bound approvals, isolated computation, delegated identity, streaming and cancellation, admission limits, checkpoint migrations, staged rollout, spend controls and a readiness review.
Kestrel Freight is a fictional logistics company whose dispatch agent handles shipment exceptions. Its runs wait for people and carriers, sometimes for hours. Workers restart, customers change requests and service responses disappear after an action has already happened. The system needs an honest record of what is confirmed and what remains uncertain.
Across ten lessons you build durable execution and approvals, contain generated computation, and apply delegated identity at the service boundary. You then add streaming and cancellation, bounded queues, checkpoint compatibility and a staged rollout with a stop rule. Fleet spend controls and the final readiness review bring those properties together.
Every example uses fake services or recorded state. The exercises specify failure conditions and acceptance criteria. Passing them establishes the behavior actually tested; capacity, live integration quality and deployment readiness require evidence from the intended environment.
The recovery lesson is free and the approvals lesson requires a free account. The streaming and cancellation workshop is also public. The remaining operational lessons and readiness project are Premium. The coordination course applies these boundaries to workers, external tasks and interactive interfaces; the interview course helps you defend them under follow-up questions.
When you finish, you can
- Make a multi-hour agent run resume after a crash without repeating a completed side effect
- Pause a run for a person's approval with no process held open, and refuse an approval once the facts behind it change
- Run agent-generated code in a sandbox that never sees a credential, with outbound traffic through an allowlisting proxy
- Act on a customer's behalf with a delegated token naming both the customer and the agent, checked by a policy outside the model
- Cap spend per run, per tenant and across the fleet, with a kill switch that stops one agent type cleanly
- Write a production readiness review another engineer can check line by line
- Handle cancellation, overload and checkpoint changes without hiding uncertain effects
- Design a read-only shadow and a bounded canary with tested stop conditions
BEFORE YOU START · You have built an agent loop with tools, or taken the Build an Agent Harness course, and you know what a queue, a database transaction and an OAuth token are. Every example runs offline; the company, its shipments and its customers are invented.
Syllabus
Runs that survive
Make a long run resume after a dead worker without repeating a side effect, and pause it for a person without holding anything open.
Boundaries that hold
Keep credentials out of the sandbox entirely, and act on a customer's behalf with a token and a policy that both name who is acting.
Control live work
Stream checked progress, contain queue pressure, migrate resumable state and roll out changes without hiding uncertain effects.
Operate the fleet
Cap what one run, one tenant and the whole fleet can spend, then write the readiness review a launch depends on.