Manuals / AI Agents & Workflows / Ch 2

BuildBeginner40 min read

2. The tool loop

AI Agents & Workflows · 12 pages source format

Observe → think → act → observe. Cap steps. Log every tool call.

What you'll learn

  • Tools
  • Budgets
  • Logs

Tools are APIs with manners

Give each tool a clear name, input schema, and “when to use” note in the system prompt.

system: You may use search(), fetch_url(), draft_email().
Stop after 5 tool calls. Cite sources.

Do this now

Write a system prompt with 2 tools and a step budget.

Pro tip. Prefer retrieval over inventing facts.

Clear?

Guardrails

Allow-lists, human approval for send/delete, and red-team prompts that try to escape.

Do this now

Add one “ask human before…” rule.

Clear?

Checklist