Don’t Merge What You Haven’t Read: How to Review AI-Written Code

AI produces a lot of code, and reading all of it is hard. It is tempting to merge it with “well, it works”, but keep doing that and you end up with a service of your own that nobody understands.
You don’t have to read everything. But read these
Time is limited, so prioritize what you read.
- Anything handling money or personal data: payments, member information, passwords
- Authorization checks: who can see what, and who can change it
- Anything talking to the outside: API calls, file uploads, sending email
- Anything that deletes or overwrites data: operations that cannot be undone if wrong
- Newly added libraries: do they really exist, and can they be trusted?
What to look for when reading
- Did it do anything you didn’t ask for? Check the diff to see whether unrelated files were changed.
- What happens on errors? On failure, is data left half-written, or are overly detailed errors shown?
- Does it follow your rules? Check naming and that it uses the components you decided on.
- Can you explain it? If you cannot say in your own words what a part does, it is not ready to merge.
Use AI as a reviewer too
Using AI as a reviewer, separately from the AI that wrote the code, is effective.
- Ask it to “critique this code as a tough reviewer”
- Ask “which places are likely to break with this change?”
- Ask it to “explain this function to someone reading it for the first time”, and check that it matches your understanding
But AI review is for reducing oversights. Deciding whether to merge is, in the end, a person’s job.
Small requests are easier to read
Ask “build the whole login feature” and a mass of code arrives at once. Ask in small pieces — “just the input fields first”, “now just the password check” — and each batch is smaller and easier to read.
Summary
Reading AI’s code is not about distrusting AI; it is about taking responsibility for your own service. Make it a habit to read the important parts, in small pieces, until you can explain them.

