I think people will be quick to engage with the "ai is risky" angle, but the thing that jumps out to me is that you were working against a production state in the first place.
The agent made a mistake that plenty of humans have made. A separate staging environment on real infrastructure goes a long way. Test and document your command sequence / rollout plan there before running it against production. Especially for any project with meaningful data or users.
AI is like explosions.
There’s a lot of other ways to die, but that one is the most exciting.
Yeah, even without the AI in the loop, testing a major migration in production is madness. With AI (or a freshly-minted intern) in the loop, it's complete insanity.
Test against staging, produce a script, make the most experienced human review and execute said script against production.