Week 5 · Deep dive · ~2 hours

Guardrails & Ship It — every line, explained

A clever agent nobody can trust is a toy. Today you make yours observable, evaluated, and guarded — a trace log, a pass/fail eval, and a guardrail — one line at a time.

👆 Tap a line → plain English 🔎 go deeper → extra detail # dim italics = a comment
Guardrail
block bad input before tools
Trace
a log of every step
Eval
pass rate on real cases
Ship
only after the above
Run it right here. Every cell runs in your browser. Run them in order, 1 → 4; they share memory. First Run downloads Python once (~10–15 MB).
This is the plumbing that makes an agent trustworthy. The guardrail, trace, and eval here are real Python you'd keep almost unchanged in production — only the agent's “answer” line would become a real model call. Trust isn't a model feature; it's this code around the model.
↩ Back to Week 5 All deep dives →