AI is decidedly not the answer. Formal verification is the answer, and tooling around it.
My impression is that making everything formally verified is a lot of work and it would be very hard to make formally verified code as easy to write as non-verified code.
The central dilemma is that there are myriad ways to do it wrong for every one way to do it correctly.