Design an eval harness for a coding agent

L4 · StaffDesign~20 minEvals & observability

You own quality for an internal coding agent that edits repositories and opens pull requests. Design the evaluation harness: tasks, environments, graders, metrics and how it plugs into releases.

Answer it out loud or on paper first. Then open the short answer.

Short answer

Tasks come from real history: past issues with their merged fixes, each packaged as a repo snapshot, an issue description and hidden tests that the fix makes pass. Each run gets a fresh sandboxed container from the snapshot. Graders are mostly executable: hidden tests pass, existing tests still pass, no edits to forbidden files, diff size and lint, plus trajectory rules (tests run after the last edit) and an LLM or human review for code quality on a sample. Report resolve rate with intervals, cost and time per task, and failure categories. Run a small suite on every change and the full suite nightly, gating releases on regressions.

Full answer

Tasks

SourceNotes
Past issues + merged PRsRealistic; hidden tests from the PR
Synthetic bug injectionFills gaps (specific languages, frameworks)
Hard and long-horizon sliceMulti-file, migrations; report separately
Contamination checkPrefer tasks newer than model training data, or private repos

Environment

  • Container per run from a pinned image and repo commit; dependencies pre-installed.
  • No network (or an allow-listed proxy); resource limits; time limit.
  • Same tools as production, with the same permissions.

Graders

GraderChecks
Hidden testsThe fix works
Regression testsNothing else broke
Policy checksTest files untouched unless allowed; no secrets; diff limits
Trajectory specTests run after the last edit; no destructive commands
Review (sampled)Maintainability, matching repo conventions

Metrics

Resolve rate (several runs per task, with intervals), pass^k for reliability, cost and wall time per resolved task, failure taxonomy (wrong file, incomplete, broke other tests, timeout, gave up).

Process

  • PR-level: 30–50 task smoke suite.
  • Nightly: full suite, trends.
  • Release gate: no significant regression on headline or any slice.
  • Feedback loop: production failures become tasks.

Follow-ups

  1. L4. Public benchmarks like SWE-bench exist. Why build your own?

    Expected answer

    Your repos, languages, tools and policies differ; public sets may be contaminated or saturated; use them as a sanity check, not the gate.

  2. L3. How do you keep costs manageable?

    Expected answer

    Tiered suites, caching environments, smaller smoke sets, sampling for human review, and tracking cost per eval run.

  3. L4. The agent's resolve rate went up but PR acceptance by engineers went down. What do you do?

    Expected answer

    Your graders miss what reviewers care about; add review-based criteria and mine rejected PRs for new checks.

Wrong answers interviewers hear
  • "Use SWE-bench scores." Not your codebase or workflow, and possibly contaminated.
  • "Grade with an LLM reading the diff." Executable tests are cheaper and far more reliable for correctness.
  • "Run each task once." Agent variance makes single runs misleading.

Taught in

Improve this answer