Evals for Engineers: Build the Harness That Runs on Every Change

The engineer's complete guide to AI evals: traces, datasets as code, code graders, calibrated AI judges, agent trials, CI gates, statistics, and cost.

Falk Gottlob · · 23 min read

AI Agents Falkster cover on green: a row of boxes on a conveyor belt passing through an inspection arch with a red lamp on top, one box tipped off into a bin.
5/6
SeriesEvals From Zero

Most AI bugs aren't crashes. Nothing throws an error. The model simply answers a little worse than it did yesterday, because someone changed a prompt, a model version, or a retrieval setting. No unit test notices, because unit tests check exact outputs, and AI doesn't give exact outputs.

An eval harness is how you notice. It's the test suite for behavior that varies. This guide is the engineering version: how to build one, wire it into your build pipeline, make its numbers trustworthy, and keep the bill reasonable. If you're new to the ideas, read Evals From Zero: The Complete Guide to Testing AI Products, for Everyone first. This part assumes the basics and goes straight to the build.

The short version

  • An eval harness is a test suite for AI behavior. Log every request and response first, so you can build tests from real traffic.
  • Keep the test set in your repository, versioned, with a column for who labeled each case. Grade with code wherever you can, since it's free and stable.
  • Use an AI judge only for judgment calls, with one question per judge. Check that judge against human labels before trusting it.
  • For agents, grade the final outcome and run each task several times.
  • Run a fast check on every pull request and the full suite every night. Report ranges, not single numbers.

The anatomy of a harness

Every eval system I've seen that works has the same five parts. Anthropic's engineering post "Demystifying evals for AI agents" gives the shared vocabulary. A task is one test with defined inputs and success criteria. A trial is one attempt. A grader is the logic that scores it. A transcript is the full record. The outcome is the final state when the trial ends.

PartWhat it doesWhere it lives
TracesRecords every real request, every step, and every outputYour logging or tracing system
DatasetThe fixed test cases, with labels and where they came fromYour repository, versioned
RunnerRuns each case, often several times, in a clean environmentA script or an eval framework
GradersScore each output: code checks, AI judges, or peopleYour repository, next to the dataset
GateCompares scores to thresholds and passes or fails the buildYour build pipeline

Anthropic's post makes the ownership point too: "For AI product teams, owning and iterating on evaluations should be as routine as maintaining unit tests." Same review process, same repository, same standards.

Step 1: Log everything before you need it

Your best test cases will come from real traffic. You can only use traffic you recorded. OpenAI's evaluation guide says it plainly: "Log as you develop so you can mine your logs for good eval cases."

Record the whole transcript, not just the final answer. For an agent, that means every model call, every tool call with its arguments and results, and the final state. When something goes wrong in production, you want to replay the exact request.

{
  "trace_id": "tr_2026_11_25_8812",
  "timestamp": "2026-11-25T14:03:11Z",
  "app_version": "support-agent@4.12.0",
  "prompt_version": "refund-policy-v7",
  "model": "provider/model-name@2026-10",
  "user_segment": "enterprise",
  "input": {"message": "My mug arrived cracked, I want my money back", "account_id": "acct_hash_93f1"},
  "steps": [
    {"type": "retrieval", "query": "refund policy damaged item", "doc_ids": ["kb_412", "kb_077"]},
    {"type": "tool_call", "name": "lookup_order", "args": {"account_id": "acct_hash_93f1"}, "result_summary": "1 order, delivered 11-21"},
    {"type": "model_call", "tokens_in": 2140, "tokens_out": 162, "latency_ms": 1830}
  ],
  "output": "I'm sorry about the mug. Under our policy, damaged items get store credit...",
  "final_state": {"credit_issued": false, "ticket_status": "awaiting_customer"},
  "feedback": {"thumb": "down", "reason": "didnt_answer_question"},
  "pii_redacted": true
}

Two fields people forget: the prompt version and the model version. Without them, you can't tell which change caused a regression. And redact personal data before it reaches your trace store, not after.

Step 2: Treat the dataset as code

