What is an AI agent?
Hookโ
Two programs solve the same task: "find the current price of a part and tell me if it fits my $40 budget." The first always searches, always reads the top result, always compares to 40 โ the exact same three steps every time. The second searches, sees the top result is a broken link, decides on its own to try the next result, then compares. Same goal, same tools. The difference is who chose the second step, and when. That difference is the whole idea of an agent.
Conceptโ
An AI agent is a program that decides its next action at runtime, based on what it has observed so far, and repeats that decision in a loop until a goal is met or a limit is hit. The key word is decides: the sequence of steps is not written out in advance by the author; it is chosen step by step from live observations.
Contrast that with the two things an agent is often confused with. A workflow is a fixed sequence of steps the author wired up ahead of time: step 2 always follows step 1, regardless of what step 1 returned. A prompt chain is the LLM version of the same thing โ a fixed pipeline of model calls, where the author decided the order. Both are perfectly good tools. Neither is an agent, because neither chooses its own control flow. The precise rule: a system is agentic when its next action is selected at runtime from observations, not fixed at authoring time.
That runtime decision happens inside a loop with four beats, which this course calls the observe, plan, act loop:
Read each beat as something you can point to in a record of the run:
| Beat | What it produces (the observable artifact) |
|---|---|
| Observe | The goal plus the most recent observation, fed into the decision |
| Plan | The chosen next action โ a named tool call with arguments |
| Act | The tool runs; the world (or a sandbox) does something |
| Observe | The tool's result, recorded so the next Plan can use it |
Two properties keep the loop honest, and this course treats them as non-negotiable. First, an explicit stop condition: a test the agent checks each pass to decide it is done ("the answer is computed"). Second, an iteration cap: a hard maximum number of passes, so that even if the stop condition is never met โ a bad plan, a tool that keeps failing โ the loop terminates anyway. Together they are what "bounded autonomy" means in practice: the agent gets to choose its steps, but not to choose forever. An agent without both is the "research assistant" from the hook that loops until someone kills it.
One discipline underpins all of this. You reason about an agent from its observable artifacts โ the plans it emits, the tool calls it makes, and the observations it records โ never from a model's private, hidden reasoning. The plan is not "what the model was thinking"; it is the concrete action the agent produced and you can read back. Build your mental model, your debugging, and later your evaluations on those artifacts, because those are the only things that actually exist in the record.
Worked exampleโ
Let me make the loop concrete without any LLM, by hand-tracing a tiny agent that makes change. The goal: reach an exact cent total using coins, choosing each coin at runtime from what is left to cover. This is a genuine loop โ the agent observes the remaining amount, plans the next coin, acts, and observes โ with an explicit stop and an iteration cap.
COINS = [25, 10, 5, 1] # the agent's one "tool": add a coin
MAX_STEPS = 20 # iteration cap โ bounded autonomy
def plan(remaining):
"""Choose the next action from the observation. Return None to stop."""
if remaining == 0:
return None # explicit stop condition: goal reached
for coin in COINS:
if coin <= remaining:
return coin
return None
def run(target):
remaining = target
trace = []
for step in range(1, MAX_STEPS + 1):
action = plan(remaining) # observe -> plan
if action is None:
break # stop condition met
remaining -= action # act -> observe
trace.append((step, action, remaining))
return trace, remaining
trace, remaining = run(87)
for step, coin, left in trace:
print(f"step {step}: add {coin:>2}c, remaining {left:>2}c")
print("done, remaining:", remaining)
step 1: add 25c, remaining 62c
step 2: add 25c, remaining 37c
step 3: add 25c, remaining 12c
step 4: add 10c, remaining 2c
step 5: add 1c, remaining 1c
step 6: add 1c, remaining 0c
done, remaining: 0
Trace it against the four beats. Each pass observes remaining, plans one
coin by inspecting that observation, acts by subtracting it, and observes the
new remaining. Nothing about the sequence 25, 25, 25, 10, 1, 1 was written in
advance โ change the target to 41 and the plan is entirely different. That is
the agentic property. And notice the two guards doing their jobs: plan returns
None the moment remaining hits 0 (the stop condition), and even a malformed
coin set could not spin forever because MAX_STEPS caps the loop.
Hands-onโ
Now build the loop visually instead of tracing it on paper. The exercise below opens in the Agent Builder with a single-tool agent and a goal, and shows you the run as a trace of plans, tool calls, and observations โ the same four beats, laid out step by step.
Do this: give the agent one tool and a goal, run it, then open the trace and label each row as an observe, plan, act, or observe step. Success criteria: you can point to the plan that chose each action, the observation it was based on, and the step where the stop condition fired โ and you can say what the iteration cap would have done if the goal were unreachable.
Recapโ
- You can state the one property that makes a system an agent: it chooses its next action at runtime from observations, not from a sequence fixed in advance.
- You can distinguish an agent from a workflow and a prompt chain, which both run author-fixed control flow.
- You can draw the observe, plan, act loop and name the observable artifact each beat produces.
- You can explain bounded autonomy as an explicit stop condition plus an iteration cap, and say why an agent needs both.
Next up, you will zoom into the "act" beat: what a tool actually is, how a tool call is described and validated, and why a bounded action is the difference between an agent that helps and one that does damage.
- An agent chooses its next action at runtime from observations; a workflow or prompt chain runs a sequence the author fixed in advance. - The observe, plan, act loop has four beats, and each produces an observable artifact you can read in a trace: the goal, the chosen action, the tool run, and the recorded result. - Bounded autonomy means an explicit stop condition plus a hard iteration cap โ an agent gets to choose its steps, but not to choose forever.