A developer asks an AI assistant to write a SQL query for a monthly sales report. The generated query looks well formed and confident, but it references a column named customer_tier that does not exist anywhere in the database schema. What is this, and what is the best response?
Select an answer to reveal the explanation.
Short Explanation
The AI didn't lie on purpose; it just filled a gap with something that sounded right. That's a hallucination, and the fix is simple: you check AI output against reality, the actual schema, before you run it. Adding a fake column so the query works is the trap; you'd be bending the database to fit a guess.
Full Explanation
In generative AI, a hallucination is output that is fluent and plausible but not grounded in fact. Large language models generate text by predicting likely sequences, so when a prompt lacks schema details they may invent table or column names that typically appear in similar queries, such as customer_tier, and present them confidently. The correct response is to treat generated SQL like code from an untrusted source: validate it against the actual schema or data dictionary, run it in a non-production environment, and review results before use. Prompt injection is an attack in which malicious instructions are embedded in input to manipulate the model's behavior; nothing in the scenario suggests hostile input, and revoking access does not address an invented column. Data poisoning is the deliberate corruption of training data to skew a model's outputs; a single invented column name is ordinary hallucination behavior and does not justify rebuilding training data. Calling it a source schema mismatch and adding the column reverses cause and effect, changing a production schema to match a guess and producing a report column with no real data. Exam caveat: hallucinations can also appear as plausible but wrong joins or filters that run without error, so result validation matters as much as syntax checks. Operational check: compare every object referenced in the generated query with the data dictionary and reconcile report totals with a known source.