Your test set is a file in your repository. It gets reviewed in pull requests, versioned, and tagged. A score is meaningless unless you know which version of the set produced it.

JavaScript Object Notation (JSON) is a plain text data format. Its JSON Lines variant puts one case per line, which is easy to review in a diff.

{"id": "refund-001", "slice": "refund", "input": {"message": "My mug arrived cracked, I want my money back"}, "context": {"policy_doc": "kb_412"}, "checks": ["no_unsupported_promise", "order_ids_exist", "under_120_words"], "expected": {"credit_issued": false}, "label_source": "human:ana", "label_confirmed_by": "human:lee", "added": "2026-11-20", "origin": "trace:tr_2026_11_18_0412", "split": "regression"}
{"id": "refund-002", "slice": "refund", "input": {"message": "refund pls order 4471"}, "checks": ["order_ids_exist"], "expected": {"mentions_order": "4471"}, "label_source": "human:ana", "label_confirmed_by": null, "added": "2026-11-21", "origin": "complaint", "split": "capability"}

Some fields earn their place.

label_source and label_confirmed_by. Who decided this case is right. A label written by a model and never checked by a person measures agreement with a model. That's not the same as correctness.

origin. Which real trace or complaint the case came from. When the case fails a year from now, someone will ask why it exists.

split. Anthropic separates two kinds of set. Capability evals measure what the system can't do yet, so they "should start at a low pass rate." Regression evals guard what already works, so they sit at "a nearly 100% pass rate." Run them separately. A regression set failing blocks a merge. A capability set improving is good news but blocks nothing.

slice. The group the case belongs to. You'll report scores per slice, because averages hide broken groups.

How big? Anthropic says "20-50 simple tasks drawn from real failures is a great start." Grow it from there with every bug report. Anthropic's test for case quality applies to every row: "A good task is one where two domain experts would independently reach the same pass/fail verdict."

Step 3: Code graders first

Code checks are free, instant, and never drift. Use them for everything they can answer. Anthropic lists tool call verification among its code-based graders, along with checks on output format and final state.

import json
import re

def check_schema(output: str) -> tuple[bool, str]:
    """The reply must be valid JSON with the fields the front end needs."""
    try:
        data = json.loads(output)
    except json.JSONDecodeError as e:
        return False, f"not JSON: {e}"
    missing = {"answer", "sources"} - data.keys()
    return (not missing, f"missing fields: {sorted(missing)}" if missing else "ok")

def check_order_ids_exist(output: str, account_orders: set[str]) -> tuple[bool, str]:
    """Every order number in the reply must exist on the customer's account."""
    mentioned = set(re.findall(r"\b\d{4,6}\b", output))
    invented = mentioned - account_orders
    return (not invented, f"invented order ids: {sorted(invented)}" if invented else "ok")

def check_citations_resolve(sources: list[str], retrieved_ids: set[str]) -> tuple[bool, str]:
    """Every cited source must be one the system actually retrieved."""
    bad = [s for s in sources if s not in retrieved_ids]
    return (not bad, f"cites unretrieved docs: {bad}" if bad else "ok")

def check_tool_calls(steps: list[dict]) -> tuple[bool, str]:
    """The agent must look up the order before issuing any credit."""
    names = [s["name"] for s in steps if s["type"] == "tool_call"]
    if "issue_credit" in names and "lookup_order" not in names[: names.index("issue_credit")]:
        return False, "issued credit before looking up the order"
    return True, "ok"

def check_final_state(final_state: dict, expected: dict) -> tuple[bool, str]:
    """Grade the outcome: did the environment end up where it should?"""
    diffs = {k: (final_state.get(k), v) for k, v in expected.items() if final_state.get(k) != v}
    return (not diffs, f"state mismatch: {diffs}" if diffs else "ok")

Every grader returns a pass or fail and a reason. The reason matters. When the build fails at 2 a.m., the person on call needs to know why without opening a notebook.

Step 4: AI judges, done properly

