The goal of generative AI tools, powered by large language models (LLMs), is to finish the task assigned to them; to provide a complete response to a prompt. As is now well-established, models sometimes make things up, or hallucinate, to achieve this. In natural language outputs, hallucinations have degrees of seriousness—minimal in shopping lists, possibly consequential in scientific texts. In code generation, hallucinations are easier to spot and the consequences are clear: the code doesn...