Docs Demo
Inspectors

Loop breaker

Infinite loops caused by hallucination or attack create cost and damage (OWASP LLM04). The loop breaker looks at the session trajectory and stops them.

Three loop kinds

KindDefinitionDefault threshold
Identical callThe same tool with the same arguments repeated3
Consecutive same toolThe same tool called back-to-back5
OscillationAn A → B → A → B → A → B patternon

Configuration

loop_breaker:
  enabled: true
  max_identical_calls: 3
  max_consecutive_same_tool: 5
  detect_oscillations: true
  action: "BLOCK"          # or "ESCALATE"

tools:
  - name: "search"
    allow: true
    max_identical: 10      # per-tool override

Arguments are canonicalised and hashed, so the same call counts as identical even if key order changes.