Some checks need judgment. Is the answer supported by the retrieved documents? Did it answer the question that was asked? A code rule can't decide that. A second large language model (LLM), used as a judge, can, if you build and test it carefully.

Build it narrow

One judge, one question. A judge asked to rate helpfulness, accuracy, and tone at once does all three badly, and you can't tell which part failed.

Make it answer pass or fail. Hamel Husain and Shreya Shankar's evals FAQ is the standard reference here: "Binary evaluations force clearer thinking and more consistent labeling." Ask for reasoning before the verdict, and put the verdict on its own line so you can parse it.

You are grading one property of an AI support reply. Grade only this property.

PROPERTY: Every factual claim in the reply is supported by the provided documents.
A claim is supported if a document states it or directly implies it.
Greetings, apologies, and offers to help are not factual claims.

DOCUMENTS:
<documents>
{retrieved_documents}
</documents>

REPLY:
<reply>
{reply}
</reply>

EXAMPLES OF THE BOUNDARY:
<examples>
{two_pass_and_two_fail_examples_from_the_train_split}
</examples>

Steps:
1. List each factual claim in the reply, one per line.
2. For each claim, quote the supporting sentence from the documents, or write NONE.
3. On the final line, write exactly one of:
VERDICT: PASS
VERDICT: FAIL

Know its biases

The foundational study is Zheng and colleagues' 2023 paper "Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena". It found strong judges reached "over 80% agreement" with human preferences, about the same rate at which humans agree with each other. It also named three biases.

BiasWhat it isWhat to do
Position biasFavoring an answer because of where it appears, like first in a comparisonIn side-by-side comparisons, run both orders. If the verdict flips, record a tie
Verbosity biasFavoring longer answersGrade one property at a time. Add length as its own code check
Self-enhancement biasFavoring outputs written by the same modelUse a different model family for judging than for generating

Later research on that last one, by Arjun Panickssery and colleagues in 2024, asked whether models recognize their own writing when they favor it. The practical takeaway hasn't changed: don't let a model grade its own homework.

Biases vary by model and change with new versions. Test them on your own judge with your own data, instead of assuming a paper's numbers still hold.

Calibrate it against people

This is the step that makes the judge's numbers mean something. Husain and Shankar give the recipe. Label 100 to 200 examples per failure type, using a trusted expert. Split them: 10 to 20% as examples you can put in the prompt, 40 to 45% to tune on, and 40 to 45% held out for one final test. Where possible, include 30 to 50 passes and 30 to 50 failures in each of the tune and test sets.

Then measure two rates separately. The true positive rate: of the real failures, how many did the judge catch? The true negative rate: of the real passes, how many did it let through? Don't use plain accuracy. On a set that's 90% good, a judge that passes everything scores 90% accuracy and catches nothing.

import json

def calibrate(judge, labeled_path: str, split: str = "test") -> dict:
    """Compare judge verdicts with human labels on one split. Run once on 'test'."""
    tp = fn = tn = fp = 0
    misses, false_alarms = [], []
    for line in open(labeled_path):
        case = json.loads(line)
        if case["split"] != split:
            continue
        human_fail = case["human_label"] == "FAIL"
        judge_fail = judge(case) == "FAIL"
        if human_fail and judge_fail:
            tp += 1
        elif human_fail:
            fn += 1
            misses.append(case["id"])
        elif judge_fail:
            fp += 1
            false_alarms.append(case["id"])
        else:
            tn += 1
    return {
        "true_positive_rate": tp / max(tp + fn, 1),   # failures caught
        "true_negative_rate": tn / max(tn + fp, 1),   # good outputs passed
        "n_fail": tp + fn,
        "n_pass": tn + fp,
        "missed_failures": misses,
        "false_alarms": false_alarms,
    }

Read every miss and false alarm by hand. Most of the time, the rubric is ambiguous, and fixing the wording fixes the judge.

Then recheck on a schedule. I once shipped a classifier that scored 89% on held-out data and 61% in production within six weeks. Nothing in the code changed. The traffic did. I now keep a short card per judge, with its threshold, its two rates on the last 100 labeled cases, and a date for the next check. It's in The Threshold Card: Tune the Judge Before You Trust the Score, and Date the Re-Tune.

