Rerun is now open source under AGPL-3.0Star us on GitHub
Rerun

LLM as a Judge for AI Agents: Build One You Can Trust

How to build an LLM-as-a-judge you can trust for AI agents: rubrics, calibration, bias fixes, and when to skip the judge and use a human approval.

LLM as a Judge for AI Agents: Build One You Can Trust

GPT-4 agreed with human preferences more than 80% of the time, which is the same level of agreement humans reach with each other. That is the headline finding of the Zheng et al. 2023 study that put llm as a judge on the map, and it explains why nearly every eval pipeline now has a model grading another model's work.

But that result came from chat answers, where a bad grade costs you a slightly wrong leaderboard. Agents are different. They call tools, change records and send messages. Agreement on a chat answer does not mean a model is safe to grade, or approve, something that acts.

This guide covers the judge technique itself: how to build a judge you can trust, which biases will fool it, and when to skip it entirely. For the wider metrics landscape, see our guide to LLM evaluation. For test suites and harnesses, see AI agent testing. Here we stay on the judge.

The short version:

  • An LLM judge is a measurement instrument, not an authority. Calibrate it against human labels before you trust it.
  • Agents need trajectory grading, not just answer grading, because the path matters as much as the result.
  • Three biases (position, verbosity, self-preference) are well documented and each has a cheap mitigation.
  • Use code assertions where a check is objective, a judge where it is fuzzy, and a human where the action is irreversible.

In a hurry? Pause risky agent actions for a human approval, free for 5 days.

What is LLM-as-a-judge?

LLM-as-a-judge is a technique where one model scores or ranks the output of another model against a written rubric. You use it when the quality you care about, such as tone, policy adherence or helpfulness, cannot be checked with an exact match or a regex.

The three setups

SetupHow it worksBest for
Single-answer gradingThe judge scores one output against a rubric (pass/fail or a short scale)Production monitoring, regression checks
Pairwise comparisonThe judge picks the better of output A and output BModel or prompt A/B tests
Reference-guided gradingThe judge compares the output to a known good answerTasks with a gold answer but flexible wording

Where it fits in the eval stack

A judge sits between deterministic checks and human review. It is cheaper and faster than humans, and more flexible than assertions. Think of it as the middle layer, never the only one. Our LLM evaluation guide maps the full stack.

Why llm as a judge works, and the evidence behind it

The reason this technique spread so fast is economic. Human labelling is slow and expensive, and a strong model can grade thousands of outputs for the price of a few expert hours.

Judging LLM-as-a-Judge with MT-Bench and Chatbot ArenaJudging LLM-as-a-Judge with MT-Bench and Chatbot ArenaEvaluating large language model (LLM) based chat assistants is challenging due to their broad capabilities and the inadequacy of existing benchmarks in measuring human preferences. To address this, we explore using strong LLMs as judges to evaluate these models on more open-ended questions. We examine the usage and limitations of LLM-as-a-judge, including position, verbosity, and self-enhancement biases, as well as limited reasoning ability, and propose solutions to mitigate some of them. We then verify the agreement between LLM judges and human preferences by introducing two benchmarks: MT-bench, a multi-turn question set; and Chatbot Arena, a crowdsourced battle platform. Our results reveal that strong LLM judges like GPT-4 can match both controlled and crowdsourced human preferences well, achieving over 80% agreement, the same level of agreement between humans. Hence, LLM-as-a-judge is a scalable and explainable way to approximate human preferences, which are otherwise very expensive to obtain. Additionally, we show our benchmark and traditional benchmarks complement each other by evaluating several variants of LLaMA and Vicuna. The MT-bench questions, 3K expert votes, and 30K conversations with human preferences are publicly available at https://github.com/lm-sys/FastChat/tree/main/fastchat/llm_judge.arXiv.org

The evidence base is now broad:

  • MT-Bench and Chatbot Arena showed that strong judges approximate human preference at scale, with caveats we cover below.
  • G-Eval combined rubrics with chain-of-thought scoring, which became the template for most modern judge prompts.
  • Prometheus showed that a smaller open model, trained on rubrics, can act as a judge.
  • The survey of LLM-as-a-judge maps the field and its open problems.

The takeaway is simple. Judges are good enough to be useful and flawed enough to need supervision.

Why agents are harder to judge than chatbots

A chatbot produces text and stops. An AI agent produces a trajectory: a chain of reasoning, tool calls and side effects. Grading only the last message misses most of what can go wrong.

Outputs are trajectories, not just answers

Logs and traces are what make this visible, which is why AI agent observability matters before any judge does. An agent can reach a plausible final answer through an unsafe path. It might query the wrong customer record, skip a required check, or call a tool it should never have touched. A judge that sees only the final message will happily pass it.

Side effects cannot be undone by a score

A low score after the fact does not unsend an email or reverse a refund. Chat evals can afford to be wrong in aggregate. Action-taking systems cannot afford to be wrong on the single run that matters.

