Course 9, lesson 87 of 100, Ages 14+

Testing your AI

Evals and red-teaming

Like I’m 5

Before a big race, you practise on the track and time yourself. Before people use an AI, builders test it lots to see how well it really works.

The big idea

Evals are tests that measure how well an AI system works: accuracy on a question set, how often it follows instructions, whether it refuses harmful requests, and how it handles tricky inputs.

Good evals use realistic examples, clear scoring and repeat runs, because AI outputs vary. Red-teaming deliberately tries to break the system. Every change to prompts or models should be re-evaluated before launch.

Examples

  • Golden set: 100 real customer questions with expert-approved answers.
  • Rubrics: Score answers for correctness, tone and safety.
  • Red-teaming: Testers try to trick the bot into breaking its rules.

How it works

  1. Make a test set: real questions with good answers, including some tricky ones.
  2. Run your AI on all of them and score the results. This is called an eval.
  3. Then try to break it on purpose, called red-teaming, and fix what you find before launch.

Check your understanding

What is red-teaming?
Options: Trying to make the AI fail on purpose; Painting the computer red; Letting only one team use it.
Answer: Trying to make the AI fail on purpose. Red-teamers hunt for weaknesses so they can be fixed before real users find them.
Why re-run evals after changing a prompt?
Options: Changes can improve one thing and break another; Evals expire daily; They don't need re-running.
Answer: Changes can improve one thing and break another. Regression testing catches new problems before users do.

Remember

Measure, try to break it, fix it, repeat.

Talk about it

How would you test whether a new game is fun?

Go deeper

Evals measure accuracy, robustness and safety on realistic and adversarial inputs, often using automated graders plus human review. Keep tracking results over time, because a change to the prompt or model can fix one problem and quietly cause another.