Step 5: Agents need their own rules

An agent takes actions: it calls tools, changes records, sends messages. Grading one is different from grading a chatbot reply.

Grade the outcome. Anthropic's advice: "it's often better to grade what the agent produced, not the path it took." Agents find valid paths you didn't anticipate. If the refund was issued correctly, it rarely matters that the agent checked the order history first. Check the final state with code. Add path checks only for rules that matter, like "never issue credit before looking up the order."

Isolate every trial. Anthropic: "Each trial should be 'isolated' by starting from a clean environment." An agent that leaves a record behind can make the next trial pass or fail for the wrong reason. Reset the database, the files, and any caches.

Run several trials. Outputs vary, so one run tells you little. Anthropic: "Because model outputs vary between runs, we run multiple trials to produce more consistent results."

Report pass^k, not just the average. Pass@k is the chance at least one of k tries succeeds. Pass^k is the chance that all k succeed. For a customer-facing agent, pass^k is the honest one. Anthropic's example: 75% success per try gives about 42% success on three tries in a row. Sierra introduced pass^k with its tau-bench benchmark in 2024. It reported that GPT-4o, the best agent it tested, fell to about 25% on eight tries in a row in the retail test.

from math import comb

def pass_at_k(n: int, c: int, k: int) -> float:
    """Chance at least one of k samples passes, given c passes out of n trials."""
    if n - c < k:
        return 1.0
    return 1.0 - comb(n - c, k) / comb(n, k)

def pass_hat_k(n: int, c: int, k: int) -> float:
    """Chance all k samples pass, given c passes out of n trials (k <= n)."""
    return comb(c, k) / comb(n, k)

# Example: 10 trials, 8 passed
# pass_at_k(10, 8, 3)  -> 1.0
# pass_hat_k(10, 8, 3) -> about 0.47

Fail closed when the judge goes quiet. If your safety check times out or errors, the agent should stop, not continue unchecked. I wrote about one company that gets this right in Shopify's Attack Agent Dies When Its Judge Goes Quiet. Most Agents Keep Going..

Keep the eval balanced. Anthropic again: "One-sided evals create one-sided optimization." If you only test that the agent issues refunds when it should, you'll train it to issue refunds. Test the cases where it shouldn't, too.

Step 6: Wire it into continuous integration

Continuous integration (CI) is the automated pipeline that runs tests on every change before it merges. Here's what good looks like at two companies that published the details.

Dropbox described its setup for Dash, its AI search tool: "Every pull request kicked off about 150 canonical queries, which were judged automatically and returned results in under 10 minutes." After a merge, the full suite reran, with quick checks for speed and cost. "If anything crossed a red line, the merge was blocked." Their hard limits included a minimum score for finding the right sources and a cap on slow responses. And for each release, their engineers manually reviewed 5 to 10% of the regression suite.

about 150

test queries ran on every pull request at Dropbox, judged automatically and back in under 10 minutes.

GitHub described its testing for Copilot: "We run more than 4,000 offline tests, most of them as part of our automated CI pipeline." One clever part: around 100 real code repositories that pass their tests. They break the code on purpose, then check whether the model can fix it so the tests pass again.

Handle the randomness

The hardest part of AI in CI is noise. Run the same case twice and the output can change. A build that fails at random gets ignored, and then it's useless.

OpenRouter's October guide on gating pull requests has the practical rules. Run each case several times and take a majority vote. Don't invent the threshold. "Measure the threshold from repeated runs against an unchanged branch rather than picking a strict number," the guide says. Run your suite a few times on the main branch with no changes, see how much the score moves on its own, and set the gate outside that range.

Then split the work by cost. Run a small, fast set on every pull request. Run the full set with more repetitions nightly. Quarantine any case that flips back and forth on an unchanged branch until someone fixes it.

