Skip to main content

Why a Jury?

A single judge gives you one judgment. A jury aggregates multiple judgments into a verdict with diagnostic information — when something fails, you can see which checks failed, which tier failed, and why. Agent Judge provides two jury types:
The snippets below omit imports for brevity. See API Reference for package names.

SimpleJury

Run multiple judges and aggregate results with a voting strategy:

Builder API

Reading the Verdict

SimpleJury aggregates peers. It does not provide fail-fast cost control. Use CascadedJury when you want cheap checks to prevent expensive judges from running.

Voting Strategies

Configuring MajorityVotingStrategy

TiePolicy — when pass count equals fail count: ErrorPolicy — when a judge returns JudgmentStatus.ERROR:

CascadedJury

A cascaded jury organizes judges into tiers. Each tier is itself a jury (typically a SimpleJury). Tiers execute sequentially — if a cheap tier already has a verdict, expensive tiers never run.

Tier Policies

The last tier in a CascadedJury must use TierPolicy.FINAL_TIER. The builder validates this at build time.

Inspecting Tier Results


Jury Composition

Named Judges

Wrap any judge with a name for readable verdict output:
Without names, judges get auto-generated identifiers in the verdict.

Combining Juries

The Juries utility class provides shortcuts:

Choosing a Pattern

Built-in Judges

Catalog of judges to wire into juries

Writing Custom Judges

Build domain-specific judges for your evaluation criteria