LangChain

LangGraph Recursion Limit as Infinite Loop Sentinel

critical
reliabilityUpdated Feb 12, 2026

langchain_langgraph_recursion_limit_hit fires when graph execution exceeds max depth, often signaling infinite loops, poor graph design, or adversarial inputs. Left unchecked, this consumes resources and inflates costs without useful output.

How to detect:

Alert immediately on any non-zero langchain_langgraph_recursion_limit_hit. Correlate with langchain_langgraph_node_invocation counts (which nodes are hot) and langchain_langgraph_checkpoint_size growth (ballooning state). Check if specific user inputs or metadata patterns trigger loops.

Recommended action:

Investigate graph topology for cycles without proper termination conditions. Add explicit max-iteration guards or cycle-breaking logic. Use LangSmith trace views to identify looping node sequences. Tag problematic inputs and filter or preprocess them upstream.