# .github/workflows/evals.yml
name: evals
on:
  pull_request:
    paths: ["prompts/**", "src/agent/**", "evals/**", "config/models.yaml"]
  schedule:
    - cron: "17 6 * * *"   # nightly full suite

jobs:
  pr-gate:
    if: github.event_name == 'pull_request'
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@v4
      - run: pip install -r evals/requirements.txt
      - name: Regression set, 3 samples per case, majority vote
        run: python evals/run.py --set evals/regression.jsonl --samples 3 --gate evals/gates.yaml --cache .evalcache
        env:
          MODEL_API_KEY: ${{ secrets.MODEL_API_KEY }}
      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: eval-report
          path: evals/out/report.md

  nightly-full:
    if: github.event_name == 'schedule'
    runs-on: ubuntu-latest
    timeout-minutes: 90
    steps:
      - uses: actions/checkout@v4
      - run: pip install -r evals/requirements.txt
      - name: Regression + capability sets, 5 samples, pass^3, per-slice report
        run: python evals/run.py --set evals/regression.jsonl --set evals/capability.jsonl --samples 5 --pass-hat-k 3 --by-slice --report evals/out/nightly.md
        env:
          MODEL_API_KEY: ${{ secrets.MODEL_API_KEY }}
# evals/gates.yaml: thresholds measured from 10 runs on unchanged main, 2026-11-20
regression:
  no_unsupported_promise: {min_pass_rate: 0.97, hard: false}
  order_ids_exist:        {min_pass_rate: 1.00, hard: true}
  schema_valid:           {min_pass_rate: 1.00, hard: true}
  grounded:               {min_pass_rate: 0.93, hard: false, judge: grounded-v3, judge_calibrated: 2026-11-18}
latency:
  p95_ms: {max: 5000}
cost:
  per_case_usd: {max: 0.004}

The dates in the gate file aren't decoration. When a threshold looks wrong, the date tells you when it was last measured.

The same idea in plain text

You don't need a fancy setup to start. This site, falkster.com, fails its own build on a writing eval. A script scores every new post for reading level, sentence length, and unexplained acronyms. If a post misses the bar, a test fails and the post can't ship. It's a code grader with a threshold, run on every change. Every post you're reading in this series passed it.

Step 7: Read the numbers honestly

Eval scores are estimates from samples. Treat them that way.

Anthropic's research team wrote the reference on this, "A statistical approach to model evaluations". Three ideas from it matter day to day.

Report a range. A 95% confidence interval is the mean plus or minus 1.96 times the standard error. Eugene Yan works an example in his product evals post. Observe a 3% failure rate on 200 samples, and the true rate could be anywhere from about 0.6% to 5.4%. With 400 samples, the range narrows to about 1.3% to 4.7%. Cutting the range in half takes four times the data.

Compare in pairs. When testing version B against version A, run both on the same cases and compare case by case. Anthropic calls paired-difference analysis a "free" way to cut noise.

Watch for related cases. If ten cases all come from one long document or one customer, they aren't ten independent samples. Anthropic found that on popular evals, properly adjusted error bars "can be over three times as large" as the naive ones. Group related cases and adjust, or your ranges will look tighter than they are.

Put the range in the report. An engineer who sees "91% (87% to 94%)" won't panic over a one-point dip.

Step 8: Evaluate in production too

Offline evals run on a fixed set before release. Online evals grade a sample of real, live traffic. You need both.

Sample live traces, run your validated judges on them, and track the pass rates over time. A drop in production with no change in your offline scores means the traffic has shifted. That's your signal to add new cases from real failures.

Fin, the AI support agent made by Intercom, combines the two well. Pedro Tabacof, a principal machine learning scientist there, described their backtests in "Why not just ship it?". "We take a few thousand real past conversations and replay them offline through two versions of the system." Same inputs, both versions, compared side by side. Then changes ramp: dark at 0%, invisible to users, then 1%, then more, "with health checks at each step."

