Agent lesson 01 · The controlled loop
Shared teaching scenario · fictional product data
Research three laptops under €900, verify current evidence, and write laptop-comparison.md. Do not purchase anything or contact a vendor.
01 · Smallest useful mechanism
A useful agent alternates between model calls and an application-controlled runtime. The runtime packages the goal and current evidence, asks the model for a response, validates any requested tool call, executes only allowed effects, and appends the result to the next turn. Critical gates can be deterministic even though tools, networks, policy services, and scheduling may not be. The loop stops on a verified answer, an explicit failure, a budget boundary, or a human decision.
The model proposes the next move; the harness owns state, mediates permitted actions, records observations, and applies continuation and stopping rules.
02 · Experiment
Deterministic browser simulation
The controlled loop experiment uses inspectable, repeatable teaching data. It does not claim to be a live agent trajectory.
03 · Production-minded practice
Use your own stack or a contained mock environment. Do not point failure drills at real accounts, people, or irreversible services.
Draw a trace with separate events for proposal, policy decision, tool start, observation, verification, and terminal state.
Make one product read time out after the request is sent. Mark the outcome unknown, apply the retry policy, and choose a safe next step.
A reviewer can tell what happened, whether an effect may have occurred, why the loop continued, and which check allowed it to stop.
Your learning artifact
Stored only in this browser. No account required; course reset does not delete it.
04 · Check your understanding
Next: Once one loop is visible, we can safely ask when parts of the work should be delegated to bounded workers.
Guided run
Current boundary
step 1 / 10
Research three laptops under €900, verify current evidence, and write laptop-comparison.md. Do not purchase or contact a vendor.
user
Goal enters the harness
Guided evidence
A model-backed comparison may be researched later, after learner evidence shows that it improves understanding. The deterministic harness remains the source of truth for this lesson.
Research basis: Claude Code Unpacked agent loop and OpenAI’s practical guide to building agents.