Silent loops, runaway costs, stuck tools, subagent explosions — caught the moment they form in your agentic workflows, before they hit your bill.
# wire it into LangGraph from agentsonar import monitor graph = monitor(your_graph.compile())
Standard observability watches individual spans. It doesn't model the shape of traffic between agents. A loop burning 14,820 tokens looks like 73 clean spans.
✓ session_start 250 tok ✓ researcher.run 210 tok ✓ retrieve_sources 150 tok ✓ writer.run 220 tok ✓ draft 150 tok ✓ reviewer.run 195 tok ✓ researcher.run 210 tok [...repeats 14 more times...] Status: All checks passed. 0 errors · 73 spans · 14,820 tokens
🚨 CRITICAL Silent loop between agents Loop: researcher → writer → reviewer → researcher Rotations: 0 First seen: 2026-04-19 14:32:01 UTC Severity: CRITICAL Suggested: Enable Prevent Mode → auto-stop at rotation 5
Same session. 73 spans. Every individual span succeeded.
agentSonar watches the shape — and sees the loop that's been running since 14:32:01.
Eight failure classes shipped. Each one silent — no exceptions thrown, no logs, just tokens burning.
Your agents keep passing work to each other in a circle and never finish. No error is thrown — it just burns tokens forever.
One agent calls another with the exact same request over and over. Gets the same answer every time, makes no progress.
A sudden burst of agent-to-agent calls, way outside the normal rate. Usually means something went wrong with orchestration logic.
The same tool is called with the same inputs, producing the same output, again and again. Nothing new is learned, but tokens keep burning.
An agent calls a tool and it never responds. The agent just waits — blocking the whole pipeline while time and tokens drain.
An orchestrator spins up far more subagents than expected. Each one runs, your bill grows — often silently, since each agent looks healthy on its own.
A tool fails, so the agent retries it. Then retries it again. And again. No backoff, no fallback — just hammering the same broken endpoint.
The session's context is nearly full. Once it hits the limit, quality degrades sharply or the run fails entirely — agentSonar catches it before you get there.
Agent A waits on B. B waits on A. Neither moves. Pipeline hangs silently.
Live projection mid-run: "at this rate, this run will cost $X." Catch it early.
Agent answers without consulting any tool. No grounding, no retrieval — just guessing.
Detect Mode streams alerts to stderr as the loop forms. Enable Prevent Mode
and agentSonar raises a typed PreventError before the next LLM call.
[SONAR 14:32:01] session started (id: 43b4782630244f8d) [SONAR 14:32:02] delegation: researcher → writer (#1) [SONAR 14:32:02] delegation: writer → reviewer (#2) [SONAR 14:32:03] delegation: reviewer → researcher (#3) [SONAR 14:32:03] cycle found · 1 rotation [SONAR 14:32:09] ⚠ WARNING cycle · 5 rotations [SONAR 14:32:18] 🚨 CRITICAL cycle · 15 rotations [SONAR 14:32:18] PreventError raised · run halted · ~11,400 tokens saved
agentSonar writes a standalone HTML report on every run — no external CSS, no JS, no network calls. Email it, attach to a ticket, or commit it to the repo.
A real incident: two agents stuck in a cycle for 11 days. No alert fired. Weekly costs climbed from $127 to $18,400 before anyone noticed.
Source: public incident report → · agentSonar would have caught it on rotation 5.
Bundled hello-world — three agents loop forever in a silent failure. AgentSonar catches it, stops the run, and writes an HTML report. No API keys. No config. No remote service.
pip install agentsonar
agentsonar demo
# if agentsonar isn't on PATH:
python -m agentsonar demo
npm install agentsonar npx agentsonar demo
Reports land at ./agentsonar_logs/run-<slug>/report.html
Every run writes four output files — alerts log, JSON report, JSONL timeline, and a standalone HTML report. See real output →
Apache-2.0 licensed. Closed beta, expanding fast.
# install pip install agentsonar # wire in from agentsonar import monitor, AgentSonarConfig config = AgentSonarConfig(prevent=True) monitored = monitor(your_system, config=config)
# install pip install agentsonar[langgraph] # one line wraps your compiled graph from agentsonar import monitor graph = monitor(your_graph.compile())
# install pip install agentsonar[crewai] # wrap your crew from agentsonar import monitor crew = monitor(your_crew) result = crew.kickoff()
# install once — wires .claude/settings.json automatically pip install agentsonar agentsonar install-claude-hooks # start a fresh Claude Code session — agentSonar is live # every tool call and subagent is watched # no code changes needed in your project
// install npm install agentsonar // wire in import { monitor } from 'agentsonar' const monitored = monitor(yourAgentSystem)
pip install agentsonar
pip install agentsonar[langgraph]
pip install agentsonar[crewai]
agentsonar install-claude-hooks
npm install agentsonar