Skip to content
WORKSI AI Control

AI agents you can trust in production.

Agents call models in loops and use tools with real side effects. Worksi traces every run, catches the ways agents fail, and gives operators the brakes.

lead-qualification · two agents, one trace
  • workflow_runlead-qualification

    two agents, one run

    • agent_stepresearch

      research-agent

      • tool_callweb_lookup

        discovered, never registered

      • tool_callcrm_lookup

        crm · data source

      • llm_callgpt-4o-mini

        company profile summary

    • agent_stepscore

      scoring-agent

      • llm_callgpt-5-mini

        score against the rubric

A looping agent, step by step.

A knowledge-base search comes back empty and the agent sends the same prompt again, paying for every turn. This is how Worksi records it, flags it, explains it and stops it.

The readouts follow the agent-loop incident of the built‑in demo organization. Detector rules are the product defaults.

  1. 01

    Six identical prompts

    search_kb found no articles, and resolver-agent sent gpt-5 the same prompt six times. The SDK records the step and the tool, the gateway every model call.
    support-ticket-resolution · the looping steps
    • workflow_runsupport-ticket-resolution

      one run, two of its steps

      • agent_stepresearch

        resolver-agent

        • tool_callsearch_kb · empty

          kb-vector-store · 0 articles

      • agent_stepdraft_reply

        resolver-agent

        • llm_callsame prompt · 1 of 6

          chat.completions gpt-5

        • llm_callsame prompt · 2 of 6

          chat.completions gpt-5

        • llm_callsame prompt · 3 of 6

          chat.completions gpt-5

        • llm_callsame prompt · 4 of 6

          chat.completions gpt-5

        • llm_callsame prompt · 5 of 6

          chat.completions gpt-5

        • llm_callsame prompt · 6 of 6

          chat.completions gpt-5

  2. 02

    Flagged on the fourth send

    agent_loop fires when one run sends the same prompt four times. In our benchmark the incident opened 1.9 s after the looping call (measured — how we measured time to detect).
    Incident · detector
    detector
    agent_loop
    rule
    same prompt 4× in one run
    seen
    6× the same prompt hash
    severity
    high, critical in production
  3. 03

    What the incident carries

    The incident arrives with its evidence: the repeated call, the identical prompt and the empty search that started the loop.
    Incident · evidence
    ev-1
    repeated gpt-5 call
    ev-2
    identical prompt repeated 6×
    ev-3
    search_kb returned no articles
    finding
    step count 2× a healthy run
  4. 04

    The next call gets a 423

    Worksi suggests stopping the run or pausing the agent. Once it is paused, its next call is refused at the gateway, before your provider sees it.
    Response
    HTTP/1.1 423 Locked{  "error": {    "message": "agent \"resolver-agent\" is paused",    "type": "invalid_request_error",    "code": "agent_paused",    "param": null,    "aiw_request_id": "req_…"  }}

    Example response. The body format is the gateway’s.

What else watches your agents.

Five of the eleven built‑in detectors, with the conditions they fire on.

What else watches your agents
DetectorFires when
Agent loopagent_loopAn agent repeats an identical prompt, or exceeds its step limit, in one run
Repeated tool callrepeated_tool_callThe same tool is called with the same arguments again and again in one run
Tool failuretool_failureA tool keeps failing, or a run ends in error at a tool call
Stuck workflowstuck_workflowA run started but never finished within the workflow’s threshold
Cost anomalycost_anomalyCost per request jumps versus the agent’s 7-day baseline, or a run exceeds its cost limit

Wrap the run, its steps and its tools.

The gateway alone sees every model call and enforces pause and stop. The SDK adds the run, its steps and its tools, so a loop is caught with its context.

Pro fits most agent teams: 1M gateway requests and 10M spans a month, 30‑day retention, approvals. $49 / month.

Compare plans

SDK packages are distributed by Worksi. Request access. Any OpenAI or Anthropic SDK works with the gateway without them.

agent.py
import osfrom openai import APIStatusError, OpenAI client = OpenAI(    base_url="https://gateway.worksi.ai/v1",    api_key=os.environ["AIW_API_KEY"],    default_headers={"X-AIW-Agent": "resolver-agent"},) def draft_reply(run_id: str, history: list) -> str | None:    try:        reply = client.chat.completions.create(            model="gpt-5",            messages=history,            # ties every call of the run together            extra_headers={"X-AIW-Run-Id": run_id},        )    except APIStatusError as error:        # 423 agent_paused or 409 run_stopped: hand over        if error.status_code in (409, 423):            return None        raise    return reply.choices[0].message.content

Give your agents a pause button.

Name the agent and the run on every call. When someone pauses the agent, its next call gets 423 and never reaches your provider.

  • 3‑day trial with Pro features, no card.

Keep readingSDKsMCPIncidents & diagnosis

Terminal
curl https://gateway.worksi.ai/v1/chat/completions \  -H "Authorization: Bearer $AIW_API_KEY" \  -H "X-AIW-Agent: resolver-agent" \  -H "X-AIW-Run-Id: $RUN_ID" \  -H "Content-Type: application/json" \  -d '{"model": "gpt-5-mini", "messages":       [{"role": "user", "content": "Hi"}]}' # a paused agent gets 423 agent_paused