Manage the agent lifecycle: from idea to shutdown
Key takeaway
Agents need a defined lifecycle with clear transitions: request, prototype, pilot, production, review and retirement. Each transition has traceable criteria, for example a passed test set, a named owner and a tested rollback path.
Lessons in this path
Why agents need a lifecycle of their own
Classic software behaves the same for the same input. An agent, by contrast, can change although nobody touches its code: the model provider updates a model, a tool description is adjusted or the data grows. A one-time acceptance test is therefore not enough. An agent must be checked regularly against the same yardstick, and someone must be entitled to stop it.
Then there is agent sprawl. Prototypes remain active after a demo, keep their rights and incur costs. A lifecycle with expiry dates prevents experiments from silently becoming production systems.
Which stages and criteria work well?
The overview below is a starting point. Adapt the criteria to your existing release processes instead of inventing a parallel one.
| Stage | Data and users | Criterion for the next step |
|---|---|---|
| Prototype | Synthetic data, development team | Business value plausible, expiry date set |
| Pilot | Approved data, named pilot group | Test set passed, owner named, tools catalogued |
| Production | Real data, target group | Pilot metrics met, operations handover, rollback tested |
| Review | Running operation | Regular test run, cost and usage within range |
| Retirement | None | Rights revoked, data handled per retention rule, catalogue updated |
How do you test an agent before each release?
The basis is a test set: a collection of realistic tasks with an expected result or clear scoring criteria. For agents you check not just the final answer but also the path to it.
- Collect and anonymise 30 to 100 typical tasks from the pilot (rough orientation).
- For each task, record which tools may and may not be called.
- Add hard cases: missing data, contradictory input, requests outside the mandate.
- Define scoring: result correct, path permissible, step count and cost within range.
- Run the test set automatically on every change to model, prompt or tool.
Add every production error as a new test case. The test set then grows with reality and prevents known errors from returning.
Who decides on release and shutdown?
A clear division of roles works well: the business owner decides on value and audience, the platform on technical minimum standards, security and data protection on risks above a certain tier. It is important that each of these roles may also stop an agent without convening a committee. A central switch per agent that immediately blocks tool access therefore belongs in the platform.
For agents working in higher-risk areas, such as decisions about people, you should additionally check whether requirements of the EU AI Act apply. This is orientation, not legal advice, and should be clarified with your legal department.
Going deeper: detecting drift and handling model changes
Drift means that an agent’s behaviour changes over time. It shows in metrics from the traces: more steps per task, more frequent tool errors, rising costs, more abandonment by users or more escalations to humans. Set a corridor for each metric and run the test set automatically when it is breached.
Treat model changes like a release. Pin a specific model version in production where the provider allows it, test new versions in parallel with the test set and switch over gradually, for instance for a small share of requests first. Plan fixed time windows for this, because providers regularly retire older model versions, and a forced switch under time pressure is the riskiest kind.
Example: a prototype that almost silently became production
In a fictional retail group, a team builds an agent that answers supplier enquiries. After a successful demo, three purchasing teams soon use it, although it still runs under a developer’s account and without a test set. When the lifecycle is introduced, it is flagged because its expiry date in the catalogue has passed.
Instead of shutting it down, it is moved into a formal pilot: its own service identity, 60 test tasks from real enquiries and a business owner in purchasing. The first test run shows that the agent pulls in data from other suppliers when supplier numbers are missing. After the fix and a second test run, it moves into production in an orderly way, with monthly review.
Common mistakes
- Running prototypes without an expiry date.
- Testing only the final answer and missing impermissible tool calls.
- Letting model versions update automatically in production.
- Failing to revoke rights and tokens at retirement.
Frequently asked questions
How often should a production agent be reviewed?
Automatically on every change to model, prompt or tool, plus at a fixed cadence, such as monthly or quarterly depending on risk tier. This is orientation to adapt to your risk model.
What happens to the logs of a retired agent?
They are handled according to the applicable retention rule. Clarify it in advance with data protection and audit, because traces can contain personal data.
Try it yourself
Assign every known agent in your area to a lifecycle stage and set an expiry date for each prototype.
Check your result
Every agent has a stage, an owner and a next review date, and at least one agent has an automatically running test set.