You pay someone and give them the explicit responsibility for code quality in your system, empowering them to gate check-in with any static analysis and adversarial agent review they feel like. It’s not a silver bullet but you absolutely can do better than just giving up.
Anything involving an AI won't work. If it did AI companies would already train their AI with it. Review solutions during training, generate synthetic data etc., or as a budget solution just route the requests through more models before giving you an answer.