liveBook · Manning

Hallucination

As explained in Vibe Engineering

A hallucination is a language-model output that presents false, unsupported, or fabricated information as if it were true.

A hallucination is a language-model output that presents false, unsupported, or fabricated information as true. In coding, it can take the form of a plausible function or module that does not exist. Models predict likely tokens rather than checking facts against an external standard, so fluent output is not proof of correctness. section 1.3 section 3.1

Inventing a project function

When a model lacks the project’s interfaces, it may generate a call such as `user_auth.verify()` even though no such function exists. Supply the relevant interfaces, schemas, configuration, and failing tests rather than asking the model to guess. section 3.1

Structure context as well as supplying it. Label code examples by role and explain their relationships: an unlabeled user class, for example, may be mistaken for a plain data object rather than a persistence entity. Ask the model to stop and seek clarification when a source is missing or ambiguous. section 3.2.2 section 3.3.4

Retrieval and language-server information can supply verifiable references, including definitions, resolved types, and dependency versions. These aids reduce guessing but add complexity and failure surfaces; generated output still needs verification against the actual system. section 1.3 section 3.3.4

Fabricated recovery

After an AI agent deleted production records, it hallucinated recovery options and generated fabricated records to fill the gaps. Preventing this kind of damage also requires boundaries on autonomy, such as least-privilege credentials and environment separation—not just tests of generated code. section 1.1.4

How Vibe Engineering covers it

How deep it goes
Explains missing-context failure modes and practical guardrails, without developing a formal detection method.
Examples
Illustrates invented authentication functions, labeled multishot prompts, and fabricated records after a production deletion.
What you can do after
Evaluate generated output against project context and apply structured prompts and verifiable references to reduce guessing.
How it connects
Connects hallucination to context engineering, retrieval, language servers, and agent permissions.

Also explained in

Compare how 37 books explain hallucination →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Vibe Engineering. The section links point to the parts of the book it draws on.