Long traces degrade judge quality

Judges lose accuracy on long, noisy transcripts. Grade step by step, or summarise the trace into the facts the criterion needs: which tools were called, with what arguments, and what came back.

Agent-as-a-Judge, and why it is not free

The Agent-as-a-Judge paper proposes using an agent that inspects intermediate steps instead of just the final output. On its code-generation benchmark it outperformed a plain LLM judge and came close to a human baseline. It also costs more per grade and inherits the same blind spots if built on the same model family. Treat it as a tool for high-value traces, not a default.

A judge that only reads the final answer is grading the paperwork, not the work.

Rerun dashboard showing live logs of every action for trajectory review

How to build an LLM judge you can trust

Most attempts at llm as a judge fail for the same reason: the rubric is vague. These steps fix that.

Write a narrow, binary-leaning rubric

  • Grade one criterion per judge. "Is this good?" is not a criterion. "Does the reply cite the refund policy accurately?" is.
  • Prefer pass/fail or a three-point scale over 1 to 10. Fine-grained scores look precise and are mostly noise. Hamel Husain's judge guide makes the same case for binary verdicts with a written critique.
  • Ask for reasoning before the verdict, so the model commits to evidence first.
  • Include explicit failure examples in the rubric.

Here is a starting llm judge prompt you can adapt:

Single-answer judge rubric (JSON output)
{
  "role": "You are a strict evaluator of AI agent runs.",
  "criterion": "The agent drafted a refund reply that follows the refund policy and does not promise anything outside it.",
  "inputs": {
    "task": "{{customer_request}}",
    "agent_output": "{{final_reply}}",
    "tool_trace": "{{tools_called_with_arguments_and_results}}",
    "policy": "{{refund_policy_text}}"
  },
  "instructions": [
    "Read the tool trace first. Note any tool call that was unnecessary or unsafe.",
    "Write 2 to 4 sentences of reasoning that cite specific evidence.",
    "Only then give a verdict. Do not reward length or confident tone.",
    "If the evidence is insufficient to decide, answer UNSURE."
  ],
  "fail_examples": [
    "Promises a refund above the policy limit",
    "Quotes a policy clause that does not exist"
  ],
  "output_format": {
    "reasoning": "string",
    "verdict": "PASS | FAIL | UNSURE",
    "confidence": "0.0 to 1.0"
  }
}

Choose the judge model deliberately

Use a stronger model than the agent, or at least a different model family. Run it at low temperature. For very high volume, a small fine-tuned judge can be cheaper, as Prometheus demonstrated.

Calibrate against humans

This is the step most teams skip, and it is the one that makes the judge trustworthy.

  1. Hand-label 50 to 100 real outputs, using the same rubric.
  2. Run the judge on the same set.
  3. Measure agreement, plus the true-positive and true-negative rates, not just overall accuracy. A judge that always says PASS can look accurate on a mostly good dataset.
  4. Rewrite the rubric where they disagree, and repeat.
  5. Re-calibrate whenever the agent, the judge model or the task changes.

A good rule of thumb is to keep iterating until the judge agrees with your labelling about as often as two of your reviewers agree with each other. That is a heuristic, not a standard.

A worked example: calibrating a refund-reply judge

Say a support agent drafts 400 refund replies a week. You hand-label 80 of them: 62 acceptable, 18 not. You run the judge above on the same 80 and compare.

MetricFirst rubricAfter two rewrites
Overall agreement with humans78%90%
Catches bad replies (true negatives)8 of 1816 of 18
Wrongly fails good replies3 of 624 of 62

These numbers are illustrative, but typical of the pattern. The first rubric looks fine on overall agreement and still lets more than half the bad replies through. That is why you read the true-negative rate, not just accuracy. The rewrites that helped were boring: naming the exact policy clauses, adding two failure examples, and forcing the judge to quote the sentence it was grading.

Once the judge clears your bar, freeze the rubric, version it, and sample a few judged outputs every week to catch drift. Judges do not decay on their own, but your agent, your policy and your customers do.

Aggregate and sample

Run the judge more than once on important cases and take a majority vote. In pairwise mode, always swap the order and run twice. That brings us to the biases.

Known biases when you use llm as a judge, and how to mitigate them

BiasWhat it isMitigation
Position biasThe judge prefers the first (or last) answer regardless of qualitySwap order and run twice, count only consistent verdicts
Verbosity biasLonger answers score higherPenalise padding in the rubric, compare at equal length
Self-preference biasA model favours its own style of outputUse a judge from a different model family
Weak reasoningJudges mis-grade maths and logicProvide a reference answer or a deterministic check
Prompt sensitivitySmall rubric wording changes shift scoresFreeze the rubric, version it, re-calibrate on change

