
You're building an autonomous LLM agent that can call tools, take multi-step actions, and operate with limited human oversight. The agent is useful when it stays on task, but it can also get stuck in loops, follow malicious instructions from tool outputs, or take actions that should have been blocked.
How would you implement guardrails to prevent an autonomous agent from executing harmful or infinitely looping actions?