I think in time (a few years) the gap will close a bit. As AI is used to harden software, it will be harder to break. Software not validated by AI will continue to be vulnerable to it.
Even of that were possible in the abstract, it would also have to be secure when running on hardware. I personally don’t believe that perfect security can exist or that we will reach that ideal of somehow being ahead of the curve. Patches will get better and faster, so will exploits. The stakes will grow. There will always be a human or budget issue.
The only way I see to mitigate the impact is to reduce our reliance on connected systems.