Writing your grounding judge
[PLACEHOLDER — outline only, not full prose yet.]
samples/agents/grounding-judge/ in the Gateway repo is a working starting
point, used in Turn on grounding as
written. This guide is about what to change and why, once the bundled
default isn’t quite right for a specific step.
Planned sections
Section titled “Planned sections”- Start from the sample, don’t write one from scratch. Its
soul.mdalready encodes the two things that actually matter — no outside knowledge, and a claim that restates the given task needs no evidence. Rewriting those from zero is the most likely way to accidentally lose one of them. - Model choice: usually the cheapest model that follows instructions
reliably. Cross-referencing a claim against a transcript is a
constrained, mechanical task, not open-ended reasoning — it doesn’t need
the same model as the primary agent it’s judging. The real requirement is
reliably returning the exact JSON shape, including the
reasoning.claimslist, every time; if a cheap model drifts off-format under real traces, that’s the signal to move up, not before. - Keep
tools: [], deliberately. A judge that can browse or query isn’t cross-referencing anymore — it’s a second investigator, and its score stops meaning “was this backed by the primary’s own evidence.” Resist adding tools even when it would make the judge “smarter.” - Size
max_tokensto the step’s claim count, not a guess. The grounding-accuracy troubleshooting guide covers this as a symptom (a parse failure, not a low score) — this section is the design-time version: a step whose output routinely makes many load-bearing claims needs a judgemax_tokenssized for a proportionally longreasoning.claimslist from the start, not discovered after the first parse failure in production. - One shared judge, or several domain-specific ones?
grounding.agentdefaults togrounding-judgebut is settable per step — when a generic judge is the right default (most steps), and when a step’s evidence is specialised enough (ticket-ID formats, dashboard UID conventions) that a step-specific judge with a slightly more informedsoul.mdcatches more than a generic one would. - Trust the judge before you enforce it. Grounding’s shadow mode
exists exactly for this — watch its verdicts against steps you can
manually verify for a while before flipping
enforce: true, the same discipline Choosing confidence thresholds recommends for the primary agent’s own threshold.
Where next
Section titled “Where next”- Grounding — the full judge contract and config reference.
- Turn on grounding — the hands-on tutorial this guide is the deeper companion to.
- Grounding keeps flagging real evidence as
unsupported — the
max_tokenssizing problem from the symptom side.