Spotify's November 19 post, "When Can You Ship on Offline Evals Alone?", is required reading for anyone tempted to skip live tests. Mårten Schultzberg shows how measurement noise misleads you. In his worked example, a naive estimate says the offline eval explains 24% of the variation in live results, while the true figure is 60%. His proposed gate: ship when the offline gain is large, kill when the loss is large, and run a live A/B test in between. One more of his findings matters for judges: "The important distinction is not whether the judge is biased, but whether the bias depends on the treatment arm." A judge that's harsh on every version is fine. One that's harsh only on version B is not.

Step 9: Keep the bill sane

Evals cost money, mostly from AI judge calls and repeated samples. OpenRouter's formula is a good start: cost is the cases, times the samples per case, times how often relevant pull requests are opened. Multiply by the price of each judge call.

The levers, in order of impact:

  1. Code graders first. Every check that moves from a judge to code is free forever.
  2. Run only when it matters. Trigger the eval job only when prompts, agent code, or model config change. Most pull requests don't touch them.
  3. Cache. If the input, prompt version, and model version are the same, reuse the output.
  4. Tier your judges. A cheaper judge screens everything. The expensive judge checks only the borderline cases and the ones that gate risky actions.
  5. Small set per pull request, full set nightly. Dropbox's 150 per pull request is a good scale to aim for.

Track cost per case in the report, right next to the scores. It's a product metric, and your product manager will want it.

The tools, briefly

You can build all of this with a few scripts. Tools help with tracing, dashboards, and running at scale. Here's what's out there as of late November 2026.

ToolWhat it is
InspectOpen-source eval framework from the UK AI Security Institute
promptfooOpen-source command-line tool for evals and red-teaming, with CI integration
DeepEvalOpen-source eval framework that plugs into pytest
RagasOpen-source evals focused on retrieval-based systems
BraintrustHosted tracing, evals, and monitoring
LangSmithHosted tracing with offline and online evals
Arize PhoenixOpen-source observability and evaluation
GitHub Copilot EvalsEvals for Copilot skills, agents, and tools, in public preview since November 17, 2026

One warning that's timely. OpenAI is deprecating its hosted Evals platform. Its guide says existing evals became read-only on October 31, 2026, and the platform is scheduled to shut down on November 30, 2026. If you're on it, export now. The general lesson: keep your test cases and graders in your own repository, in plain formats. Tools come and go. Your test set is the asset.

Mistakes I see in engineering teams

Building the judge before reading outputs. The judge ends up measuring whatever its author guessed mattered.

Accuracy as the judge metric. It hides a judge that never fails anything.

One run per case. A single sample of a random process is an anecdote.

Thresholds picked by feel. Measure the noise on an unchanged branch first.

A judge from the same model family as the generator. It tends to like its own writing.

No version on the test set. Then a score change could be the code or the cases, and nobody knows which.

No production sampling. The offline set ages. Live traffic tells you when.

This week

Pick your most important AI feature. Write down every place its behavior can change: prompts, model version, retrieval settings, tools. Then answer one question: if any of those changed today, what test would fail? If the answer is "none," start here. Pull 30 real traces, write five code checks that would have caught a past bug, and wire them into a pipeline job that runs when those files change.

The full engineering pack on this page has the trace schema, dataset format, graders, judge template, calibration script, and CI workflow. The rest of the Evals From Zero series covers the product manager, designer, forward deployed engineer, and chief product officer side, which is where your thresholds should come from.

This guide is part of the argument on Enterprise AI Agents: what counts is the work an agent still finishes correctly months after launch, and the harness is how you know.

Related answer: How do you run AI evals in continuous integration?

