How to Review AI-Generated Code: A Checklist for Teams A checklist for reviewing AI-generated code should require authors to read and test every line, keep pull requests small, disclose AI use, and route authentication, payments, cryptography, database migrations and infrastructure to their owning reviewers, according to a review guide that cites Veracode's finding of vulnerabilities in 45% of its AI-code test cases in 2025, about 44% in July 2026 and 38% in October 2026. The guide also cites a study of 16 code-generating LLMs finding hallucinated packages averaged at least 5.2% for commercial models and 21.7% for open-source models, warning that attackers can register invented package names and plant malware behind them. The guide recommends running formatting, linting, type checks, tests, dependency audits and security scans in CI so human review focuses on judgment. AI assistants can now write a working feature in minutes. The hard part has moved to the other side: someone has to decide whether that code is correct, safe, and something the team wants to maintain. Reviewing AI-generated code isn't a different discipline from normal code review, but it changes where mistakes hide. The code is fluent and confident, and it usually compiles and passes a quick test. That makes problems easier to miss. This post gives you a practical checklist, a few team rules that make reviews work, and Node.js examples of what to catch. It applies whichever tool wrote the code. Why AI-generated code needs extra attention A few patterns come up again and again: - It looks right. Clean formatting and confident naming create a false sense of correctness, and reviewers tend to skim code that reads well. - It lacks your context. The model doesn't know your domain rules, past incidents, internal libraries, or why a strange-looking workaround exists. - It can invent things. That includes functions, config options, and even whole packages that don't exist. - It misses security more often than you'd like. Security tests of AI-written code keep finding a large share of vulnerable output. - There's a lot of it. Output is cheap, so diffs get bigger and review becomes the bottleneck. The package problem is worth spelling out. A study of 16 code-generating LLMs found that the average share of hallucinated packages was at least 5.2% for commercial models and 21.7% for open-source models. Attackers can register those made-up names and put malware behind them. The models in that study are older now and current rates will differ, but verifying a dependency takes seconds. On security, Veracode's 2025 report found vulnerabilities in 45% of its test cases, and its July 2026 report put the figure at about 44%. An update reported in October 2026 found 38%, which Veracode described as its first meaningful improvement since the study began. That's progress, but it's still more than one in three. These are vendor-run tests on specific coding tasks, and the test sets differ between reports, so treat the exact numbers as a rough guide. The direction is what matters: AI-written code needs the same scrutiny as any other untrusted input. Ground rules before you review A checklist only works if the team around it does too. 1. The author owns the code. Whoever opens the pull request is accountable, whether they typed it or prompted it. They should read and understand every line before asking anyone else to. 2. Keep changes small. AI makes 800-line diffs easy to produce. Ask for smaller pull requests, because nobody reviews a huge diff well. 3. Say when AI was used. This isn't about blame. It tells reviewers where to look harder. One line in the PR template is enough. 4. Let automation do the boring work. Formatting, linting, type checks, tests, dependency audits, and security scans should run in CI so humans can focus on judgment. 5. Protect sensitive areas. Authentication, payments, cryptography, database migrations, and infrastructure should always need review from the people who own them. Here's how those pieces fit together: php flowchart LR A "AI generates code" -- B "Author reads and tests it" B -- C "CI checks: lint, types, tests, security scans" C -- |pass| D "Human review with checklist" C -- |fail| B D -- |changes requested| B D -- |approved| E "Merge" The checklist Copy this into your PR template or review guide. Not every item applies to every change. 1. Intent and scope - The change solves the problem in the ticket or spec, and nothing more. - There are no unrelated edits: refactors, renamed variables, reformatted files, or deleted comments. - The approach is one the team would have chosen, not just one that happens to work. - Any removed or changed behavior is intentional and explained. 2. Correctness - The logic matches the business rules, not just the happy path. - Edge cases are handled: empty input, null or undefined , very large input, Unicode, time zones, duplicates. - Failure paths are handled: timeouts, retries, partial failures. - Concurrency is considered: races, double submits, idempotency. - There's no placeholder code: TODOs, stubbed functions, or hardcoded sample data. - Nothing special-cases the test inputs to make tests pass. 3. Hallucinated APIs and dependencies - Every function, method, option, and config key exists in the version you actually use. - No deprecated or removed APIs are used. - Each new dependency exists, is the package that was intended watch for lookalike names , is maintained, and has a compatible license. - Each new dependency is really needed. The standard library or an existing dependency might already cover it. - Lockfile changes match the dependency changes you expect. Don't trust that code is right because it reads well. Check it against the docs or type definitions, and run it. For a new npm package, npm view