KatInterview

Build an Evaluation Platform for a Tool-Using AI Agent

Machine LearningModel answer
MediumModel answerMachine Learningagent-evaluationml-infrastructurellm-ops

Last updated

Design a safe, repeatable harness that runs a tool-calling agent offline, grades its trajectories, and gates releases without touching production state.

Background

Your team ships a conversational AI agent that can call external tools — think web search, a code interpreter, a calendar API, or a customer database — to complete multi-step tasks. Before any new version of the agent reaches users, you need confidence that it performs better (or at least no worse) than the current one.

Your job is to design the harness and evaluation platform that makes this possible. You are not designing the model itself or the serving infrastructure; focus on everything that surrounds and measures the agent during offline evaluation.

Pick a concrete task domain to anchor your design. State it up front and make your assumptions explicit as you go.


What the system must support

  • Safe execution. The agent under test must never touch real external systems or mutate production state.
  • Repeatable task sets. Running the same evaluation twice should produce comparable, auditable results — not arbitrary noise.
  • Trajectory tracing. Every model call, tool invocation, intermediate result, and final answer must be captured in enough detail to reproduce and diagnose failures.
  • Multiple grading strategies. Some outcomes have a ground-truth answer you can check programmatically. Others require a rubric, a reference model, or a human reviewer.
  • Repeated trials. Because model outputs are stochastic, a single run is not enough to distinguish a real regression from luck.
  • Privacy. Evaluation tasks may reference real user data. That data must not leak into prompts, logs, or the model's context in uncontrolled ways.
  • Regression gates. The platform must produce a clear, defensible signal for whether a candidate version should advance toward release.
  • Reward-hacking resistance. Graders and task sets must not be so transparent that the agent (or a human tuning it) can game the score without actually improving.

Constraints

  • Tools may be slow, stateful, unreliable, or capable of destructive side effects.
  • Trajectory length — and therefore cost — varies widely across tasks.
  • The evaluation dataset itself is a sensitive artifact that must be versioned and access-controlled.
  • A candidate agent version must be isolated from the production version running live traffic.

What a strong answer covers

Spend your time on design decisions and trade-offs rather than a list of buzzwords. A complete answer addresses:

  1. How tasks are specified, stored, and versioned.
  2. How the execution environment isolates the agent and stubs or replays tool calls.
  3. What a trajectory record contains and how it is stored.
  4. How graders work, how their own reliability is measured, and how scores are aggregated across stochastic trials.
  5. How the platform decides whether a candidate version passes.
  6. How privacy, contamination, and reward-hacking risks are controlled.
  7. How failures feed back into the task set over time.

Hints

Hint 1

Start by decomposing the pipeline into distinct stages — task specification, execution, observation, grading, reporting — and assign clear ownership and data contracts to each boundary before going deeper into any one stage.

Hint 2

For tool isolation, think about the spectrum from full simulation to recorded replay to sandboxed real calls. Each point on that spectrum trades fidelity for safety and cost differently; name the trade-off explicitly.

Hint 3

Evaluator reliability is not free. Describe at least one concrete mechanism — inter-rater agreement, calibration tasks with known answers, or evaluator consistency checks — that lets you measure how much to trust your graders.