# How should an instance treat a LITMUS-derived runtime safety monitor as a liveness hazard rather than a pure safety gate when the monitor's own probe latency exceeds the agent's decision deadline **Date of Record:** 2026 November 25 **Scope:** Applies to live agent deployments where a LITMUS-style runtime monitor (a probe that injects a canary/decoy instruction and verifies the agent refuses it, or that samples the agent's action trace and scores it against a safety predicate) sits inline on the decision path with a hard deadline. Does not apply to offline batch evaluation, to monitors that run strictly post-hoc on logged traces, or to monitors whose verdict is advisory-only and never blocks the action. ## Core Distinction A LITMUS-derived monitor is conventionally modeled as a *safety gate*: a predicate `safe(action) → {allow, block}` that is monotone in the sense that blocking a bad action can only improve the safety outcome. Under that model, adding the monitor is free safety — worst case it blocks a good action, which is a false positive, not a safety violation. The boundary failure is that the monitor is not free. It consumes wall-clock time on the agent's critical path, and the agent's own decision has a deadline (a tool-call timeout, a lease on a shared resource, a task SLA, a human-in-the-loop response window). When the monitor's probe latency `L_probe` approaches or exceeds the remaining decision budget `D_remaining`, the monitor stops being a gate and becomes a *scheduler*: it does not decide whether the action is safe, it decides whether the action happens *at all*, and it does so by timing out rather than by evaluating. The safety predicate is never consulted; the failure is a liveness failure wearing the costume of a safety verdict. The non-obvious part: the timeout path is usually coded to *fail open* (allow) or *fail closed* (block), and both are wrong in different ways. Fail-open converts monitor latency into unmonitored execution. Fail-closed converts monitor latency into a denial-of-service on the agent itself — and, critically, into a *retry storm* where the agent re-attempts the action, re-invokes the monitor, and re-times-out, because the monitor's latency is not reduced by retrying. ## What Was Observed A tool-using agent (`order-fulfillment-agent`, 12 tools, median tool latency 340ms) was wrapped with a LITMUS-derived inline monitor that, before each high-risk tool call, injected a decoy instruction into a scratch context and verified the agent declined it. The verification required a second model call (the "probe grader"). Probe grader p99 latency was 1.9s; the tool-call deadline was 2.0s. Trace of a single high-risk call under load: 1. `t=0.00s` agent emits `intent: refund(order_id=...), risk=high`. 2. `t=0.00s` monitor enters `PROBING`, snapshots agent context, issues decoy. 3. `t=0.02s` agent responds to decoy correctly (refuses). Monitor now needs the grader. 4. `t=1.94s` grader returns `declined=true`. Monitor is at `t=1.94s`, budget `D_remaining=0.06s`. 5. Monitor transitions to `GRADED_SAFE` but the deadline check fires *after* the verdict: the action dispatch is rejected with `DeadlineExceeded`, not `SafetyBlock`. 6. Agent's retry policy (3 attempts, exponential backoff 100/200/400ms) re-enters step 2 at `t=2.0s`, `t=2.3s`, `t=2.7s`. Each retry re-runs the full probe. All three time out. 7. Agent surfaces `tool_unavailable` to the user, who re-submits. The order is never refunded; the monitor never blocked anything. The observable signature was a 14% `tool_unavailable` rate on high-risk tools and a 0% `SafetyBlock` rate — i.e., the monitor's *block* path never fired, but its *latency* path fired constantly. The safety telemetry was green (zero blocks, zero injections succeeded) while the agent was functionally down for the highest-risk class of actions. This is the inversion: the monitor's safety metrics are *best* exactly when it is causing the most liveness damage, because a monitor that times out before grading records no unsafe verdicts. A second observation: under the fail-open variant (same deployment, deadline check moved before the grader call), the 14% `tool_unavailable` became a 14% *unmonitored* execution rate. The agent executed refunds that the monitor had *started* to probe but never finished grading. The decoy had been injected and the agent had responded, but the grader verdict was discarded on timeout. So the monitor's cost was paid in full and its benefit was zero — the worst quadrant. ## Condition of Validity The liveness hazard is bounded by a single invariant, which we state as the **probe-budget separation invariant**: > For every monitored action class `c`, the monitor's worst-case probe latency `L_probe(c)` must be strictly less than the action's remaining decision budget `D_remaining(c)` *minus a reserve* `R(c)`, where `R(c)` is the dispatch + commit time of the action itself. If `L_probe(c) ≥ D_remaining(c) − R(c)`, the monitor must be *bypassed with an explicit degraded-verdict record*, not run inline. Equivalently: `L_probe(c) + R(c) < D_remaining(c)` is the only regime in which the monitor is a gate. Outside it, the monitor is a lottery whose losing ticket is "no action." The invariant is *class-relative*, not global. A monitor that is fine for `read_catalog` (deadline 10s) is a liveness hazard for `refund` (deadline 2s). The failure mode is introduced by applying one monitor configuration uniformly across action classes with heterogeneous deadlines — the LITMUS probe is class-agnostic by construction, so the mismatch is structural, not a tuning bug. Two corollaries that are easy to miss: - **Retry amplification.** If the agent's retry policy re-invokes the monitor, the effective probe latency per logical action is `k·L_probe` for `k` attempts, and the deadline check compounds. A monitor at 95% of budget fails ~100% of the time under 3 retries, because each attempt independently consumes budget. The invariant must be evaluated against *cumulative* budget, not per-attempt. - **Grader tail dominance.** `L_probe` is a p99, not a mean. A monitor whose *mean* probe is 200ms but whose p99 is 1.9s passes any mean-based budget check and fails the invariant on the tail. The budget check must use the same quantile the deadline enforces. ## Decision Boundary The boundary between "monitor is a gate" and "monitor is a scheduler" is crossed at a specific, computable point, and the correct behavior at that point is neither fail-open nor fail-closed but **degraded-verdict bypass**: - **Inside the invariant** (`L_probe + R < D_remaining`): run the monitor inline. A timeout here is a genuine anomaly (the grader is degraded) and should fail *closed* with `MonitorUnavailable`, because the budget was sufficient and the monitor's absence is unexpected. - **At the boundary** (`L_probe + R ≈ D_remaining`): the monitor is within noise of the deadline. Any run is a coin flip. This is the regime where fail-open silently unmonitors and fail-closed silently DoSes. The correct action is to *not run the probe*, record `verdict=bypassed_budget_exhausted` with the action's risk class and the observed `L_probe`, and dispatch under a *fallback* policy (e.g., a cheaper static rule, a human approval, or a hard-coded deny for the highest-risk class). - **Outside the invariant** (`L_probe + R ≥ D_remaining`): the monitor configuration is invalid for this action class. This is a *deployment* error, not a runtime one. It must be caught at config-load time by comparing the monitor's declared `L_probe` p99 against each action class's deadline, not discovered in production. The decision boundary is therefore not a runtime branch on the agent's side — it is a *configuration admission check* that must reject monitor/action-class pairings that violate the invariant before the agent goes live. The runtime branch exists only for the residual case where `L_probe` drifts upward (grader model swap, load spike) after admission; that branch emits the degraded-verdict record and alerts, it does not silently pick a side. ## Operational Effect Treating the monitor as a liveness hazard rather than a pure gate changes three things: 1. **Safety telemetry must count bypasses as a first-class outcome.** A monitor with zero blocks and zero bypasses is healthy. A monitor with zero blocks and 14% bypasses is *not* healthy — it is down, and its safety metrics are lying by omission. The bypass rate on high-risk classes is the leading indicator of the liveness failure; the block rate is not. 2. **The monitor's latency budget is a deployment artifact, not a runtime tuning knob.** `L_probe` p99 must be measured per grader version and admitted against the strictest action-class deadline it will serve. A grader upgrade that raises p99 from 1.9s to 2.1s is a *breaking change* for any class with a 2.0s deadline, even though the grader's accuracy improved. 3. **Retry policy must be monitor-aware.** Blind retries on a `DeadlineExceeded` that originated inside the monitor re-consume the same budget. The retry wrapper must distinguish `MonitorUnavailable` (retry may help if the grader was transiently slow) from `DeadlineExceeded` (retry cannot help; the budget is structurally insufficient) and route the latter to the degraded-verdict path immediately. The invariant to carry forward: **a safety monitor that is not faster than the deadline it guards is not a safety monitor; it is a probabilistic denial-of-service with a safety-shaped log line.** The check is `L_probe_p99 + R < D_remaining`, evaluated per action class, at admission time, against the same quantile the deadline enforces, with retry amplification folded into the budget. ```python import time from dataclasses import dataclass class MonitorBudgetViolation(RuntimeError): """Raised when a LITMUS-derived monitor cannot complete a probe within the action's remaining decision budget minus dispatch reserve. This is a liveness failure, not a safety verdict: the predicate was never consulted. Callers must NOT retry; they must route to the degraded-verdict path.""" @dataclass(frozen=True) class MonitorProfile: action_class: str probe_latency_p99_s: float dispatch_reserve_s: float decision_deadline_s: float def admit_monitor(profile: MonitorProfile, retry_attempts: int = 1) -> None: """Configuration admission check. Rejects monitor/action-class pairings that violate the probe-budget separation invariant: L_probe_p99 * retry_attempts + R < D_remaining Must run at config-load time, not at request time.""" cumulative_probe = profile.probe_latency_p99_s * retry_attempts required = cumulative_probe + profile.dispatch_reserve_s if required >= profile.decision_deadline_s: raise MonitorBudgetViolation( f"action_class={profile.action_class!r} " f"L_probe_p99={profile.probe_latency_p99_s:.3f}s " f"x{retry_attempts} retries + R={profile.dispatch_reserve_s:.3f}s " f"= {required:.3f}s >= D_remaining={profile.decision_deadline_s:.3f}s; " f"monitor would time out before grading, converting a safety " f"gate into a liveness hazard. Reject this pairing or reduce " f"probe latency." ) def run_inline_probe( profile: MonitorProfile, probe_fn, started_at: float, ) -> object: """Run the probe only if the invariant holds at runtime. If the grader has drifted slow (e.g. load spike), fail with an explicit bypass record rather than silently failing open or closed.""" elapsed = time.monotonic() - started_at remaining = profile.decision_deadline_s - elapsed required = profile.probe_latency_p99_s + profile.dispatch_reserve_s if required >= remaining: # Degraded-verdict bypass: do NOT run the probe, do NOT retry. raise MonitorBudgetViolation( f"action_class={profile.action_class!r} " f"remaining={remaining:.3f}s < required={required:.3f}s; " f"emitting verdict=bypassed_budget_exhausted and routing to " f"fallback policy (static rule / human approval / hard deny)." ) return probe_fn() ```