Just don’t use the same model to write and vet the code. Use two or more different models to verify the code in addition to reading it yourself.