Alert runbooks
Find what to check when a bundled DefenseClaw alert fires: schema violations, block SLO, stalled exporter, failing audit sink, hook capacity, fail-open.
These are the targets of the bundled alert rules. Keep connector IDs, trace IDs and destination names in incident evidence. Do not paste prompts, credentials or raw audit databases into tickets.
Schema violations
- In Grafana, open Runtime & Reliability → Schema violations by event_type × code and find the producing event and code.
- Run
defenseclaw doctor,defenseclaw config validateanddefenseclaw observability plan. Fix configuration or registry errors before restarting anything. - Read the gateway or collector logs without copying event content. A sustained count means a producer and the telemetry registry disagree.
- In a source checkout, run
make telemetry-checkandmake check-schemas, then the producer's tests. Roll back the producer or regenerate its registry change.
Block SLO
- Confirm the alert window has real guardrail traffic. An idle histogram is not a breach.
- Open Admission block SLO compliance, then Guardrail Evaluations and Connector Detail for the connector and policy.
- Compare regex, AI Defense, judge, policy and finalization latency to find the slow stage.
- Keep the configured enforcement action during diagnosis. Fail open only under your incident commander's procedure.
Exporter stalled
- Run
defenseclaw observability plan. Confirm the destination is enabled and selects the signals and buckets you expect. - Check
defenseclaw status, the gateway log and collector logs. For a remote destination, check DNS, TLS, credentials and the network. - Run
defenseclaw observability destination test <name>. Add--write-probeonly where supported; OTLP supports the handshake only. To prove gateway delivery, match a local audit event ID at the destination.- The test connects directly from your shell. The gateway delivers through the proxy it started with (
HTTPS_PROXYandNO_PROXY, or the enterprise proxy). - If the test passes but
doctorshowsdelivery_failed, find[observability] <name> ... export failedlines in the gateway log. Each says whether the connection was direct or through a proxy. If it used a proxy, restart the gateway from a shell with the right proxy settings.
- The test connects directly from your shell. The gateway delivers through the proxy it started with (
- Inspect the destination's queue, retry, drop and circuit telemetry. Repair and reload it, or run
defenseclaw setup observability disable <name>.
Audit sink
The alert keeps the historical audit.sink metric name. The target is a named destination.
- Find the
sink_kindand destination name, then its delivered, dropped, retry and circuit telemetry. - Check its credential, endpoint,
network_safety,sendandrouteswithout printing secrets. - Run
defenseclaw observability destination test <name>; use--write-probeonly for a supported, approved write. OTLP supports the handshake only. - Confirm local SQLite is healthy. Repair or disable only the failing destination. Do not remove local retention or widen routing to clear the alert.
Hook capacity
Every hook call that runs out of its answer budget increments defenseclaw.hook.deadline_outcomes (delta, unit {call}). In the local stack it is the Prometheus counter defenseclaw_hook_deadline_outcomes_total with an outcome label, and the DefenseClawHookOverCapacity alert fires when one outcome (deadline_deny, late_allow or shed) grows by more than 5 calls in every 5-minute window for 5 minutes in a row (increase(...[5m]) > 5 with for: 5m), so one late call does not page.
outcome | Meaning |
|---|---|
deadline_deny | The hook blocked the call because DefenseClaw did not decide it in time (managed hosts, strict and closed fail modes). |
late_allow | The call ran unchecked after its answer budget (per-user default fail mode). |
shed | The gateway admission limits refused the call (an account over its own budget, or a full gateway). Its hook sends it again and blocks it when its answer budget ends unless a resend is admitted. Counted once per call. |
What counts as a late call:
- A per-user gateway counts the late calls its hooks log.
- A managed gateway counts a call only from evidence that it ran out of its budget: a late or open delivery receipt from the hook, a client that left before the answer or before admission (
closedfail mode counts adeadline_deny,openalate_allow), a sandbox receipt that never came, or a refusal by the admission limits. - A call that never reached a managed gateway, or whose hook sent no receipt for another reason, is not counted (the per-call record in the system log has it). A disk or audit failure is not counted as load.
Where to read the counts for the last hour: defenseclaw status and defenseclaw doctor (on every OS), enterprise <os> status and verify (warning hook_over_capacity), and the gateway /status document as hook_capacity. A per-user gateway keeps them out of its /health, which needs no credential; a managed gateway adds them to /health only for an administrator. How a host shows that it is over its rate is in Hook sizing.
A managed gateway also counts those per-call records of the last 24 hours, from the journal on Linux, the unified log on macOS (Preview) and the Application event log on Windows. defenseclaw status and defenseclaw doctor show them as a Host records row: how many there were, how many blocked the call, and how many lines under the gateway's name were not a hook record (dropped).
Doctor warns when a hook blocked calls without a gateway answer while the gateway reports healthy. The gateway /status document, and /health for an administrator, carry the same counts as host_records. Any account on the host can write to these logs, so the count points you to the host log; the records are not added to the audit log. At most the newest 500 records are read.
Managed AI Defense fail-open
In managed enterprise mode, a request is allowed when the AI Defense inspection returns no verdict. Each such decision increments defenseclaw.managed_aid.fail_open.decisions (delta, unit {decision}). In the local stack it is the Prometheus counter defenseclaw_managed_aid_fail_open_decisions_total with a reason label.
reason | Meaning | Paging |
|---|---|---|
inspector_unwired | The gateway entered managed inspection without an AI Defense inspector. | Page when sustained. |
aid_unavailable | AI Defense returned no verdict (transport, timeout or token failure). | Page when sustained. |
no_content | The request had no inspectable messages. | Diagnostic only. |
unknown | An invalid producer reason, normalized at the metric boundary. | Diagnostic only. |
The bundled DefenseClawManagedAIDFailOpenSustained rule fires after 10 minutes of rate(...{reason=~"inspector_unwired|aid_unavailable"}[5m]) > 0. An idle gateway produces no decisions. If it fires, check the deployment mode, the inspector wiring at startup, AI Defense credentials and reachability, and provider status.
Related
Redaction
Configure centralized, field-aware redaction independently for local history, buckets, and export destinations in DefenseClaw observability.
Terminal UI (TUI)
Open the DefenseClaw terminal UI, a keyboard-driven dashboard over the CLI, and learn its panels, block and allow actions, Policies panel and Setup.