Home/ Part XIII — Expert Mode: Systems, Agents, and Automation/37. Agentic Workflows (Without Letting It Run Wild)

37. Agentic Workflows (Without Letting It Run Wild)

Overview and links for this section of the guide.

What is an Agent?

An "Agent" is just an LLM loop with tools.

while (goal_not_met):
  thought = model.think(context)
  action = model.decide_tool(thought)
  result = execute(action)
  context.append(result)

That's it. It's not magic. It's a `while` loop.

The Danger Zone

Agents are prone to:

  • Loops: "I need to check the file." -> "I checked the file." -> "I need to check the file."
  • Drift: Starting with "Fix the bug" and ending with "Rewrite the entire database layer."
  • Cost: One user query can trigger 50 model calls ($$$).

Safe Patterns

We focus on Bounded Agents. Agents with a budget (max 5 steps), a strict toolset, and a "Supervisor" (another model or a human) that checks the plan before execution.

Where to go next