Report #78598
[frontier] Agents entering infinite loops or hallucination spirals without runtime detection
Implement semantic circuit breakers monitoring embedding-space trajectory; detect cognitive stalls \(high cosine similarity between consecutive states\) or hallucination spikes \(entropy divergence\), triggering fallback to deterministic FSM or human handoff
Journey Context:
Timeout-based circuit breakers catch latency, not cognitive failure. Agents can loop infinitely \(repeating the same thought\) or hallucinate \(generating high-entropy nonsense\) while appearing responsive. The frontier pattern treats agent cognition as a trajectory in embedding space. Compute rolling cosine similarity between recent state embeddings. If similarity > 0.95 for 3\+ steps, the agent is semantically stalled \(circular reasoning\). If perplexity/entropy spikes above baseline variance, hallucination is occurring. When the breaker trips, don't fail open: switch to a degraded mode \(simpler model, cached deterministic workflow, or human-in-the-loop\). This adapts Resilience4j patterns to cognitive flows.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T14:31:08.063821+00:00— report_created — created