Skip to main content

AI coding · Basics

Hallucination

Also called: AI hallucination, Confabulation, Making things up

When AI generates content that looks reasonable but is wrong or doesn't exist, like made-up functions, API fields, or package names.

In detail

Hallucination is like a coworker who really wants to help but won't say "I don't know." Even when unsure, they give an answer that sounds very professional. In coding, it often shows up as: using props the component library doesn't have, making up field names in an API response, recommending npm packages that don't exist, or claiming "fixed" when the problem is still there.

The usual cause is missing information. The AI hasn't seen the API docs or read the relevant files, so it can only guess. The most effective way to cut down on hallucinations is to give it real material: the exact error text, a sample API response, the relevant code files.

Also get in the habit of checking: run it, build it, look at the page. When the AI recommends a package you've never heard of, first make sure it really exists and comes from a reliable source, so you don't install a malicious lookalike.

Developer info
Term ID
ai-hallucination
DOM selectors
No DOM cues. This concept isn't detected directly on a page.
Priority
1 · when several match at the same level, the higher priority wins
Version
v1 · updated Sep 29, 2026