Skip to content
AI DemystifiedHow AI actually works
Lesson 09 of 22Systemsadvanced5 min

Agents

The Assembly Line: observe, decide, act, verify

What is an AI agent?

In this lesson, an agent is a system where a model helps control a workflow loop: observe state, choose an action, call a tool, inspect the result, and stop or continue. A fixed sequence that application code controls is better described as a workflow. Use model-directed loops when the task needs judgment or adaptation—not merely because an LLM is present.

Lab honesty

This experiment is a scripted client-side simulation. It does not call a model, tool, API, or live data source. Token totals are staged estimates that make budget trade-offs visible. Decision and evaluation text is an observable summary, not private chain of thought. The controls change the deterministic trace; they do not measure learning or real agent quality.

Agent or ordinary software?

Prefer deterministic code for stable rules, exact calculations, and known sequences. An agent becomes useful when the model must choose among tools or adapt the next step from an observation. Even then, deterministic code should enforce schemas, permissions, budgets, approvals, and the final stopping condition.

Agent loop experiment

Choose who controls the path, set hard budgets, and optionally make the first simulated tool call fail. Every run is deterministic: the same task and settings produce the same trace.

Execution pattern
Simulates a timeout so the two execution patterns diverge.

Pick a task

Observable state

Step 0 / 0
Status
Ready
Current phase
Not started
Steps used
0 / 14
Estimated tokens
0 / 600
Observe
Decision summary
Plan
Act
Check result
Evaluate

Run a task, then pause or reveal one step at a time to inspect the loop.

What can go wrong

  • Infinite loops: the agent keeps calling tools without making progress
  • Hallucinated tool calls: AI invents a tool that doesn't exist
  • Token budget overruns: complex tasks can consume thousands of tokens across many steps
  • Getting stuck: the agent may retry the same failed approach repeatedly
  • Prompt injection: untrusted tool or document content may try to redirect the model away from the user's goal
  • Excess authority: a plausible but wrong action can cause harm when tools have broader permissions than the task requires

Key Insight

Agents are model calls inside a controlled loop: observe state, choose an action, use tools, verify results, and stop. Extra steps can increase cost, latency, and opportunities for error. Measure success on the real task distribution, enforce budgets and least privilege, and require human approval at consequential boundaries rather than treating autonomy as all-or-nothing.

See also: Unhobbling

The decide / act / observe kernel becomes a product pattern when you add a hard evaluator and retry budget (GTER). Product rails that force confirm-every-step hobble long-horizon agents. See Unhobbling AI.

Check your understanding

1/4

What makes an agent different from a single AI call?

Sources, scope & review statusVerified Jul 29, 2026

Claims this lesson makes

  • Stable conceptAgent systems iterate over observations, decisions, actions, and stopping conditions.

    Scope: Displayed plans are observable summaries, not a claim to expose a model's private chain of thought.

  • Stable conceptAn agent run needs explicit exit conditions, bounded tools and permissions, and a handoff path when the system cannot complete the workflow safely.
  • Stable conceptAdding more agents is not automatically better; orchestration adds coordination, evaluation, latency, and maintenance costs.
  • Stable conceptExternal content can carry indirect prompt injection that redirects an agent, so untrusted observations must not be treated as authorization for high-impact tool actions.

Next content review: 2027-07-29. Source links establish the lesson's claims; interactive numbers remain labeled simulations unless explicitly identified as measured data.