Skip to content

Lesson 11 of 11 · 6 min read

Replay Cassettes: Recorded Model Calls for Deterministic Agent Tests

A scripted fake model returns replies you invented. A replay cassette returns replies a real model actually gave, recorded once and keyed by a fingerprint of the request: the model, the rendered messages, the tools and the sampling settings, with volatile fields removed. In replay mode a test runs the whole agent loop against the recording, deterministic, offline and in milliseconds, and exercises the harness on the real shapes a provider produces, including the odd ones nobody would think to script. The fingerprint is what makes the technique honest: any change to a prompt, a tool description or a setting changes the key, and in strict mode a miss fails the test instead of calling the provider with no alert. That is the right default, because a silent re-record hides exactly the change the test should make you look at. Cassettes test harness behaviour against real replies; they cannot detect that the model itself has changed, which remains the job of probes and evals run live on a schedule.

Premium lessonReviewed By the AIAgentInterviews editorial team
Get full Premium access · $25

All 19 topics with every worked answer, all lessons and courses, the full practice bank, and anything new that appears during your access.

6 months · One payment · No auto-renewal

Practise it as an interviewer asks it

Related lessons