Blocking and trailing review
Watcher reviews a running session in two ways. Blocking review evaluates tool calls before they run and can stop them. Trailing review grades the session's trajectory as it grows and surfaces findings after the fact. The dividing line is simple: if a single action could cause irreversible harm, it belongs to blocking review. Patterns that emerge across turns belong to trailing review.
Blocking review runs from the Watcher client on the developer's machine. You configure it through the client's settings: the tool thresholds, command rules, and the enforcement mode. The grading stages always use the managed monitors. These resolve on each machine, but you do not have to set them machine by machine. Admins can distribute and lock them across the organization with managed settings. Gateways can use the same evaluation pipeline through gateway hooks; the caller then applies the returned decisions. Trailing review runs on the Watcher server over ingested sessions and needs no client configuration.
Blocking review
Blocking review evaluates the tool calls a coding agent proposes before they run. Coverage depends on the agent. With Claude Code, every tool call is evaluated. With Codex, review runs through the agent's approval flow, so a call Codex does not ask about executes without a pre-execution decision. That call is still recorded in the session. In observe mode it is graded after it runs; in enforce mode it gets no grade of its own. Codex asks about the commands it considers dangerous, and about anything that needs to reach outside its sandbox. That is why Watcher keeps the sandbox on when it is enforcing. With GitHub Copilot CLI, every native tool call is evaluated before it runs (see GitHub Copilot CLI).
Subagent tool calls can also reach blocking review through the coding agent's hooks. See Subagent coverage for an example and the limits on the context available to that review.
The agent is paused while a call is evaluated, so the pipeline is staged from fastest to slowest. Most calls never reach the slow stages:
- Terminal thresholds. A tool whose thresholds are set to a terminal value is decided instantly: always-allow (both thresholds disabled), always-deny, or always-flag. These outrank everything that follows, including command rules. Setting a tool to always-allow also switches off that tool's command rules, deny rules included.
- Command rules. Match rules that allow, deny, require grading, or send a call straight to human review.
- Triage. A fast, cheap grader scores the call. Triage can only auto-approve: a low-scoring call proceeds immediately, and anything else falls through to gateway review. It never denies or escalates.
- Gateway review. The gateway grader scores the call from 1 to 10. The score is compared against the tool's configured thresholds: at or above the deny threshold the call is denied, at or above the flag threshold it is escalated, otherwise it is allowed.
- Human escalation. An escalated call goes to the coding agent's own
permission prompt, and the developer answers it there. In Codex, the
--approve-for-meoption or the "Approve for me" permission setting hands these prompts to Codex's own auto-reviewer instead (see Supported agents). A Claude Code run started withclaude -pcannot show a prompt, so Watcher denies the call at once. That includes a run that answers prompts through--permission-prompt-tool. Its reason suggests the Auto settings profile, unless the call would escalate under Auto too. When the call escalated because grading failed, the reason suggests checking Watcher's connection and sign-in withwatcher doctor auth, and signing in again withwatcher login. A GitHub Copilot CLI run started withcopilot -plikewise refuses an escalation, because nobody can answer it. Escalations from Claude Code subagents, including background ones, also appear in the main session's prompt. Watcher records the developer's answer, approval or refusal, on the subagent's own session (see Subagent coverage).
By default, every built-in settings profile allows AskUserQuestion and
ExitPlanMode outright, so they are never escalated. The agent still asks its
question, or asks to approve its plan, in its own dialog.
How tool thresholds are selected
Thresholds come from the effective settings, which include built-in defaults,
the organization's settings, and permitted local overrides. An exact tool
entry wins over a matching glob. If several globs match, the last matching
entry wins. A glob such as "mcp__*" covers matching MCP tool names;
"*" matches every name.
The reserved unknown entry supplies fallback values only when no exact
entry, matching glob, or built-in default covers the tool. It is not another
wildcard. With "*" present, unknown is unused. Changing unknown does
not change thresholds for tools that already have entries.
On the client, a new tool gets an exact local entry when additions are
permitted. The entry starts with the matching glob's or fallback's values.
A lock on unknown does not carry over to the new entry. A user-added entry inherits locks from the winning administrator or profile
match. An admin-defined exact entry or a later profile glob can take precedence
over a baseline glob. Auto and Skip Permissions add a later "*". Lock the
collection or document root to preserve thresholds across profile choices. See
locking tool thresholds
for examples and for preventing additions altogether.
Command rule examples
Default command rules can approve routine shell commands without an LLM grade.
Examples include rg --files | sort -u | uniq -c, gh pr checks 123,
and gh run view 456 --log-failed.
These are examples, not a complete list. Approval depends on the command's
flags and pipeline stages. For example, head or tail in these pipelines
needs a numeric line count and no filename. Quoted text that looks like one of
these pipelines can also trigger review.
To check which rules apply on a machine, run watcher settings show --json
there and read its settings.command_rules, or review your organization's
managed settings.
To see which rule decides one call, run watcher rules test on that machine,
for example watcher rules test Bash 'git push --force'. It prints the
matching rule and its action, or says that the call is sent to grading. The
result does not account for the enforcement mode, a snooze or a
.watcher-ignore file, which still apply to the
real call. A command rule's allow never approves a call that Codex asks
permission for: Watcher grades that call instead. A tool threshold set to
always allow still approves it.
Variable expansions and command substitutions need grading because they can change what runs after a rule has matched the text. Directory-stack commands and shell dialects that the rules cannot parse also need grading. Output redirects are checked against file-write rules, including quoted paths and forced overwrites.
Allow rules approve shell commands only for the Bash tool. Watcher treats
other tools as shells too when they have a shell name, such as shell or
exec_command, or when their input has a command or cmd field. That
includes MCP tools. Edit, Write and apply_patch are never treated as
shells. Deny and human-review rules still apply to these other shell calls, but
allow rules cannot approve them, so they go to grading.
Valid deny and human-review rules still apply if another active rule is invalid. Watcher withholds rule-based approvals until the invalid rule is fixed. This prevents a broken restriction from leaving a broader approval rule in force. When managed settings are saved, each active rule must have complete fields and a valid regex of at most 16,384 characters. This includes rules in profiles.
If rule matching times out on part of a command, Watcher keeps checking the
rest of it, and a deny or human-review match found anyway still applies. A deny
match asks for human review instead when an allow or triage rule ahead of it
could not be checked, since that rule might have exempted the command. If a
deny or human-review rule could not be checked, because its search timed out
or the shell command is longer than 131,072 characters, the call asks for human
review on both the client and the gateway. The decision names that rule,
followed by "(rule check timed out)" or "(input too large for rule check)".
Any other incomplete check, where only rules with decision: allow or
decision: triage could not run, goes to grading. In enforce mode, when the
client skips grading, such as while snoozed, it asks for human
review instead. Terminal thresholds take precedence.
The default Bash policy sends suspicious commands to review. It does not deny them automatically. Admins can configure deny rules and thresholds through managed settings.
When grading fails
Watcher records each reviewed call's outcome as a decision on the session, so its escalations and denials are visible in the Analyzer transcript afterward. A subagent's decisions appear on the subagent's own session; see Subagent coverage. Some Codex calls have no decision, such as a call Codex ran without asking that then failed.
If grading fails or exceeds its time budget, Watcher applies the configured failure decision: escalate, deny, or allow. Escalate is the default: a human decides in the coding agent's own permission prompt. When Watcher's local database is what stopped grading, allow does not approve the call in Claude Code; see Local database failures.
Watcher retries transient failures before applying the decision, and applies it right away when another attempt cannot help:
- Retried once (by default). A transient failure where the backend answered but could not grade: it returned a server error or was rate limited, an upstream model provider failed, or the grade came back empty. A short pause, then one more attempt.
- Applied immediately. A refusal that another attempt cannot change: an authentication error, a grader model your deployment does not serve, or a usage limit reached. A transcript too long for the grading model is not a failure: the server removes the middle of what the monitor sees and marks the cut.
- Not retried: a grade that runs out of time. One attempt may use the whole time budget, so there is nothing left to retry with. And a grader slow enough to exhaust the budget would only be slow again.
- Re-probed once: a backend that does not answer. The connection is checked before grading starts. If the check fails, Watcher pauses for one second and checks once more, unless a circuit breaker has paused grading. If both checks fail, the failure decision applies within a few seconds. The second check and pause count toward the grading time budget. In enforce mode, a Watcher client on the machine that is not answering is waited for first: see When the Watcher client is not running.
The client sends each call it cannot decide locally to the Watcher server's gateway hook endpoint, which runs triage and gateway review, or answers with a judgment it already recorded for the same call. A retry sends the call again, triage included. The time budget is for a server that answers slowly, where a gateway review may legitimately need most of it. When triage itself fails, the server still runs gateway review, since triage can only approve a call. When triage runs past its own short time limit, the server starts gateway review and lets triage keep running: if triage then approves the call before gateway review answers, the server approves it and stops the gateway review.
When failures repeat
Repeated failures pause a stage rather than the client. Failures while the deployment is answering are counted against gateway review. If gateway review is failing, the client asks for triage alone, triage keeps auto-approving the calls it can, and only the rest take the failure decision.
The exception is a failure decision of allow. With gateway review paused, every
call would be allowed whichever way triage scored it. So calls are allowed
immediately and not graded at all until gateway review resumes.
Failures that show the deployment itself is unreachable are counted against the deployment instead. Enough of those pause grading on the machine for a minute, and each gated call goes to the coding agent's own permission prompt.
Every pause lifts by itself.
A machine with no usable credentials, such as a signed-out one, does not grade at all. Its hooks step aside, and the coding agent's own permission flow decides each call. See the Watcher client for how the client reports this.
A sign-in problem on an SSO-mode deployment is an exception to the configured
decision. On such a deployment,
a machine that has never signed in, or has signed out, can still grade when it
holds an API key: one set in WATCHER_API_KEY, or one captured from the coding
agent's own requests. If the deployment rejects that grade as unauthenticated,
the call is blocked with a prompt to sign in, not with the configured decision.
The block covers that call only. Grading continues, and later calls are blocked
the same way while the rejections continue. After five rejections in a row the
client stops sending grades, apart from an occasional probe, until one
succeeds. Calls then follow the configured decision, or go to the agent's own
permission prompt when the key was captured. The remedy depends on the key.
A key set in WATCHER_API_KEY is superseded by signing in. A captured key
is used ahead of a stored sign-in, so it must be replaced or removed first.
watcher doctor shows which credential is selected and whether grading is
paused, but it does not validate an API key against an SSO deployment. The
first accepted grade is what confirms recovery. Any other failure kind on such
a machine still follows the configured decision above.
When the Watcher client is not running
The hooks grade calls through the Watcher client running on the developer's machine. So they cannot grade while the client is not running or not answering: while it starts, while it restarts after a crash or an update, or after someone quits it.
In enforce mode, a call that needs grading waits for the client. If the client
answers, the call is graded as usual. If it does not answer within the wait,
Watcher denies the call. The wait lasts about 10 seconds, or up to two minutes
while the client is starting up or updating, counted from when it stopped
answering. The reason says that the Watcher client on the machine did not
respond. It asks the developer to run watcher doctor in a terminal. The agent
may be unable to run diagnostics while the client is down. The call does not
go to a permission prompt, and
the configured failure decision does not apply. The wait covers the outage,
not each call: calls made during the same outage share it. So a long outage
costs one wait, and later calls are denied quickly. Calls that terminal
thresholds or command rules decide never wait. This applies to Claude Code,
Codex and GitHub Copilot CLI.
These cases never wait for the client:
- Observe and paused modes, a snooze, and sessions that a
.watcher-ignorefile covers. They work as this page describes. - A machine with no usable credentials. Its hooks step aside, as described above.
- The one-minute pause after repeated failures to reach the deployment, described above.
When the client answers but the Watcher server or the grading provider fails, the call takes the configured failure decision.
In enforce mode, keep the client running. Quitting it does not turn review
off: calls that need grading wait and are then denied. To stop reviews on purpose,
snooze grading, add a .watcher-ignore file where your organization allows it,
or ask an admin to change the enforcement mode.
Denial limits
An agent that keeps being denied is stuck in a loop that more denials will not resolve. So two limits turn a would-be gateway denial into a human escalation instead:
- After two consecutive gateway denials, the next one escalates.
- After ten gateway denials since the developer last interacted (a new prompt, or answering an escalated call in the coding agent's permission prompt), the next one escalates. This applies even when allows were interspersed; only a human interaction resets that count. A refusal Claude Code makes by itself does not reset it.
Both counts belong to one session. A subagent's calls belong to its own session, so it has its own counts.
Denials from terminal thresholds and command rules never count toward either
limit, and always stand. Both limits apply in enforce mode only, including
under the Auto profile. So in a claude -p run, Watcher denies a denial-limit
escalation without suggesting the Auto profile. The limits are tunable in the
client settings' admin-only enforcement block:
escalate_after_consecutive_denies (default 2) and
escalate_after_accumulated_denies (default 10).
Enforcement modes
The client's enforcement mode controls what blocking review does with its judgments:
- Enforce. Decisions take effect: denials block the call, escalations go to the coding agent's own permission prompt.
- Observe. The pipeline grades calls in the background and records what it would have decided. Claude Code and GitHub Copilot CLI start this work when a call is proposed; Codex starts it after the call runs. The agent does not wait for grading, even when grading is slow or fails. Its own permission rules still apply, so it may still ask the developer to approve a command. Observe mode is useful for tuning thresholds and measuring grading cost before turning enforcement on.
- Paused. Watcher decides nothing: grading stops, and neither command rules nor tool thresholds run, so even an always-deny threshold or a deny rule does not block. Every call falls through to the coding agent's own permission flow, and the client still records the call. Paused works the same way for gateway hooks, which only ingest the transcript.
These modes govern how Watcher reviews ordinary tool calls. One restriction
applies whatever the mode: Watcher always refuses Codex's request_permissions
tool, which would otherwise widen Codex's sandbox for the rest of a turn or
session. See Codex specifics.
A .watcher-ignore file skips LLM grading for
the sessions it covers, and keeps them from being uploaded. Unlike paused mode,
it never turns off the deterministic checks: command rules and tool thresholds
still decide those sessions' calls.
Snoozing
Snooze temporarily skips LLM grading without changing the enforcement mode. In enforce mode, command-rule denials and requests for human review still apply. Calls without a rule decision use the coding agent's own permission flow. Observe and paused modes keep the behavior described above.
On macOS, choose Snooze grading in the Watcher menu on the menu bar, pick 1, 4 or
8 hours, and enter a reason. Resume grading ends a snooze early. The menu
offers snoozing only when your organization's snooze.enabled setting allows
it. Snoozes can only be started from the Watcher menu bar. Restarting Watcher
ends an active snooze. Linux has no snooze control.
Trailing review
Trailing review runs asynchronously on the Watcher server. Nothing on the developer's machine configures it. Two built-in jobs run today:
- Summaries. Each session gets a title and short summary, written by a background job. The first comes at the session's first Triage call (asked of the Triage model, describing the session as that call saw it), then a refresh at any later Triage call once the latest summary is at least 15 minutes old. When Triage stops, the scheduled pass summarizes from the last Triage call, if it came after the latest summary, within an hour of that call. A session no Triage call reached gets its first summary 15 minutes after it starts, and a session idle for 12 hours whose summary misses its latest activity gets one fresh summary. The scheduled summaries need async grading.
- Deep Review. A session gets a second, more thorough security review once it has been quiet for an hour, if a tool call in it has a gateway review score of 7 or higher. Triage scores and command-rule decisions do not count. Only sessions active in the past 24 hours qualify, and a session is reviewed at most once every 24 hours. The background job that writes a requested report writes these too.
A session without a deep review shows a Generate report button in the
Analyzer to its owner and to users with sessions:grade:any (which admins have
by role). Content access is not required. It queues a deep review of the
session's latest transcript, and the report appears
when the review finishes, which can take several minutes. Asking again for an
unchanged transcript returns the same review. A queued or running review
shows as Report queued or Grading in progress to everyone who opens
the session. When a session's report predates its latest activity, the same
users see an Update report button beside it; while the newer review is
queued or running the header shows Updated report queued or Updating
report, and the old report stays until the new one replaces it. If
a review fails, the same users can Retry it; each retry counts against the
organization's monthly grading limit. Scheduled reviews retry a failure on
their own a few times per transcript, an hour apart, unless the transcript itself
caused it, for example by being too long for the model.
A scheduled review and a requested one for the same transcript are the same
job, so requesting a review the schedule already queued moves it ahead of
other queued work rather than starting a second one. To request and poll a review from your own
tooling, use the
Python SDK or HTTP API.
Trailing review never blocks the agent and never feeds anything back into the agent's context. Its grades appear in the Analyzer, alongside grades from any other grader. Sessions whose scores reach your organization's flag threshold are flagged for review, and can trigger a Slack notification (see organization settings).
What drives the schedule when you self-host
Two containers share the work. Both run the xylon-api image with a
different entrypoint, so neither is a separate image to deploy or review.
xylon-operation-workerwrites every session summary and every Deep Review, whether the schedule queued it or a user requested it with Generate report. It always runs and requires PostgreSQL 17 or later. Without it, that work stays queued.xylon-grading-schedulertriggers the scheduled passes every five minutes by default. It asks the API to queue the summaries and Deep Reviews each organization's recent sessions are due for. The scheduler reads no session content, holds no provider keys, and contacts no provider.
The async-grading Compose profile starts the scheduler, and .env.example
enables it for new installs. The
Kubernetes Helm chart runs both
the scheduler and the worker by default. Without the scheduler, a deployment
still records sessions, clients and gateway hooks still evaluate individual
tool calls, and summaries still follow Triage calls. Scheduled Deep Reviews
and the scheduled summaries described above do not run. See
Update Watcher for update instructions.
Choosing what goes where
| Blocking review | Trailing review | |
|---|---|---|
| Evaluates | one tool call, before it runs | the trajectory so far |
| Can interrupt the agent | yes | no |
| Latency budget | seconds; the agent is paused | generous; runs behind the session |
| Suited to | irreversible single actions: destructive commands, secret exposure, dangerous infrastructure changes | cross-turn patterns: wrong diagnoses, premature completion claims, ignored instructions, scope creep |
| Results appear in | the coding agent's permission prompt (live) and the Analyzer (as decisions) | the Analyzer (as grades) |