So the model hallucinates an API. How does that get caught before it ships?
A strong answer splits hallucinations into the ones that crash and the ones that quietly no-op, and knows which check catches each kind
My main defense is just never trusting code I haven't run. Hallucinated APIs usually fail the first time they execute, so running the code or its tests catches most of them right away. For anything unfamiliar I'll check the official docs, make sure the method actually exists and takes the arguments the model says it does. Type checking helps here too, TypeScript will flag a method that doesn't exist on a type. I'm extra careful with the less common libraries, that's where the model invents things more often, and with anything version-specific. And when it suggests a package to install, I confirm the package actually exists and is maintained, not something the model made up. Between running the code, the types, and a quick docs check, I think very little gets through.