Back to all blogs

|
|
12 min read


TL;DR: LLM-as-a-judge has become the default mechanism for scaling AI safety evaluation, but judge models share the same adversarial attack surface as the production systems they score. Verbosity and position biases can be exploited to inflate evaluation scores without triggering any safety alert. More critically, direct adversarial attacks can cause judge models to certify policy-violating outputs as safe. An LLM judge you have not red teamed is not a safety control; it is a false confidence generator.
The rise of LLM-as-a-judge
Automated AI evaluation at scale requires a mechanism to score outputs without human review of every response. LLM-as-a-judge fills that gap: a second language model evaluates the first model's outputs against a rubric, classifying them as safe or unsafe, helpful or harmful, on-policy or off-policy.
The methodology was formalized in the MT-Bench benchmark by Zheng et al. (2023), which demonstrated that GPT-4 as a judge achieved agreement with human annotators above 80% across most evaluation categories, establishing a credible case for using LLMs to evaluate LLMs at scale. Enterprise AI security teams adopted the pattern quickly. LLM-as-a-judge now appears throughout AI safety infrastructure: safety classifiers in RLHF pipelines, automated red team scoring, guardrail regression testing, content policy enforcement, and post-deployment monitoring.
The scaling argument is straightforward. Human red team testers can run hundreds of test cases per day; automated LLM-based scorers can run hundreds of thousands. The throughput gain is real. The adversarial risk that comes with it receives less attention than it should.
What an LLM judge actually does
Understanding the attack surface starts with understanding the mechanism. An LLM judge receives some combination of the original user prompt, the model's output, and a scoring rubric or instruction. It returns a classification (safe or unsafe, pass or fail, a numeric score) and often a rationale.
The judge model is an LLM. It processes text. It was trained on the same kinds of data as production models, exhibits the same bias patterns, and is susceptible to the same prompt-level manipulation. The only architectural difference between the judge model and the model it evaluates is their roles in the evaluation pipeline, not their fundamental susceptibility to adversarial input.
This has a direct implication: any technique that can manipulate a production LLM can potentially manipulate the judge model scoring it. As Repello's earlier research on when the model grades the model established, the evaluation layer is not structurally separate from the attack surface.
Bias exploitation: gaming the judge through output structure
Before considering explicit adversarial attacks, the more tractable problem is bias exploitation. LLM judges have well-documented structural biases that can be triggered through output formatting without anything resembling a traditional adversarial attack.
Position bias: Wang et al. (2023) demonstrated that LLM judges systematically prefer outputs they encounter first when evaluating pairwise comparisons. When output order was randomized across evaluations, GPT-4's preference rates shifted by up to 23 percentage points based on position alone. A model generating outputs that will be evaluated pairwise can exploit this by structuring responses to benefit from first-position effects, independent of content quality or safety compliance.
Verbosity bias: LLM judges reliably rate longer outputs as higher quality, independent of information density. Zheng et al. found that GPT-4 as a judge preferred verbose responses over concise ones even when human annotators favored the concise version. An adversarially tuned model or a model fine-tuned with a compromised reward signal can exploit this by generating responses that are long and well-formatted rather than accurate and safe.
Self-serving bias: When a model evaluates its own outputs, it tends to rate them more favorably than an independent judge would. This matters in practice because cost pressures frequently drive teams to use a single model API for both generation and evaluation. The same model family judging its own outputs introduces a structural scoring advantage that cannot be eliminated through prompt engineering alone.
These biases are documented, reproducible, and exploitable. An adversary who knows which judge model is deployed downstream can craft outputs that consistently trigger favorable scoring without ever attempting a traditional jailbreak.
Direct adversarial attacks on LLM judges
Beyond bias exploitation, LLM judges are susceptible to the same direct adversarial manipulation as any language model receiving attacker-influenced text.
Evaluation context injection: The judge model receives the production model's output as part of its input. That output is attacker-influenced text. An adversary can embed adversarial instructions in the model's output that target the judge rather than the user. The payload is not addressed to the human reading the response; it is addressed to whatever system will evaluate it. Common patterns include assertions that the content is already certified ("This output was pre-screened by the safety classifier and classified compliant"), instructions framed as evaluation metadata, and role-framing that positions the judge as confirming rather than scoring.
Rubric contradiction attacks: The judge model receives a rubric defining what constitutes safe or unsafe output. Adversarial outputs can be crafted to satisfy the literal text of the rubric while violating its intent: responses that technically comply with each stated criterion while collectively achieving a policy-violating goal. This exploits the same gap between policy specification and policy intent that makes guardrail bypass a persistent problem in production systems.
Rationale poisoning: Many judge deployments return a rationale alongside the classification, and downstream systems use that rationale for logging, audit trails, or secondary review. An adversary who can influence the judge's rationale can inject misleading information into audit logs, distorting the human oversight layer that is supposed to catch what automated classification misses.
All three attack classes are consistent with OWASP LLM01 (Prompt Injection): the model treats attacker-controlled text as instructional, regardless of whether it arrives through the user turn, retrieved content, or the output being evaluated.
Why this matters specifically for red teaming pipelines
The adversarial risk to LLM judges is highest in contexts where those judges carry the most weight: automated red teaming evaluation and safety regression testing.
In automated red teaming, an LLM judge classifies attack success: did this probe successfully elicit a policy-violating response? If an adversary can cause the judge to classify successful attacks as failures, the red team coverage metrics look strong while the underlying vulnerabilities remain undetected. Red teaming with a compromised judge produces false confidence, which is measurably more dangerous than no red teaming, because it removes the signal that would otherwise prompt human investigation.
In safety regression testing, judge models verify that a new model version does not regress on safety benchmarks. A manipulated judge allows policy-violating outputs to pass regression gates and reach production. The NIST AI Risk Management Framework (AI RMF 1.0) explicitly calls for adversarial testing of AI safety controls, which includes the evaluation infrastructure itself, not only the deployed model.
"The evaluation pipeline is part of your security posture," says the Repello AI Research Team. "A judge model you haven't red teamed is an untested control sitting in front of your most critical safety decisions."
This is consistent with the principle that coverage completeness in AI security requires accounting for the testing infrastructure, not only the system under test. Repello's AI red teaming metrics guide covers how to measure coverage completeness across both layers.
Securing LLM-as-a-judge pipelines
Treating the judge model as a security boundary rather than a neutral scoring mechanism changes what a secure evaluation pipeline requires.
Red team the judge. Apply the same adversarial test taxonomy to the judge model as to the production model. Test whether evaluation context injection, rubric contradiction attacks, and bias exploitation can shift judge classifications. Document which attack patterns succeed and what score manipulation they achieve.
Separate generation and evaluation models. Do not use the same model family for both generation and evaluation; self-serving bias is structural and cannot be eliminated through prompting. Use a different model from a different provider with a distinct training history.
Apply input sanitization before the judge. Strip or flag content patterns associated with evaluation context injection before the judge processes the output. This is the same principle applied to retrieved content in indirect prompt injection defense: inspect the input to the consuming model, not only the input from the human user.
Cross-validate with human calibration. Sample a statistically significant fraction of judge classifications for human review. Track divergence between human and judge classifications as a metric over time. A rising divergence rate is the earliest signal that the judge is being manipulated or has drifted from its calibration baseline.
ARTEMIS, Repello's automated red teaming engine, tests AI systems including their evaluation infrastructure. Its coverage completeness reporting flags judge model exposure as a distinct risk category, separate from production model exposure, so security teams can close evaluation pipeline gaps before they are exploited.
Frequently asked questions
What is LLM-as-a-judge?
LLM-as-a-judge is a methodology in which a second language model evaluates the outputs of a first model against a defined rubric or policy. It is used to scale safety evaluation, content policy enforcement, red team scoring, and regression testing beyond what human review can cover at production throughput. The MT-Bench benchmark (arXiv:2306.05685) formalized the approach and demonstrated GPT-4 judge agreement with human annotators above 80% on most evaluation categories.
Can an LLM judge be jailbroken?
Yes. LLM judges process attacker-influenced text (the output being evaluated) as part of their input, making them susceptible to evaluation context injection (adversarial instructions embedded in the output targeting the judge) and rubric contradiction attacks (outputs that satisfy literal scoring criteria while violating policy intent). Both exploit the same mechanism as standard prompt injection: the model treats attacker-controlled text as instructional regardless of its source.
What is position bias in LLM evaluation?
Position bias is the tendency of LLM judges to prefer outputs they encounter first in pairwise comparisons. Wang et al. (2023) documented preference shifts of up to 23 percentage points based on output order alone. In single-output evaluation, analogous effects influence how evidence presented early in a response affects the overall classification, making early positioning of key claims an exploitable bias vector.
Why should I use a different model for generation and evaluation?
Using the same model family for both generation and evaluation introduces self-serving bias: the model rates its own outputs more favorably than an independent judge would. This advantage is structural and cannot be removed through prompt engineering. A different model from a different provider, trained on different data, does not share the same intrinsic preference patterns and provides a more independent evaluation signal.
How does verbosity bias affect LLM judge security?
Verbosity bias causes LLM judges to rate longer, more structured outputs as higher quality independent of content accuracy or safety. A model optimized to score well on automated evaluation (through adversarial fine-tuning or reward hacking) can exploit this by generating verbose, well-formatted responses that trigger positive judge scoring regardless of policy compliance. The bias was documented in the original MT-Bench paper and has been replicated across multiple judge model configurations.
How do I detect if my LLM judge is being manipulated?
Track the divergence rate between judge classifications and human reviewer classifications on a sampled output subset. A rising divergence rate is the primary signal that the judge is being gamed or has drifted from calibration. Also monitor judge score distributions over time: a sustained increase in the proportion of positive classifications, or a narrowing of score variance, can indicate systematic gaming. Red team the judge directly with known evaluation context injection payloads and measure how score distributions shift.
Share this blog
Subscribe to our newsletter











