The agent reliability lifecycle
Last updated · Published by Trustabl
Reliability isn't one tool. It is four stages, Code, Test, Contain and Observe (which many teams call build, test, deploy and monitor), joined by a Learn loop that turns production failures into fixes. Teams that rely on a single stage, usually observability, find problems late and fix them slowly.
| Stage | Question | What it covers | When |
|---|---|---|---|
| 1. Code (build) | Is the agent written to be reliable? | Tool definitions, timeouts, loop limits, reliability rules for coding agents | While writing code |
| 2. Test (evaluate) | Does the code have gaps, and does the agent behave correctly every time? | Static analysis, repeated-run evals, scenario and fault-injection tests | Every pull request |
| 3. Contain (deploy safely) | If it goes wrong, how much damage can it do? | Sandboxes, least privilege, budgets, external policy, guardrails, approval gates | Before release and at runtime |
| 4. Observe (monitor) | What did it do, why, and under whose authority? | OpenTelemetry traces, reliability labels and rules, kill switches | In production |
| ↻ Learn | How does production make the next version more reliable? | Failures become new rules, evals and code fixes | Continuously |
Where reliability comes from
Reliability is built in and tested. Containment limits the damage when an agent fails anyway. Observability shows what to fix next.
| Dimension | Code / Test | Contain | Observe / Learn |
|---|---|---|---|
| Consistency (same result every run) | Creates it | Helps: fewer paths to wander down | Measures it in production |
| Robustness (handles bad inputs and tool faults) | Creates it | — | Finds new failure cases |
| Predictability (knows when it's done or stuck) | Creates it | — | Checks calibration against real outcomes |
| Safety (failures are bounded) | Helps | Creates it | Detects failures; enables the kill switch |
Containment helps only when the agent can still reach every app and data source its task needs. A sandbox that blocks required access causes failures, so base least privilege on observed needs.
Shift reliability left
The earlier a stage, the cheaper the fix. A missing timeout found in Code or Test is a one-line change in a pull request. The same gap found in Observe is an incident, a trace investigation and a hotfix. Start with Code and Test, then add Contain and Observe as the agent gains autonomy.
Production controls by stage
Twelve production controls map onto the stages.
| Stage | Controls |
|---|---|
| Code | Tool contracts, explicit authority, distinct agent identity |
| Test | Continuous evaluation, an independent verification step |
| Contain | Least privilege, runtime budgets and timeouts, external policy enforcement, approval gates |
| Observe | Reconstructible traces, recovery and kill switches, authority lineage and continuous governance |
Matching stages to autonomy
Agents should earn authority in steps, with each step backed by evidence from the stages before it.
| Autonomy | What the agent may do | Minimum stages |
|---|---|---|
| Observe | Actions are logged, not carried out | Code, Observe |
| Draft | Prepares actions for a human to execute | + Test |
| Act with approval | Executes after explicit sign-off | + Contain (approval gates) |
| Act within scope | Acts alone inside a narrow, verified boundary | + Contain (sandbox, least privilege) |
| Expanded authority | Scope widens as evidence builds | All four stages and the Learn loop |
Further reading
- The Agent Development Lifecycle (LangChain)
- Agentic Secure Development Lifecycle (Cloud Security Alliance)
- What Production Controls Do Reliable Agents Need? (Trustabl)
- What Is Progressive Autonomy? (Trustabl)
- Agent Reliability guide (Trustabl)
Tools for each stage: Code · Test · Contain · Observe · Learn