Module 12 of 12

Testing, Evals & Prompt Safety

Lessons

About This Module

A prompt that works on three examples can fail on the fourth. Moving from "it looks fine" to "it works" means testing: collecting real examples, reading where the model goes wrong, and turning those failures into repeatable checks called evals. Some checks are simple code assertions, and others use a second model as a judge to grade outputs against clear pass or fail criteria.

The module also covers prompt safety. Because instructions and data share the same text stream, a model can be tricked by text it reads, such as a web page, an email or a document that contains hidden commands. This is prompt injection, and there is no complete fix, so it has to be treated as a design risk rather than a bug to patch once.

Watch the lessons in order, then move on to the course Projects.

Lessons

3 videos
01

Evals, error analysis, and better prompts: A systematic approach to improving your AI products

Hamel Husain on moving beyond "vibe checking": reviewing real user conversations, categorizing the failures, writing pass/fail evals, building and validating an LLM judge, and improving prompts and system instructions.

Video 54min
02

LLM-as-a-judge: evaluating LLMs with LLMs

An explanation of the LLM-as-a-judge method: how one model can grade the outputs of another, why it works, and how to create your own judge.

Video 5min
03

Generative AI's Greatest Flaw

Computerphile with Mike Pound on indirect prompt injection: how text hidden in documents or web pages can hijack a model, how it resembles SQL injection, and why it is so hard to defend against.

Video 12min