A bad deployment in traditional software usually has one clear fix: roll back to the last known-good build. An AI agent has more places a bad deployment can hide, which means it also needs more than one kind of rollback, and knowing which one you actually need is the difference between a five-minute recovery and a much longer one.
The four things that can actually go wrong, separately
- The application code itself. This is the same category any software deployment can break, and the one traditional rollback tooling already handles well.
- The model version. A model provider update, or a deliberate upgrade to a newer model version on your end, can change behavior in ways that only show up under real usage, not in a quick smoke test.
- The system prompt or agent configuration. A prompt change intended to fix one issue can introduce a different, less obvious regression elsewhere. This is easy to miss because the system is still technically working, just working differently.
- The knowledge base or retrieval index, if the system does any retrieval at all. A bad reindex, a stale or corrupted data source, or a change in how documents are chunked can degrade answer quality without any application code changing at all.
A rollback strategy that only covers the first category leaves the other three without a real recovery path. When one of those breaks, the actual fix is often "figure it out live in production," which is a bad place to be doing root-cause diagnosis.
What a real rollback plan covers for each category
Application code: standard practice, still necessary
Versioned deployments with a fast, tested rollback path. This part isn't unique to AI systems. It's standard deployment discipline that still has to actually be in place.
Model version: pin it, and know what pinning trades away
Pinning to a specific model version, rather than always pointing at "latest," gives you a stable rollback target if a newer version regresses on your specific use case. The tradeoff is that you don't automatically get improvements either. That's a real cost, not just a safety measure, so be deliberate about it rather than defaulting to either extreme.
System prompt and configuration: version it like code, because it is code
A system prompt should live in version control with the same rigor as application code, not as a value edited directly in a dashboard with no history. If a prompt change is suspected of causing a regression, being able to diff it against the previous version and revert cleanly matters as much as being able to revert a code deployment.
Knowledge base and retrieval index: the one people forget to version
If your system uses retrieval-augmented generation, the index itself needs a rollback path too: a way to revert to the previous version of the knowledge base if a reindex introduced bad data or degraded retrieval quality, not just a way to fix the code that queries it.
How to actually detect which layer broke
This is where real observability matters most: separate monitoring for response quality, not just infrastructure health, is what tells you a regression happened at all when the system is technically still responding normally. Without that signal, the first indication of a problem is often a user complaint, which is a much slower and more painful way to find out.
How we approach this
We build separate, tested rollback paths for application code, model version, system prompt, and retrieval index from the start. We pair them with the quality monitoring that tells you which layer actually broke, so a bad deployment is a fast, targeted recovery instead of an open-ended investigation.