Once you no longer "own" the code, does it matter? If you provide a very detail set of specifications and success criteria then you can turn it into a black box. The code is no longer the asset, just the business that uses it. You can use AI to extract the requirements from the existing code and then modify as needed however, I would recommend doing this in two phases: first the conversion, then the enhancements.
I suppose you are right at least what comes to the functionality. Security is the one thing where I am sure that my company will require some peaking under the hood.