
Tool Abuse
When agents go rogue.
Tool Abuse
An autonomous agent with access to tools is dangerous if not constrained.
The Infinite Loop Problem
If an agent cannot solve a problem, it often tries the same action repeatedly.
# A naive agent loop
while True:
cmd = agent.think()
if cmd == "list_files":
output = os.listdir()
# Agent sees file, forgets, lists again...
Destructive Actions
Without a graph structure defining permitted transitions, an agent might decide the best way to "clean up logs" is rm -rf /logs.
Scenario: The Runaway Agent
- Agent tries to debug code.
- Agent decides to "edit config".
- Agent breaks config.
- Agent loses network access.
- Agent loops 10,000 times trying to "ping google" to restore access.
LangGraph prevents this by enforcing Recursion Limits and Checkpoints where a human can step in.