A superficial review might conclude that the request is validated.
But what if validate() only checks whether the pointer is non-null?
Or what if it returns an error code that the caller ignores?
Understanding the actual behavior requires following the implementation, not trusting function names.
4. They miss interactions between individually correct components
This is particularly problematic.
Imagine:
Function A correctly allocates a buffer.
Function B correctly calculates its size.
Function C correctly frees it.
Individually, everything looks fine.
But if B calculates the size using a different encoding assumption than A, the combined implementation might overflow the buffer.
LLMs frequently review functions in isolation instead of constructing a complete model of their interactions.
5. They suffer from confirmation bias
Once a model decides that a function is probably correct, subsequent reasoning tends to reinforce that conclusion.
They also tend to:
Trust comments and function names.
Assume conventional behavior.
Overlook unusual integer ranges.
Ignore unlikely execution paths.
Accept existing architectural assumptions.
Prefer reporting obvious issues over investigating subtle ones.
This makes them particularly bad at finding bugs that contradict their initial interpretation.
6. They don't naturally perform adversarial testing
A proper reviewer should actively attempt to break the implementation.
For example:
Review dimension
What to investigate
Memory safety
UAF, OOB, double-free, leaks
Integer safety
Overflow, underflow, truncation
Concurrency
Races, deadlocks, ordering
Logic
Incorrect conditions, unreachable branches
Error handling
Ignored errors, partial initialization
API contracts
Invalid assumptions, ownership violations
Portability
ABI, alignment, endianness
Security
Trust boundaries, validation bypasses
LLMs often produce a generic review rather than systematically examining each category.
7. They can mistake plausible explanations for evidence
This is arguably the most dangerous limitation.
A model might report:
The buffer is properly bounds-checked before access.
But did it actually verify that the bound corresponds to the allocated buffer size?
Did it check integer overflow in the calculation?
Did it inspect every access?
A convincing explanation is not proof.
What actually works better?
For serious codebase reviews, I would use a combination:
Tool
Primary purpose
Compiler warnings
Type and compilation issues
Static analyzers
Detect suspicious code paths
Sanitizers
Detect runtime memory/UB issues
Fuzzing
Explore unexpected inputs
Symbolic execution
Explore path conditions
LLM
Understand architecture and investigate suspicious behavior
Human review
Validate assumptions and findings
A better LLM review methodology
Instead of asking:
Review this codebase and find bugs.
Break the task into stages:
Architecture discovery: Identify components, dependencies, ownership and data flow.
Inventory: Enumerate public functions, entry points and critical state.
Contract extraction: Determine preconditions, postconditions and invariants.
Systematic inspection: Review every function against explicit bug categories.
Cross-component analysis: Trace values across function boundaries.
Adversarial verification: Attempt to construct concrete failing inputs.
Evidence collection: Require file locations, execution paths and explanations for every finding.
Most importantly, maintain a checklist of inspected functions. Otherwise, the model can quietly skip half the codebase and still deliver a beautifully formatted report.
The fundamental problem: LLMs are optimized to produce plausible answers, whereas code auditing requires demonstrating that specific properties hold across an enormous number of possible execution paths.