Sources: Mikaela Grace, Jeremy Hadfield, Rodrigo Olivares, and Jiri De Jonghe, "Demystifying evals for AI agents," Anthropic Engineering, January 9, 2026 · Anthropic, "A statistical approach to model evaluations," November 19, 2024 · Hamel Husain and Shreya Shankar, "AI Evals: Everything You Need to Know," September 18, 2026 · Lianmin Zheng and colleagues, "Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena," 2023 · Arjun Panickssery, Samuel Bowman, and Shi Feng, "LLM Evaluators Recognize and Favor Their Own Generations," 2024 · Ranjitha Gurunath Kulkarni, Ameya Bhatawdekar, and Gonzalo Garcia, "A practical blueprint for evaluating conversational AI at scale," October 2, 2025 · Connor Adams and Klint Finley, "How we evaluate AI models and LLMs for GitHub Copilot," GitHub, January 17, 2025 · OpenRouter, "How to gate pull requests on LLM evals in CI," October 1, 2026 · Karthik Narasimhan, "τ-Bench," Sierra, June 20, 2024 · Eugene Yan, "Product Evals in Three Simple Steps," November 23, 2025 · Pedro Tabacof, "Why not just ship it?," Fin Ideas, August 28, 2026 · Mårten Schultzberg, "When Can You Ship on Offline Evals Alone?," Spotify Engineering, November 19, 2026 · OpenAI, "Evaluation best practices." The code, schemas, and gate file are my own templates; the numbers in them are illustrations.

Share this post

Downloadable bundle · 1 files

Pick your level. Grab the JD.

Copy into your ATS, fork for your org, or send to a recruiter as-is.

Frequently asked

How do you run AI evals in continuous integration?+

Treat prompts, model choices, and retrieval settings as code. On every pull request, run a fixed test set, grade it automatically, and fail the job when a score crosses its threshold. Dropbox ran about 150 queries per pull request with results in under 10 minutes, and blocked merges that crossed a red line.

How do you handle randomness in AI evals?+

Run each case more than once and use a majority vote or a pass rate. Set thresholds from repeated runs on an unchanged branch, so normal noise doesn't fail the build. Run a larger, more repeated suite nightly instead of on every pull request to control cost.

How do you validate an LLM-as-a-judge?+

Label examples by hand, at least 100 to 200 per failure type as Hamel Husain and Shreya Shankar recommend. Split them into a small set for prompt examples, a set to tune on, and a held-out test set. Report how many real failures the judge catches and how many good outputs it passes, separately.

What biases do LLM judges have?+

The 2023 MT-Bench study by Zheng and colleagues names three: position bias (favoring an answer because of where it appears), verbosity bias (favoring longer answers), and self-enhancement bias (favoring their own outputs). Swapping answer order and using one criterion per judge help. Test your own judge, since behavior varies by model.

How should you evaluate AI agents?+

Grade the outcome, meaning the final state of the environment, rather than the exact path. Start each trial from a clean environment, run several trials per task, and report pass^k, the chance that all k tries succeed. Check tool calls with code where you can.

Which eval tools should I use?+

Keep your test cases and graders in your own repository so you can switch tools. Inspect, promptfoo, DeepEval, and Ragas are open source. Braintrust, LangSmith, and Arize Phoenix add tracing and dashboards. OpenAI's hosted Evals platform is scheduled to shut down on November 30, 2026.

How much do evals cost to run?+

Roughly the number of cases, times samples per case, times how often you run them, times the cost per grading call. Code graders are nearly free. Run cheap checks on every pull request and the expensive, repeated suite nightly.

AI evalsengineersLLM-as-a-judgeagent evalspass^kcontinuous integrationDropboxGitHub Copilot
Helpful?

Keep reading

The short answer

Building Evals: Error Analysis, Eval Types, the Loop, the GateTeresa Torres's three steps as a weekly routine, plus the fourth step that turns an eval from a scoreboard into what decides what an agent may do alone.Read the chapter

Part of

Enterprise AI Agents

About the author

Falk Gottlob

Falk Gottlob

Product Executive · Founder, Falkster.AI

Thirty years shipping product, from Microsoft Research and Adobe to Salesforce, where he grew Quip into what became Slack Canvas. Four startup exits, including a $6.5B healthcare merger and a company Microsoft bought. Four-time Chief Product Officer. Now founder of Falkster.AI, building Heidi, the company brain for AI-native businesses. This notebook is written from inside the build, not above it.

Sign in with LinkedIn to leave a comment.

Sign in with LinkedIn