Design an evaluation harness for a customer-support AI agent
I was asked this
No reports yet. Sign in to say where you were asked it.
An AI system design interview question asked in Decagon's system design round. It tests evals, agents and simulation.
A company's AI agent answers its customers over chat and takes actions through tools: refunds, plan changes, escalations to a human. Every change to its prompt, model, tools or policies can break it. Design the harness that decides, before a change ships, whether it made the agent better or worse.
Requirements
- Functional: a library of test scenarios (a customer goal, their account state, the policy that applies, the expected outcome); simulated customers that talk to the agent; sandboxed tools with realistic data; graders for outcome, policy compliance and tone; several trials per scenario; comparison with the production version; a release gate; a path from real production conversations to new scenarios.
- Non-functional: a full run fast enough for every change (tens of minutes) and cheap enough to run many times a day; results reproducible enough to trust; able to tell a real 2-point drop from noise.
Clarifying questions
- How many customers (brands) use the agent, and does each have its own policies and tools?
- Which failures are worst: a wrong refund, a policy violation, a rude tone, an unneeded escalation?
- Can we record and replay tool responses, or do tools need full sandboxes?
- Who writes and labels scenarios, and how fast can the set grow?
- What does a release gate block: any regression, or regressions on critical scenarios only?
What a strong answer covers
- Scenario design: goal, persona, initial state, policy and success criteria, tagged by intent and risk, with critical scenarios (money movement, identity checks) weighted separately.
- Simulated customers driven by a model with a persona and a hidden goal, plus scripted ones for determinism; guarding against a simulator that is too cooperative.
- Sandboxed tools with seeded state, so actions are checked against the final state (was the right refund issued, and only once) rather than only the transcript.
- Graders: exact state checks where possible, model-based judges with rubrics for the rest, calibrated against human labels and audited regularly.
- Statistics: several trials per scenario because the agent is random, pass rates with confidence intervals, paired comparison against the baseline on the same scenarios, and the number of scenarios and trials needed to detect a 2-point change.
- Cost and run time: scenarios x trials x turns x tokens, parallel runs, caching the baseline, and a fast smoke subset per commit with the full set before release.
- The loop from production: flagged or escalated conversations turned into scenarios after review, with privacy handled.
Follow-ups
- A new model scores higher overall but fails three critical scenarios. Ship or not?
- The judge model itself is upgraded. How do you keep scores comparable over time?
- One brand changes its refund policy. Which scenarios need updating, and how do you find them?
- Evaluate voice conversations as well as chat.
Where it's asked
- Decagon · System design60 min · Design discussion
What it tests
evals · agents · simulation · llm-as-judge
Sign in to see the worked answer
The full answer, chapter by chapter, with what interviewers expect at each level. New accounts get 5 credits: each one unlocks a question for good.
What the labs asked this week
A weekly email of what OpenAI, Anthropic and the other top AI labs asked engineers, round by round.
