How do I catch the AI's mistakes?
Treat AI code as a draft: test it with tricky inputs, read it for the usual failure patterns, and never ship code you can't explain.
AI models write code that looks confident and usually works on the easy path. Their mistakes cluster in predictable places:
- Edge cases: empty lists, a single item, unusual spacing, the last page of results.
- Off-by-one errors: a count or position that is one too high or too low.
- Security holes: user text inserted into a page as HTML (an attack called XSS) or into a database query, or secret keys placed where browsers can see them.
- Invented details: functions, settings or commands that don't exist.
Catch them with a routine. Write down what the code should do before you read it. Run it with normal input, then with the edge cases above. Read anything that handles user input or money twice. When something fails, give the AI a precise bug report (what you did, what you expected, what happened) instead of "it's broken".
Tests make this repeatable. A test is a small piece of code that checks a result automatically, so you find out at once when a change breaks something.
Vumbli's AI Builder track is built around this skill. Missions like "The AI forgot the edge cases" and "Security: the AI just shipped XSS" give you realistic AI-written code with planted bugs to find and fix, ending with a code review gauntlet.
Start with these missions
- How AI models really work (AI Builder)
- Describe exactly what you want (AI Builder)
- Read what the AI wrote (AI Builder)
Tracks that teach it
More questions, answered by building