Can AI agents safely refactor legacy systems without breaking things?
by•
AI coding agents excel at modular tasks, but refactoring monoliths or legacy logic is where things get risky. Sometimes an agent renames a parameter or restructures a module without realizing a silent dependency is deeply coupled elsewhere. I wonder if requiring automated test suites before allowing agent refactoring is the only safe way forward.
How do you prepare legacy codebases before letting an AI agent touch them?
14 views
Replies
tests first helped, but what saved us more was making it commit after every small step.. when something breaks two files away you can see exactly which change did it and roll back just that. a hook that blocks the risky commands also did more than any line in the rules file asking it to be careful. do you let it touch the tests too or keep those off limits?