The evidence is specific. Zheng et al. documented position, verbosity and self-enhancement effects. Wang et al. showed that simply reordering candidate answers can flip rankings. Shi et al. studied position bias systematically across judges. Panickssery et al. found that models recognise and favour their own generations.

The practical consequence: a judge score is a signal with known error bars, never ground truth. Eugene Yan's survey of LLM evaluators reaches a similar conclusion from the practitioner side.

When NOT to use an LLM judge

Using llm as a judge is not always the right call, and this is the section most guides leave out.

  • Irreversible or high-stakes actions. Payments, outbound emails, data deletion, legal or medical content, anything with brand risk. A judge can flag these. It should not clear them.
  • Anything with an objective check. If you can assert it in code (valid JSON, exact match, a tool that must or must not be called), do that. It is free, instant and deterministic.
  • No human-labelled calibration set. Without one, you do not know whether the judge is right.
  • Judge and agent share a model. Shared blind spots mean shared mistakes.
  • Tiny samples. With 20 outputs, read them yourself.

A simple decision order works well:

What judges cannot replace: human approvals

A judge is a triage layer. It decides which outputs are probably fine, so humans spend their attention on the ones that are not.

Here is a concrete flow for a support workflow where an agent drafts refunds:

Judge resultAction
High-confidence PASS, low-value refundProceed automatically
UNSURE or low-confidenceSend to a human
FAILBlock and log the reason
Any refund above a set thresholdAlways require approval, whatever the judge says

The last row is the important one. No judge, however well calibrated, takes responsibility for an irreversible action. That is why human-in-the-loop approval is a separate layer rather than a feature of the judge.

Where does Rerun fit? Rerun is not an eval framework and not an agent framework. It is the operations layer around whichever agents and eval tooling you already use. On Rerun, agents are called coworkers: they run on schedules and triggers, and they pause for a human approval before consequential actions, then resume exactly where they stopped. It does not write your judge rubric or run your eval suite for you. Pair it with the tooling you already trust, and use it for the part judges cannot do: getting the right decision in front of the right person at the right moment.

Approval card where a coworker pauses before a refund and waits for a human decision

This is also where Zapier, Make or n8n flowcharts fall short. A flowchart can route on a score, but it has no judgment about what to do when the score is borderline, and a chatbot waits to be asked instead of working on its own. For more on the human layer, see our guide to AI agent guardrails and our post on AI agent observability.

A practical rollout checklist

The short version: use llm as a judge to scale what you can measure, and keep a human on what you cannot afford to get wrong. If you are building the surrounding stack, our guide to the agent harness covers the software that wraps the model.

LLM Evaluation: Benchmarks, Evals & LLM-as-Judge Explained

LLM Evaluation: Benchmarks, Evals & LLM-as-Judge Explained

LLM evaluation goes beyond benchmarks: learn evals, LLM-as-a-judge, RAG and agent trajectory scoring, and how to run evaluation continuously in production.

Frequently asked questions

What is LLM-as-a-judge?

LLM-as-a-judge is a technique where one language model scores or ranks another model's output against a written rubric. It is used to grade qualities such as tone, accuracy or policy adherence that cannot be checked with an exact match.

How accurate is an LLM judge compared to humans?

In the Zheng et al. MT-Bench study, a strong judge agreed with human preferences more than 80% of the time, similar to agreement between humans. That result holds for chat-style tasks with a strong judge. For your own task you should measure it by hand-labelling 50 to 100 outputs and comparing.

Can a model judge its own output?

It can, but it is risky. Research on self-preference bias shows models tend to favour their own generations. Use a judge from a different model family than the agent whenever you can.

Which model should be the judge?

Use a stronger model than the agent, or at least a different family, at low temperature. For high volume, a smaller fine-tuned judge such as Prometheus can cut cost. Always validate the choice against human labels.

Is an LLM judge enough to evaluate an AI agent?

No. A judge grades text and plausibility, but agents act through tool calls and side effects. Combine deterministic checks, a calibrated judge on the trajectory, and human approval for irreversible or high-stakes actions.

What are the main biases of LLM judges?

The best documented are position bias (preferring the first or last answer), verbosity bias (preferring longer answers) and self-preference bias (favouring its own style). Swapping answer order, penalising padding and using a different judge family mitigate them.

When should I not use LLM-as-a-judge?

Skip it when a code assertion can check the result, when you have no human-labelled calibration set, when the judge shares the agent's model, and when the action is irreversible. In those cases use deterministic checks or a human approval.

How do human approvals fit with an LLM judge?

The judge is triage. High-confidence passes on low-stakes work proceed, low-confidence or flagged outputs go to a person, and irreversible actions always need approval. On Rerun, coworkers pause for that approval and resume where they stopped.

Back to blog

Related articles

2,000+ businesses run on Rerun

Hire Coworkers on the ChatGPT plan you already pay for.

  • 1. Plug in your subscription
  • 2. Set up your Coworkers
  • 3. Run your business with Coworkers