AgentJudge
Gate every tool call through a judge model — set scope, rubrics, and transcript strategies from the TUI.
AgentJudge interposes a second LLM — the judge — between the agent and every tool call. Before a tool runs, the judge reads the agent’s intent, the proposed call, and a rubric you define, then returns allow, deny, or ask (escalate to you). The agent stays autonomous; the judge is the guardrail.
Activate it with /policy guard and a judge_model:
/policy guard judge_model=anthropic/claude-haiku-4-5The context bar switches to guard · anthropic/claude-haiku-4-5 and every tool call now routes through the judge before execution.
How the judge decides
Section titled “How the judge decides”On each tool call, the judge receives:
- The rubric — your policy rules (what’s in scope, what’s off limits).
- A transcript slice — a filtered view of the agent’s conversation, controlled by the transcript strategy.
- The proposed tool call — tool name and arguments.
The judge responds with one of:
| Decision | What happens |
|---|---|
| Allow | Tool call executes normally. |
| Deny | Tool call is blocked. By default the agent sees a [POLICY DENIED] message with the judge’s reason and replans (configurable via on_deny — see Deny behavior). |
| Ask | The rubric marks this capability as ASK — a permission prompt appears for the operator to approve or reject. (The judge denies when uncertain, not asks.) |
Defining scope
Section titled “Defining scope”You tell the judge what’s allowed through a rubric — the rules it applies to every tool call. There are three ways to set one up, from simplest to most granular.
Presets
Section titled “Presets”Named baselines that cover common pentesting postures:
/policy guard judge_model=anthropic/claude-haiku-4-5 preset=recon_only/policy guard judge_model=anthropic/claude-haiku-4-5 preset=standard_pentest/policy guard judge_model=anthropic/claude-haiku-4-5 preset=red_team| Preset | What it allows |
|---|---|
recon_only | Reconnaissance and basic operations (file reads, process management, network connections). Everything else is denied — exploitation, credential access, privilege escalation, lateral movement, persistence, defense evasion, collection, exfiltration, and impact. |
standard_pentest | Recon + exploitation (except custom exploits) + credential access (except spraying/brute-force/keylogging/phishing) + privilege escalation (domain escalation requires approval via ASK) + lateral movement + defense evasion (except log tampering/timestomping/indicator removal) + collection (except clipboard/email/audio). No persistence, no exfiltration beyond data staging, no impact, no file deletion. |
red_team | Everything except impact (data destruction, service disruption, ransomware, defacement, resource hijacking). |
Presets are rendered into natural-language rubric text that the judge reads — they aren’t magic tokens. You can preview the rendered rubric via the /policy scope modal (see below).
Freeform rubric
Section titled “Freeform rubric”A plain-text string appended to the default safety-floor rules:
/policy guard judge_model=anthropic/claude-haiku-4-5 rubric=no-credential-brute-forcing,target:api.example.comThe default safety rubric is always included unless you explicitly replace it. It denies:
- Destructive system operations (
rm -rf,drop database, process kills outside the agent’s own) - Credential/secret exfiltration to external destinations
- Privilege escalation without clear in-scope justification
- Network calls to destinations not implied by the task
- Writes outside the agent’s working directory that the user did not request
To replace the default entirely (use with caution):
/policy guard judge_model=anthropic/claude-haiku-4-5 rubric=read-only,no-writes,no-deletes,no-network replace_default_rubric=truePreset + rubric combined
Section titled “Preset + rubric combined”A preset sets the baseline; a freeform rubric adds project-specific rules on top:
/policy guard judge_model=anthropic/claude-haiku-4-5 preset=standard_pentest rubric=target:10.0.1.0/24,avoid:10.0.1.5Interactive scope editor (/policy scope)
Section titled “Interactive scope editor (/policy scope)”For fine-grained control, open the scope modal:
/policy scopeThis opens a three-view editor:
- Preset picker — start from
recon_only,standard_pentest,red_team, or a blank slate. - Capability editor — expand 11 capability categories (reconnaissance, exploitation, credential access, privilege escalation, lateral movement, persistence, defense evasion, collection, exfiltration, impact, operations) and toggle each subcategory to allow, deny, or ask using the
a/d/skeys. - Rubric preview — see the scope portion of the rubric rendered as natural language. Note: this shows only the scope rules, not the default safety rubric or any freeform
rubrictext.
Transcript strategies
Section titled “Transcript strategies”The transcript strategy controls how much of the agent’s conversation the judge sees alongside the proposed tool call. More context helps the judge make better decisions but costs more tokens and increases the risk of prompt injection from tool outputs.
/policy guard judge_model=anthropic/claude-haiku-4-5 preset=standard_pentest transcript_strategy=intent_only| Strategy | What the judge sees | When to use it |
|---|---|---|
rubric_only | Only the rubric and the proposed tool call. No conversation context. | Cheapest option. Works when your rubric is self-contained and the judge doesn’t need to understand the task to make a decision (e.g. blanket “no network calls”). |
intent_only | System prompt + user-authored messages. No assistant turns, no tool history. | When the task prompt alone gives enough context. Good balance of cost and accuracy for well-scoped tasks. |
intent_plus_calls | System prompt + user messages + prior tool calls the agent made (tool names and arguments only — no tool outputs, no assistant reasoning). This is the default. | Best general-purpose choice. The judge sees what the agent is doing without being influenced by what it’s saying or what tools returned. |
intent_plus_outputs_summary | Same as above + one-sentence LLM-generated summaries of each tool’s output (each unique output is summarized once and cached for the session). | When tool outputs contain information the judge needs (e.g. “the nmap scan found port 22 open, so SSH is now a reasonable next step”). Adds a summarization call per unique tool output. |
full | The entire trajectory — system prompt, user messages, assistant reasoning, tool calls, and raw tool outputs. | Maximum context. Use only when the judge needs the full picture. Highest cost and highest prompt-injection risk. |
Context budget and trimming
Section titled “Context budget and trimming”The transcript is trimmed to fit the judge model’s context window. When trimming is needed, the oldest messages are dropped first — but two messages are always preserved:
- The system message — so the judge always has its instructions.
- The first user message — so the judge always sees the original task prompt.
This means even in a long session, the judge never loses sight of what the agent was originally asked to do.
Deny behavior
Section titled “Deny behavior”When the judge denies a tool call, the on_deny parameter controls what happens next:
/policy guard judge_model=anthropic/claude-haiku-4-5 preset=standard_pentest on_deny=retryon_deny | Behavior |
|---|---|
retry (default) | The agent sees a [POLICY DENIED] message with the judge’s reason and gets a chance to choose a different approach. |
finish | The turn ends immediately. Use for strict enforcement where a single out-of-scope attempt should halt the agent. You can still send a follow-up message to continue. |
Error handling
Section titled “Error handling”If the judge model itself errors (network failure, malformed response, context overflow):
/policy guard judge_model=anthropic/claude-haiku-4-5 on_judge_error=denyon_judge_error | Behavior |
|---|---|
deny (default) | End the turn immediately. Fail closed — the agent cannot continue past a judge error. |
allow | Allow the tool call to proceed. Fail open — logs a warning but lets the agent continue. Use only if you prefer availability over safety. |
fail | Raise a hard error and halt the turn. |
Regardless of the setting, if the error is a judge model authentication failure, AgentJudge disables itself for the rest of the session to prevent a retry loop. Subsequent tool calls pass through ungated.
Updating AgentJudge config mid-session
Section titled “Updating AgentJudge config mid-session”AgentJudge config merges with the previous config, so you can change individual parameters without restating everything:
/policy guard judge_model=anthropic/claude-haiku-4-5 preset=recon_only# ... agent does recon work ...
# Escalate scope to standard pentest without re-specifying judge_model/policy guard preset=standard_pentest
# Tighten transcript strategy/policy guard transcript_strategy=intent_onlyChoosing a judge model
Section titled “Choosing a judge model”The judge runs on every tool call, so model choice directly affects cost, latency, and how many violations slip through. ScopeJudge benchmarks eight judge models across five transcript strategies on ~5,000 expert-labeled tool calls and recommends two operating points:
| Operating point | Model | Strategy | Recall | F1 | ~$/1k calls | When to use |
|---|---|---|---|---|---|---|
| Cost-sensitive | glm-5.2 | intent_plus_calls | 0.87 | 0.64 | $3.22 | General use — catches most violations at low cost. Best overall F1 of any judge tested. |
| Recall-first | anthropic/claude-opus-4-8 | intent_only | 0.94 | 0.55 | $4.20 | High-stakes deployments that prioritize catching violations over false positives. |
An open-weight recall-first alternative is glm-5.2 with the full strategy (86% recall, F1=0.66, $6.01/1k calls) for teams that want high recall without a proprietary model.
The judge adds at least one LLM call per tool call. With intent_plus_outputs_summary, each previously unseen tool output also triggers a summarization call (summaries are cached per session, so repeated outputs are free). Factor this into long-running autonomous sessions.
Caching
Section titled “Caching”AgentJudge prompt caching is on by default (cache=true) — cache-control markers are attached to the rubric, system instructions, and the rolling transcript prefix so that repeated content can be served from cache. Actual cache behavior depends on your model provider. Disable it if you need to:
/policy guard judge_model=anthropic/claude-haiku-4-5 cache=falseQuick-reference examples
Section titled “Quick-reference examples”Recon-only sweep of a target network:
/policy guard judge_model=anthropic/claude-haiku-4-5 preset=recon_only rubric=target:192.168.1.0/24,dns:internal.corp.localStandard pentest with explicit boundaries:
/policy guard judge_model=anthropic/claude-haiku-4-5 preset=standard_pentest rubric=scope:web.target.com+api.target.comRed team with minimal guardrails:
/policy guard judge_model=anthropic/claude-haiku-4-5 preset=red_team on_deny=retryStrict mode — halt on first policy violation:
/policy guard judge_model=anthropic/claude-haiku-4-5 preset=standard_pentest on_deny=finish on_judge_error=failBudget-conscious — rubric-only strategy with minimal context:
/policy guard judge_model=anthropic/claude-haiku-4-5 rubric=no-network-outside-10.0.0.0/8 transcript_strategy=rubric_onlyDropping back to other modes
Section titled “Dropping back to other modes”AgentJudge is a session policy like any other. Switch away at any time:
/interactive # back to manual approval/auto # autonomous, no judge/policy guard # re-enable guard