How to Verify AI Answers

Updated · 5 min read
easyPython 3.13aiverificationfact-checkingsafetybeginnersinterview

How do you know when an AI answer is right? Advitha gets three answers in one evening in San Francisco: a recipe idea, a statistic for her school essay, and a Python function for a class project. They don't all deserve the same trust, or the same checking. A wrong recipe ruins dinner; a wrong statistic costs grades; wrong code can break a whole project.

This lesson gives you four checking habits, and a simple rule for how much to check.

Four Habits

Four habits, matched to the stakes
HabitHow to do it
1. Ask for sources, then open themAsk "What are your sources?", then open each one and find the claim in it
2. Cross-check numbersRecalculate key numbers yourself, or with a calculator or a spreadsheet
3. Test codeRun it, with a few tests including an edge case, before you rely on it
4. Compare a second, independent sourceAn official website, a textbook, a trusted publication or an expert

Testing Code: A Quick Example

Suppose an assistant writes a function to average a list of scores. Before using it, test it, including the edge case of an empty list:

Python
def average(scores):
    return sum(scores) / len(scores)
 
print(average([80, 90, 100]))
try:
    print(average([]))
except ZeroDivisionError as error:
    print("Bug found:", error)
Output
90.0
Bug found: division by zero

The normal case works, but an empty list crashes it. Two lines of testing found a bug that a quick read would miss. Ask the AI to fix it, then test again.

Match the Checking to the Stakes

StakesExamplesHow much to check
LowA birthday message, a recipe idea, brainstormingA quick read
MediumSchool work, a work email, a summary you'll shareCheck facts, numbers and names
HighHealth, money, legal matters, safety, decisions about peopleCheck with an expert or official source; AI is only a starting point

Common Mistakes

Checking only that a source exists. It must also say what the AI claims.

Asking the same AI "Are you sure?" as your only check. Use an independent source.

Skipping edge cases when testing code. Empty inputs, zeros and unusual values find most bugs.

Interview Corner

How do you verify an AI-generated answer?

Open its sources and confirm they say what it claims, recheck numbers, test any code, and compare with an independent source, with more checking for higher-stakes decisions.

How would you check AI-generated code before using it?

Read it, run it, and test it with normal and edge-case inputs, such as empty lists or zero, and review it for security issues. Never deploy code you haven't tested.

Practice

Exercise: check for one task. For one AI-assisted task from your school or work, write down: what you will never paste (from "Privacy: What Not to Share with AI"), the stakes (low, medium or high), and exactly how you will check the answer. Then do the task and the checks, and note anything you caught.

Check your understanding:

  1. Name the four habits.
  2. What did the empty-list test reveal?
  3. How should checking change for high-stakes answers?

Quick check: verifying AI answers

4 questions
1The AI gives a statistic with a link. What should you do?
2Why test AI-written code with an empty list?
3Which answer needs the most checking?
4What is an independent source?

Key Takeaways

Quick reference

HabitOne-line test
SourcesDid I open it, and does it say this?
NumbersDid I recalculate the key ones?
CodeDid I run it, with an edge case?
Second sourceDoes an independent source agree?

Was this tutorial helpful?

Lesson 43 of 186