03Detect04Understand
Know what broke, where, and why.
Detectors watch every span as it arrives. Each incident then moves through nine recorded steps; from the Startup plan Worksi verifies the recovery when it can and writes a learning record your team reviews.
INC‑5, start to finish
- 01
Incident detected. The third
lookup_orderfailure within 10 minutes opened INC‑5, critical, 2 s after the first failing call. - 02
Evidence collected. 3 numbered items came with the incident, among them the failing span and the upstream 503; the diagnosis later added an 11% tool error rate as ev‑4 and a resolved precedent as ev‑5.
- 03
AI diagnosis. Tool dependency failure, 80% high confidence (LLM‑assisted), citing all 5 evidence items, 21 s after detection.
- 04
Blast radius calculated. In the 21‑minute incident window, 28 of 138 support‑ticket‑resolution runs failed in production, and 12 of 13 end users saw a failure.
- 05
Runbook recommended. The diagnosis linked the approved runbook ‘Tool dependency outage’ (61% match).
- 06
Human approval. The operator asked to pause the workflow and later to resume it; the owner approved both, after 40 s and 75 s (four‑eyes approvals, part of Enterprise).
- 07
Recovery executed. The pause held: 39 runs were refused by the SDK’s pause check and none got through. The fix, resuming the workflow, took effect 7 minutes after the pause.
- 08
Recovery verified. Worksi re‑checked
lookup_orderon new traffic: 55 of 55 calls succeeded in the 3 minutes after the resume (3 needed), and the failure had been present before the pause. - 09
Incident resolved & learned. The operator resolved it after 16 minutes, confirming the diagnosis’s root cause; the owner reviewed the learning record: timings, 2 follow‑ups and a link to the earlier
lookup_orderincident.
Eleven detectors for how AI fails.
Stream detectors react to spans within about a second; sweep detectors check aggregates on a schedule. Enable, disable and tune each one per organization.
Production environments and critical workflows raise the severity by one level. Repeated detections of the same problem merge into the open incident.
| Detector | Fires when | Default severity |
|---|---|---|
| Agent loopagent_loop | An agent repeats an identical prompt, or exceeds its step limit, in one run | High |
| Repeated tool callrepeated_tool_call | The same tool is called with the same arguments again and again in one run | Medium |
| Timeouttimeout | Model or tool calls time out or run past their thresholds | Medium |
| Provider failureprovider_failure | A provider or model’s error rate spikes, or calls fail in a row | High |
| Tool failuretool_failure | A tool keeps failing, or a run ends in error at a tool call | High |
| Token anomalytoken_anomaly | A call uses far more tokens than the agent normally does | Medium |
| Cost anomalycost_anomaly | Cost per request jumps versus the agent’s 7-day baseline, or a run exceeds its cost limit | High |
| Stuck workflowstuck_workflow | A run started but never finished within the workflow’s threshold | High |
| Policy violationpolicy_violation | A request or tool call was blocked by, or broke, a policy | Medium |
| Error rateerror_rate | An agent’s error rate crosses the threshold over a window | High |
| Budget thresholdbudget_threshold | Spend crosses a budget’s alert thresholds; an incident at 100% | High |
Every incident comes with its evidence.
The evidence pack is built from the spans around the failure the moment the incident opens: what happened, the failure location, numbered evidence items and the run’s span sequence.
1. The affected run, step by step.
2. Highlighted steps are part of the detected pattern.
3. Latency per step.
04Understand
Deterministic first. AI second. Always cited.
Diagnosis runs rule-based checks for each incident type first. When a model credential is available, a model then reasons over the evidence, and it has to cite it.
- Deterministic findings
- Rule-based checks for the incident type run first, and they complete even when no model is available.
- LLM‑assisted
- With the platform’s OpenAI key or your own OpenAI‑compatible credential, a model reasons over the evidence for a root cause, a category and alternative hypotheses.
- Citations
- Every claim cites evidence items by number. Citations that match no evidence are dropped.
- Confidence
- A score and a label you can check against the cited evidence, plus similar past incidents.
1. A suggested next step, here pausing the workflow to halt further lookup_order calls.
2. Recovery options, one click from the diagnosis.
See how far failures reach.
Worksi counts what the failing component reached in the incident window: affected versus total runs and the workflows and environments involved from the Startup plan, and spend and end users, when your app identifies them, from Scale. It reads your telemetry and counts end users without listing them.
1. Affected versus total runs and requests in the incident window.
2. End users and spend, counted, with unpriced calls flagged.
3. Workflows and environments, with criticality and production marked.
From diagnosis to recovery, with you in control.
Every incident type comes with recommended actions and, when one matches, a runbook ranked by match and by how often similar incidents recovered after it.
- Runbooks
- Once the diagnosis settles, the best‑matching approved runbook links itself to the incident, or you link one. Each runbook shows in how many confirmed incidents recovery followed it.
- Pause and stop
- Pause an agent or workflow, or stop a run, from the incident. The gateway answers
423or409within seconds. - Retry
- Retry the affected runs through a signed webhook to your system once the dependency is healthy.
- Approvals
- Every recovery action is run by a person with a recorded reason, and it is audited. From the Startup plan, people and agents can also request approvals; on Enterprise, high‑risk actions wait for a second person’s approval, and nobody approves their own request except through an owner’s audited emergency override.
- Escalate
- Reach your alert channels by event type and minimum severity: email on every plan, Slack and signed webhooks from the Startup plan.
- Response targets
- Each severity has a response-time target, 15 minutes for critical, and Worksi tells you when one is missed.
Recovered means verified, not assumed.
From the Startup plan, after a recovery action, Worksi watches the failing component for the detector’s verification window and re‑checks its condition on new traffic. It says verified only when enough real calls passed and the failure was there before the action; otherwise it says what it saw. A person can confirm or reject a verdict, and the page says who did.
1. The window starts after the action took effect.
2. Traffic seen, against the minimum the detector needs.
3. The verdict, with every signal that decided it.
Every incident leaves a lesson.
From the Startup plan, resolving writes a learning record from the facts: the root cause and who confirmed it, the recovery that followed, timings and follow‑ups. Your team reviews it.
1. Root cause, with who confirmed it.
2. Recovery, and whether it was verified.
3. Follow‑ups, tied to the incident they came from.
- Diagnosis
- The next diagnosis cites reviewed precedent.
- Similar incidents
- Learned and verified incidents weigh more.
- Runbooks
- Runbooks rank higher when similar incidents recovered after them.
Benchmark · 24 September 2026
How reliably failures are caught.
We run a failure benchmark against the product: scripted failure scenarios and healthy runs through the real gateway, with time to detect measured from the failing call to an open incident.
8of 8
Scripted failure scenarios detected
0 false alarms in 6 healthy runs in the same round. Median time to detect: 1.1 s.
- Provider outage, provider_failure: 0.13 s
- Policy violation, policy_violation: 0.54 s
- Repeated tool call, repeated_tool_call: 0.72 s
- Cost spike, token_anomaly: 0.97 s
- Tool failure, tool_failure: 1.3 s
- Agent loop, agent_loop: 1.9 s
- Provider timeout, timeout: 5.0 s
- Stuck workflow, stuck_workflow, 60 s threshold: 63.2 s
Internal benchmark, 24 September 2026, one round. Single-replica Docker Compose stack on a 12 vCPU / 16 GB Linux host (gateway limited to 1.5 CPU / 512 MiB), load generated with k6. The built‑in simulator provider answered model calls with a pinned 1 ms latency so the gateway’s own overhead could be isolated. Every detected incident also had its failure location, a diagnosis and a linked runbook. The stuck‑workflow scenario is detected only after its 60‑second inactivity threshold. Your detection times depend on your thresholds and traffic, and every threshold is adjustable. Not covered: real provider latency and errors (simulator only), multiple replicas, cloud networking, TLS termination and managed data stores, multi-hour soak tests.
Break something on purpose.
The built‑in simulator fails on request. Send a burst of 503s and watch an incident open, with its evidence.
# while the simulator is your default provider,# it fails on requestURL=https://gateway.worksi.ai/v1/chat/completionsfor i in $(seq 8); do curl -s -o /dev/null "$URL" \ -H "Authorization: Bearer $AIW_API_KEY" \ -H "X-AIW-Simulate: error=503" \ -H "Content-Type: application/json" \ -d '{"model": "gpt-5-mini", "messages": [{"role": "user", "content": "Hi"}]}'done# then open Operations → Incidents