Reference · Cheatsheet

Agent loop cheatsheet

Last updated

Think → Act (tool) → Observe → Think → …

Think → Act (tool) → Observe → Think → …

| Step | Question |

|------|----------|

| **Think** | What do I need next? |

| **Act** | Call one tool with validated args |

| **Observe** | Read tool result / error |

| **Stop** | Answer user or hit step limit |

Safety rails

  • Max steps (e.g. 5)
  • Tool allowlist
  • Human confirm for destructive actions
  • Log every tool call
  • **Related:** `what-are-agents`, `prompt-injection-defense` cheatsheet