Skip to main content

How do I benchmark AI coding agents in production?

Summary

  • Benchmark coding agents on your own work: turn recent merged pull requests into tasks, hold out their tests, and grade each agent by whether those tests pass.
  • Score model and harness pairs, not just models, and report cost per completed task, because token price is a poor guide to what a task actually costs.
  • Public coding benchmarks are a weak guide for production choices, since their tasks leak into training data and rarely match your codebase.
  • On Databricks, Unity Gateway logs production coding sessions so you can size your real task mix, run candidate models through the same governed path, and watch cost, latency and activity after rollout.

How do I benchmark AI coding agents in production?

Build the benchmark from your own engineering history, then confirm the result on live traffic. Turn recent merged pull requests into well-specified tasks, hold back their tests, run each model and harness combination with a standard setup, and count a task as passed only when the held-out tests pass. Report quality and cost per task together. Databricks built its internal coding benchmark this way and concluded that "any team with a backlog of merged PRs is sitting on a benchmark already that no model has trained on, graded by the tests your team wrote."

Why aren't public benchmarks enough?

Public coding benchmarks are useful for a first cut, but they can't settle a production decision. Databricks gives two reasons: "The tasks are public, so the solutions leak into training data over time," and the results "weren't representative" of a large, multi-language codebase. Your codebase, languages, build system and conventions are what the agent has to handle every day, so that's what the benchmark should test.

What a production-grade coding agent benchmark needs

Practice Why it matters
Recent tasks Reflects the frameworks and conventions in use today
Human-written changes only Drops bot, service-account and fully AI-generated commits so tasks reflect real engineering work
A high-quality test suite per task Gives an objective pass or fail grader
Self-contained changes Keeps each task gradable on its own
A representative task mix Covers the real spread of languages and complexity
Prompts written from intent States the goal and constraints but strips the solution, so the task isn't trivially easy
Held-out tests as the grader Grades behavior; Databricks avoided an LLM judge for correctness because it "rewards sounding right over being right"
Sealed repository history Stops an agent from finding the merged answer in version control
Standard harness setups Measures what developers will actually run
Cost per task Captures token efficiency, which per-token price hides

Two findings from the Databricks benchmark shape how to read results. Token price misleads: "the token price of a model is a poor indicator of actual costs incurred on end-to-end tasks." And the harness matters as much as the model, because the same model run through different harnesses changed cost per task while quality stayed the same, mostly because of how much context each harness fed the model.

How Databricks approaches coding agent benchmarking

Start from production logs. Databricks "used Unity Gateway to capture logs of all our coding interactions, which enabled us to analyze the complexity of the tasks engineers tackle using coding agents." In your workspace, system.ai_gateway.usage records every request from agents launched through the Unity Gateway CLI, with the coding agent, model, tokens and latency, and session fields (Public Preview) that group requests into sessions. The unified trace table (Beta) adds the agent's own activity, such as tools and skills used.
Run candidates through the same path. Launch an agent on a specific model with the CLI, for example ug codex --model <model-service> using the full name of a model available to you, and the run is logged like production traffic: its tokens, latency and model land in system.ai_gateway.usage and its spend in the billing tables, so benchmark runs and live usage sit side by side. Open models served through Unity Gateway can be tested the same way.
Roll out, then measure live. When a candidate wins, an admin can set it as an agent's default in the coding agent configuration (Beta), which ug applies on developer machines. After rollout, the built-in usage dashboard shows the effect: the Coding Agents tab tracks active days, coding sessions, commits and lines changed; the Performance tab tracks latency percentiles and error rates; and the Cost Observability tab breaks spend down by model and user.
Review traces, not just scores. When Databricks saw scores that "looked too good to be true," it inspected agent traces and found the answers were recoverable from repository history. Trace review is how you catch a broken benchmark.

FAQs

Should I use an LLM judge to grade coding agents?

Not for correctness. Databricks graded its benchmark with held-out tests and avoided an LLM judge, which it found rewards answers that sound right over answers that are right.

Should I benchmark harnesses as well as models?

Yes. In Databricks' tests the same model and thinking effort cost different amounts per task in different harnesses, with the same quality, because harnesses feed the model different amounts of context.

How often should I re-run the benchmark?

Whenever a new model or harness is a candidate. Databricks plans to run every new agent and harness through its benchmark, since new models often fail to improve on the ones already in use.

What should I watch after a rollout?

Cost per user and per model, latency and error rates, and activity in the Coding Agents tab. If cost rises without a matching rise in completed work, revisit the choice.

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.