Skip to content

[DOCS] Document the auto-with-judge agent mode and judge.yaml #633

Closed

Description

@inference-gateway-maintainer

[DOCS] Document the auto-with-judge agent mode and judge.yaml

Implementing PR: inference-gateway/cli#1147 (resolves inference-gateway/cli#1147)

Summary

The CLI gained a new agent mode, auto-with-judge, and a new approval behaviour, tools.safety.approval_behaviour: judge: an LLM judge decides approval-requiring tool calls against the user's latest request instead of a human. It is configured through a new .infer/judge.yaml sidecar (model, timeout, max_tokens, on_error, prompt) with INFER_JUDGE_* env overrides, plus an infer headless --mode auto-with-judge flag. Disabled by default; standard/plan/auto behavior is unchanged.

Affected pages

  • docs/configuration-reference.md - document tools.safety.approval_behaviour: judge and the new judge.yaml file (next to hooks.yaml / reminders.yaml), including INFER_JUDGE_* env overrides and the fail-fast rule when no judge model is resolvable
  • docs/shortcuts-guide.md - auto-with-judge in the Shift+Tab cycle and its display name "Auto+Judge"
  • New page: docs/judge-mode.md - how the judge gate works (input = latest non-hidden user message + pending tool call, JSON verdict contract, on_error deny/allow, judge_verdict event, headless --mode)
  • docs/browser-extension-protocol.md - already updated in the implementing PR (mode frame now carries the canonical keys standard, plan, auto, auto-with-judge)

Acceptance

  • judge.yaml documented next to hooks.yaml / reminders.yaml in the configuration reference
  • shortcuts guide lists auto-with-judge in the mode cycle
  • judge-mode page covers the verdict contract, on_error semantics, observability, and headless usage
  • ASCII only, no en/em dashes (plain hyphens)

Activity

  1. added
    documentation
    on Sep 2, 2026
  2. edenreich commented on Sep 2, 2026

    @edenreich
    Contributor

    Review follow-ups on the implementing PR (inference-gateway/cli#1148) changed the user-facing surface. Please fold these into the pages listed above:

    • judge.yaml gained system_prompt (the judge's instructions, sent as a system message) and gateway_url (send judge calls to a different gateway than the agent's, e.g. a real judge while the driver runs against the mock). The default prompt is now a user-message template that wraps the intent and tool call in <user_request> and <tool_call> tags; the instructions live in system_prompt. New env overrides: INFER_JUDGE_SYSTEM_PROMPT, INFER_JUDGE_GATEWAY_URL.
    • A judge rejection no longer ends the turn. It becomes a failed tool result whose content reads rejected by judge: <model>: <reason>, and the driver continues with that reason. Only a human rejection ends the turn.
    • The judge model is visible everywhere: the AUTO+JUDGE mode indicator shows AUTO+JUDGE - <model>, the TUI flash reads Action rejected by judge policy (<model>): <reason>, and the judge_verdict line (json, ag-ui, debug) carries a model field.
    • With debug logging on, every judge call also emits a judge_request debug event with the model, system prompt, and rendered user prompt.
    • Judge token usage is added to session totals and telemetry under the judge model, so /stats shows the judge on its own row when it runs on a different model than the agent.
    • tools.safety.approval_behaviour: judge is the only setting that makes config validation require a resolvable judge model; the auto-with-judge mode is validated by the headless runner at start (--mode or INFER_AGENT_MODE).

    The in-repo pages docs/judge-mode.md and docs/configuration-reference.md on the PR branch already reflect all of this and can be used as the source text.

  3. moved this to Todo in 2026on Sep 2, 2026
  4. added theissue type on Sep 2, 2026
  5. edenreich commented on Sep 2, 2026

    @edenreich
    Contributor

    @claude Can you work on this? use /ponytail:ponytail

  6. inference-gateway-maintainer commented on Sep 2, 2026

    @inference-gateway-maintainer
    ContributorAuthor

    Claude finished @edenreich's task in 5m 0s —— View job • docs/issue-633-20260902-1907 • [Create PR ➔](https://github.com/inference-gateway/docs/compare/main...docs/issue-633-20260902-1907?quick_pull=1&title=Issue%20%23633%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23633%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)


    Done - PR #634

    • Gathered context (source text pulled from the merged CLI PR cli#1148, including the review follow-ups)
    • New page cli-judge-mode.md
    • Updated cli.md (mode cycle, Auto+Judge section, config-file table, approval_behaviour, judge_verdict event)
    • Registered the page in both sidebar sections
    • bun run lint:md, bun run format:check, bun run build all pass; anchors verified against built HTML
    • Committed and opened the PR

    What changed

    This repo does not mirror the CLI repo's docs/ filenames, so the content was mapped onto the existing structure: a standalone cli-judge-mode.md page (sibling of cli-hooks.md) plus targeted edits in the big cli.md reference.

    New cli-judge-mode.md covers: entering the mode (Shift+Tab -> Auto+Judge, --mode auto-with-judge, INFER_AGENT_MODE, browser-bridge mode keys), what reaches the judge, the JSON verdict contract, the full judge.yaml schema (model, gateway_url, timeout, max_tokens, on_error, system_prompt, prompt with {root_intent}/{intent}/{action}) and all seven INFER_JUDGE_* overrides, on_error deny/allow semantics, model resolution and the fail-fast rules, approval_behaviour: judge without the mode, and observability (judge_verdict with model, judge_request debug event, TUI flash, judge tokens in session totals/telemetry//stats). Rejections are documented as failed tool results (rejected by judge: <model>: <reason>) that continue the turn - only a human rejection ends it.

    cli.md: Shift+Tab cycle, mode table row, new "Auto+Judge Mode" section, judge.yaml next to hooks.yaml/reminders.yaml in the configuration-files table, judge row in the approval_behaviour table plus the validation note (config validation only requires a judge model for approval_behaviour: judge; the mode is validated by the headless runner), a judge_verdict row in the headless stream-event table, and a pointer from "Headless secure-by-default".

    ASCII only, no en/em dashes in the new text. Three pre-existing em dashes elsewhere in cli.md were left untouched as out of scope - say the word if you want them cleaned up too.
    | Branch

  7. moved this from Todo to In progress in 2026on Sep 2, 2026
  8. moved this from In progress to QA in 2026on Sep 2, 2026
  9. moved this from QA to Done in 2026on Sep 3, 2026
  10. inference-gateway-releaser commented on Sep 22, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.9.14 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationreleased

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions