Hallucinations, guardrails, and trust
Why models make things up, the layered defences that reduce it, and how to design products users can trust anyway.
On this page
Hallucinations are confident, plausible outputs that are wrong. They're not a bug that will be patched away. They're a property of how language models generate text. AI PMs must reduce them, contain the damage when they happen, and design products that earn trust anyway.
Why interviewers ask this
"How would you handle hallucinations in our product?" and "How do you build user trust in an AI feature?" are common AI PM questions. Interviewers want to see layered defences (not one magic fix), awareness of other risks like prompt injection, and UX thinking about trust and transparency.
The framework
1. Understand why hallucinations happen
Models generate the most plausible continuation, not verified truth. Risk rises when the model lacks the needed information, the question is ambiguous, the task needs precise facts (numbers, names, citations), or the prompt pressures it to always answer.
2. Reduce hallucinations (prevention)
- Grounding with retrieval (RAG): provide relevant, trusted documents and instruct the model to answer only from them.
- Allow "I don't know": explicitly permit and reward refusing or escalating when the sources don't cover a question.
- Constrain the task: narrower tasks, structured outputs, choosing from options rather than generating freely.
- Use tools for facts: calculators, databases and APIs for numbers and real-time data.
- Better prompts and models: clear instructions; stronger models for harder tasks.
3. Detect and contain (guardrails)
- Input guardrails: detect prompt injection, off-topic or harmful requests, and personal data.
- Output guardrails: check citations exist and support claims, validate formats, filter unsafe content, check numbers against sources.
- Human in the loop for high-stakes actions: review before sending, approving or executing.
- Limits on actions: least-privilege tool access for agents, confirmation for irreversible steps.
- Monitoring: sample outputs, track user reports, alert on spikes.
4. Design for trust (UX)
- Show sources so users can verify.
- Communicate uncertainty: hedged language, confidence cues, "check this" highlights for numbers.
- Set expectations: say what the AI can and can't do.
- Make correction easy: edit, regenerate, thumbs down, report.
- Be transparent about when content is AI-generated.
- Earn trust gradually: start with suggestions, then increase autonomy as quality is proven.
5. Watch for prompt injection
Text inside documents, web pages or emails can contain instructions that hijack the model ("Ignore previous instructions and..."). Treat external content as data, not instructions; separate system instructions from user content; limit what tools can do; and test adversarially.
Worked example
Question: "We're building an AI assistant that answers employees' HR policy questions. How would you handle hallucinations?"
Sample answer:
"HR questions are high stakes: wrong answers about leave, benefits or pay could cause real harm and legal risk. So I'd layer defences.
Prevention: use retrieval over the official HR policy documents only, and instruct the model to answer only from those passages. If the answer isn't there, it says so and links to the HR contact. Keep the documents current, with a clear owner, because stale sources produce 'grounded' but wrong answers.
Containment: every answer includes citations to the exact policy section. An automated check verifies that each citation exists and is relevant; if not, we don't show the answer. Topics like terminations, pay disputes or health and medical leave trigger a gentle hand-off: 'This is best discussed with your HR partner,' with a booking link.
Trust UX: a clear label: 'AI answers based on our HR policies. Always check the linked policy for details.' Citations are clickable, with the relevant passage highlighted. Thumbs up/down and 'Report a wrong answer' go to the HR team for review.
Measurement: an eval set of 200 real HR questions with HR-approved answers, including out-of-scope and tricky questions. Launch bar: ≥95% grounded, ≥98% correct escalation on sensitive topics. After launch: weekly review of reported answers, and tracking whether HR ticket volume falls without an increase in escalations about wrong information."
Common mistakes
- Claiming a single fix ("we'll use RAG, so no hallucinations").
- Forcing the model to always answer.
- No citations or verification path for users.
- Ignoring prompt injection when the model reads external content.
- Full autonomy for high-stakes actions on day one.
Interviewer tips
What "great" sounds like:
- "Hallucinations can't be eliminated, so I'd prevent, detect and contain them in layers."
- "The model should be allowed, even rewarded, for saying 'I don't know'."
- "We show sources, so users can verify in one click."
- "Sensitive topics hand off to a human by design."
- "We'd treat retrieved content as data, never as instructions."
Practice questions
Answer one in a mock interview and get graded instantly.
1.We're building an AI assistant for HR policy questions. How would you handle hallucinations?
Practice this →2.How would you build user trust in an AI feature that drafts emails on the user's behalf?
Practice this →3.What is prompt injection, and how would you protect an AI agent that reads users' emails?
Practice this →
Finished reading?
