Inspect the included traces
From a repository checkout with LoopGuard installed:ingest exits successfully after analysis even when it finds a loop. Use check
when detection should affect the process exit code.
Fail a script or CI check
looping. This sample exits with code 1 because it
contains a run where the policy reaches STOP.
To fail on warnings as well as stops:
--fail-on stalled by itself checks only stalled status; it replaces the default
looping rule. --fail-on alerts fails when a run has any recorded alert.
Add per-run budgets
max_steps counts exported steps.
One step containing both a call and a result becomes two internal events.
Keep check settings in a file
Save this asloopguard.yml:
Analyze more than one file
1 for this sample; JSON output does not disable failure.
Trace shape
A file can contain one run object or a list of run objects. Each run has asteps
list; run_id is optional and defaults to unknown.
Non-object arguments become a
value entry. Result text is flattened and truncated
to 160 characters before comparison. Supply caller together with the acting
agent name to preserve handoff information. No step index is required; list order
determines replay order.
Interpret the status
looping: a policy decision reachedSTOPanywhere in the replay, including permanent failures or handoff loops.stalled: noSTOP, but the final decision is something other thancontinue.clean: neither condition matched.
clean. The analyzer
replays the full export after a stop decision, so final_decision can differ from
the earlier stop. Check status and alert history together.
Both CLIs use offline detectors by default. For custom or semantic detectors, use
the Python analysis functions.
CLI reference · Configuration reference
To preserve expected healthy and stuck behavior across changes,
add a trace regression check.