After the AI generates code, immediately ask it to audit its own work:
"Now audit your code for potential runtime errors, edge cases, and missing error handling."
This catches issues the initial generation missed. The AI often spots problems when explicitly asked to look for them. It's like asking someone to proofread their own writing after a short break.