Roll back to the previous version in a second, from your AI agent
A new version breaks your app: ask your AI agent to roll back, and the previous version takes the traffic again in a second. Then your agent reads the error, fixes it and deploys again.
By Aloïs Oddon, co-founder of Nextmap. Facts checked on November 2, 2026.
Prerequisites
- An app deployed on while.
- Your AI agent, connected to while over MCP.
Step 1: Ask for the rollback
You, to your agent: Go back to the previous version.
In the 30 minutes after a deployment, the previous version takes the traffic again in a second. After that, it takes a few seconds.
Step 2: The fixed version follows
Your agent reads the error and the logs in while, fixes the problem and deploys the fixed version.
What your agent does
Every version is frozen, and the previous one stays ready for 30 minutes after a deployment: going back only switches the traffic back to it. A version that fails its health check, or whose error rate climbs, is withdrawn automatically, without waiting for you to ask. And a version whose tests fail is never deployed. Going back fast matters: it’s one of DORA’s four key metrics1.
Go back to an older version
You, to your agent: Go back to Monday’s version.
Your agent lists the versions, with their dates, and deploys Monday’s version again, in a few seconds.
Understand what broke
You, to your agent: Why is the new version crashing?
Your agent reads the error, the logs and the grouped errors in while, and finds the line responsible.
Roll back the data too
You, to your agent: Also restore the database to how it was before the migration.
The code and the database go back separately. Your agent restores the database to the moment before the migration, once you approve it in production.
See a new version before you deploy it
You, to your agent: Show me the new version before you deploy it.
Your agent opens a preview, at its own address, with its own data. You look at it, then your agent puts it into production.
In the docs: Logs, Versions and rollback and Previews.
Next steps
Sources
- DORA, the four key metrics of software delivery, accessed November 2, 2026