LABHDUFBA Agentes AcadêmicosLABHDUFBA · UFBA PortuguêsPT

How an agent carries out a task

The loop of goal, plan, action, observation and verification — and the points where work can and should stop.

An agent works in a loop: it interprets the goal, plans, uses a tool, observes the result, verifies, and then continues, corrects or stops.

Execution loop of an agent Six steps in sequence: goal, interpret, plan, use tool, observe result and verify. Verification has three exits: continue, correct or stop. The loop returns to planning while the goal is unmet and the limit has not been reached. Goal Interpretwhat was asked Plannext step Use a toolact outside the model Observewhat came back Verifydid it work? Continue · correct · stopthree legitimate exits Limitssteps, time, cost, permission
The loop is not infinite: it ends when the goal is met, when a limit is reached, or by human decision.

Every step leaves a trace — or should not count

  1. Interpret — turns the request into a success criterion. If the criterion cannot be written, the task is not ready to be delegated.
  2. Plan — chooses the order of actions and the tools needed. An explicit plan is what lets a person disagree before the damage.
  3. Act — calls the tool. Here the system leaves text and touches the world: writes a file, queries an API, sends a message.
  4. Observe — reads what came back, errors included. Half of agent failures are bad observation: accepting a block page as if it were a result.
  5. Verify — compares what was observed with the criterion. Without this step the agent confuses “I ran it” with “it worked”.
  6. Decide — continue, correct or stop. Stopping is a legitimate result, and an agent that never stops is an agent that cannot tell it failed.

Where the loop breaks

Observation failures

The agent reads an error response as content, or gets an empty page and concludes “no results”. Fix: validate format and size before interpreting.

Verification failures

The agent declares success because the call raised no exception. Fix: require a verifiable artefact — file, count, hash, quoted passage.

Limit failures

The loop keeps burning time and money without converging. Fix: caps on steps, cost and time, set in advance.

Permission failures

The agent has access to more than the task requires; one wrong step deletes or publishes. Fix: minimal permission, and human confirmation for the irreversible.

What goes into each step is the subject of the anatomy.