Loading

from first concept to confident practice

Loop Engineering

Build reliable observe, act, and check cycles for AI agents.

Start learning 8 lessons · first lesson about 20 min · free · no account needed
About this track

An AI agent is a loop: observe, decide, act, check - again and again until the job is done. The model makes the decisions, but the loop around it is software you design, and that’s where reliability and safety come from.

You’ll choose between workflows and agents, keep durable state and a focused context, design tools a model can use well, stop runaway loops, retry safely with backoff and idempotency, evaluate whole runs for reliability, and keep people in control with scoped permissions and approval gates. Along the way you’ll replay agent runs in a loop simulator and finish by building the controller that runs an agent safely.

Before you start
  • Basic familiarity with AI assistants is helpful.
  • Basic Python for the exercises.
  • A modern browser with JavaScript enabled.

Your path

0 of 8 lessons · 0%

Restoring your progress…

Loading progress…
  1. Unit 1 · 0/3 lessons

    Loop foundations

    Model the agent loop, choose the right pattern, and keep durable state and a focused context. Badge: Progress keeper

    1. 0x001Model an agent loopTrace a task through think, act, observe - and see why the environment, not the model, is the source of truth. 20 min 0/2 exercises solved 20 min 0/2 exercises solved
    2. 0x102Workflows or agents? Choose the patternPick the simplest design that works: prompt chaining, routing, parallelization, orchestrator-workers, evaluator-optimizer - or a full agent. 20 min 0/2 exercises solved 20 min 0/2 exercises solved
    3. 0x203Track state, progress and contextCheckpoint progress so work can resume, and keep the context window focused with compaction, notes and just-in-time retrieval. 22 min 0/2 exercises solved 22 min 0/2 exercises solved
  2. Unit 2 · 0/3 lessons

    Loop control and quality

    Design tool contracts, stop and recover safely, and evaluate whole runs. Badge: Reliable operator

    1. 0x304Design tools and action contractsTreat tools as an interface for the model: clear names and schemas, helpful errors, concise results. 22 min 0/2 exercises solved 22 min 0/2 exercises solved
    2. 0x405Control stopping, retries, and recoveryBound the loop, detect when it’s stuck, retry safely with backoff and idempotency, and hand off cleanly. 25 min 0/3 exercises solved 25 min 0/3 exercises solved
    3. 0x506Evaluate the whole loopGrade whole runs, not single replies: outcomes, step counts, forbidden actions - and reliability across repeated trials. 22 min 0/2 exercises solved 22 min 0/2 exercises solved
  3. Unit 3 · 0/1 lessons

    Loop safety and oversight

    Apply least privilege and approval gates, and keep people in control. Badge: Safety steward

    1. 0x607Build safety and oversight into the loopScope permissions, gate consequential actions on a person’s approval, sandbox execution, and keep a way to stop. 22 min 0/2 exercises solved 22 min 0/2 exercises solved
  4. Unit 4 · 0/1 lessons

    Capstone

    Build the controller that runs an agent safely, and report on its run. Badge: Loop engineer

    1. 0x708Capstone: build an agent controllerWrite the controller that runs a scripted agent safely - budgets, stuck detection, approvals - then summarize its trace. 35 min 0/2 exercises solved 35 min 0/2 exercises solved