I get a lot of use from AI writing unit tests, associated documentation, and lately more complex data problems with the use of MCPs. The deeper you go in terms of complexity and dependencies the less useful AI is and will likely continue to be. As to mitigate this you will need to give your AI agents all seeing access to your infrastructure. Which will be heavily resisted in any organization because nothing about that is a good idea. It would probably work poorly even if you did.
The more in a vacuum the problem is the more AI will work. For this reason it absolutely destroys things like student projects. Hence why the crowd learning computers today is dumbing down because they never had to actually invert a binary tree. They just had the AI do it.
If your company has decades of bad design and tech debt that is too expensive to fix, as many companies do, AI simply cannot help you there. Just watch when some exec goes "the AI says do X, Y, and Z and it will be 100X more efficient!" The AI could even be RIGHT but the whole reason the tech debt has been around for as long as it has is because it is too expensive to fix or there are simply always other priorities.
I have YEARS of tech debt to resolve. I have like 5% of my time to work on it while more just keeps getting built and compounded upon. Every organization deals with this.