Skip to content

Lesson 2 of 3 · 3 min read

Testing Agents with a Scripted Model

Most agent bugs live in the harness: dispatch, validation, budgets, retries, state, stop conditions. They can be tested deterministically by replacing the model with a scripted fake that returns a fixed sequence of replies, and replacing tools with fakes that can be made to fail. Tests then assert on behaviour (which tools ran with which arguments, what was refused, how the loop ended, what state persisted) rather than on model text. Scripted tests complement, not replace, evaluations with real models; they make the controls trustworthy so evaluations measure the model's judgement.

Reviewed By the AIAgentInterviews editorial team
free sign-in, no card required

Practise it as an interviewer asks it

Course lessons that teach this

Related lessons