My approach has been that I architect a system myself that is modular and the agent tackles one module at a time. If the module does not work it can be ripped out and replaced without effecting the rest of the working modules due to strong decoupling.
This way I may ship code I don't audit but when I have to the issues are already easy to find. And of course document and unit test everything.
So I don't cognitively surrender the system design, only the inner implementation of the modules.