Session 9. Trace and evaluate an agent — Thu 24 Sep
Quick quiz (ungraded)
Q1: The baseline fails all five grounded cases. The trace shows retrieve returned the expected document. Which bucket?
The report alone leaves both buckets open. The trace closes one of them: the passage reached the prompt.
Correct. Retrieval did its job, one llm_call happened, and the answer cited nothing. The fix lives in the prompt or the model, not the index.
A schema break shows up as a parse failure and a retry in the trace. There is neither here.
Q2: Your redactor deletes any field that contained an API key. What has it cost you?
The secret is gone either way. What is also gone is the fact that there was one.
Correct. Those two facts lead to different next steps, and a missing field cannot express either. Replace with a placeholder that says a value was removed.
The eval never looked at the log. The cost lands on the person reading it during an incident.
Q3: Three attempts, three keys, and every one becomes the string [redacted]. What does the log now hide?
Consistent across different secrets is exactly the problem: it makes them indistinguishable.
Correct. Derive the placeholder from the secret — a short digest — and the log shows two distinct values without printing either.
The status codes survive; a redactor replaces the secret and keeps every byte around it.
Q4: One llm_call event never reaches the log. Nothing raises. What is the danger?
There is nothing in the file that says it is incomplete. That is the danger.
Correct. A gap does not look like a gap; it looks like a different run. Hold the trace to a shape — at least one retrieve, exactly one decision — so a broken logger is detectable.
The evaluation reads the answer, not the trace. It stays green while the log tells a false story.
Q5: You need to measure whether an answer's tone is appropriate. Code check or a model as judge?
Prefer code where code can express the property. Tone is not one a regex can express.
Correct. Reach for a judge only where code cannot express the property, and measure the judge itself — an unchecked judge is an instrument with an error bar nobody reports.
That is the reason for suspicion, not for trust. A judge shares the generator's biases and will forgive its own failure modes.