Re:Ask HN: How do you review and validate LLM generated code?
by jfawcett on Friday August 21, 2026 @02:16PM
(#49391935)
I follow traditional software engineering practices. There are unit tests and integration tests that happen before it sees any sort of check-in, and the code itself has sufficient logging to ensure that I am able to reconstruct whatever it was that happened. This is critical.
I write code extensively with the AI, but I make sure that it knows that it must pass all gates before being checked in. I also leave sufficient documentation on the disk and in the code that the intent is clear and the implementation precise.
In other words, don't let them hallucinate and have ways to tell immediately when they have. If you work within their limitations, they can be of great help, but if you assume more than they are capable of delivering, you will be disappointed.
When bugs are discovered, they must be gated by an oracle. The oracle must be red before application of the patch, and green thereafter.
I write code extensively with the AI, but I make sure that it knows that it must pass all gates before being checked in. I also leave sufficient documentation on the disk and in the code that the intent is clear and the implementation precise.
In other words, don't let them hallucinate and have ways to tell immediately when they have. If you work within their limitations, they can be of great help, but if you assume more than they are capable of delivering, you will be disappointed.
When bugs are discovered, they must be gated by an oracle. The oracle must be red before application of the patch, and green thereafter.