From assistant to agent
The loop that turns a model into something that acts.
What makes something an agent
6 min readAI Foundations introduced a rough ladder of autonomy: chat replies to what you type, one turn at a time; an assistant helps inside a task or app with some context; an agent plans and takes multiple steps toward a goal, using tools. This section is about that last rung: what actually makes something an agent, and how the parts fit together.
The test is simple. If a system reads your request and hands back one answer, it is chatting or assisting, no matter how good that one answer is. If it can decide on its own to take an action, check what happened, and decide what to do next, without you typing a new prompt for each step, it is behaving like an agent.
| Single reply | Agent | |
|---|---|---|
| You ask | "Why is this test failing?" | "Get this test suite passing." |
| It does | Explains a likely cause in one message | Reads the code, edits a file, reruns the tests, checks the result, and tries again if it still fails |
| Ends when | The reply is sent | The goal is met, or it hits a limit and hands back to you |
The three ingredients
- A goal, not just a question: "get the tests passing" instead of "why did this fail?"
- Tools: ways to actually do something, such as running a command, editing a file, or calling an API, not just producing text about it.
- A loop: the ability to take a step, see the result, and decide the next step, repeated until the goal is met or it stops.
- Agent
- A system that plans and takes multiple steps toward a goal, using tools, rather than answering once.
- Autonomy
- How much a system does on its own before it hands control back to you.
The agent loop: plan, act, observe, repeat
7 min readUnder whatever branding a product uses, almost every agent runs the same core loop. Understanding these four stages tells you what an agent is actually doing at any moment, and why it sometimes takes several tries to finish a task.
- 1PlanDecide the next step toward the goal
- 2ActUse a tool to take that step
- 3ObserveRead what actually happened
- 4RepeatUntil the goal is met, or it stops
Walking through one pass
- Plan: given the goal and everything so far, the model decides what to try next. Not the whole solution, just the next move.
- Act: it calls a tool to carry out that move, such as running a command, reading a file, or making a request.
- Observe: it reads the actual result, output, an error message, a file's new contents, not what it expected the result to be.
- Repeat: it folds that result back into its plan for the next step, and the loop runs again.
The observe step is what separates a real agent from a script that runs blindly. A fixed script keeps going whether or not each step actually worked. An agent reads the result of each action and can change course: retry, try a different approach, or stop and ask for help if it is stuck.
- Tool
- A specific action an agent can take, such as running a command or reading a file, instead of only producing text.
- Observe
- The step where an agent checks the actual result of its last action before deciding what to do next.
Memory and managing context
7 min readAI Foundations covered the context window: the amount of text a model can hold in view at once, measured in tokens. For a single chat reply, that limit rarely matters much. For an agent running a long loop, it is one of the most important constraints in the whole design, because every plan, action, and observation from the loop has to fit inside that same window.
Why the window fills up fast
Each pass through the loop adds more text: the plan, the tool call, and the result it observed. A task that takes twenty steps can generate a long transcript. If all of that stays in the window along with the original goal and any files involved, an agent can run out of room well before the goal is done.
| Approach | What it does | Trade-off |
|---|---|---|
| Summarizing | Compresses older steps of the transcript into a shorter recap, keeping the gist and dropping the detail | Faster and simple, but fine detail from early steps can be lost |
| External memory | Writes key facts or results to a file or store outside the window, then reads them back in only when needed | Keeps detail available on demand, but adds a step to save and retrieve it |
This is also why giving an agent a large, sprawling goal in one shot tends to work worse than breaking it into smaller pieces. A smaller goal produces a shorter loop, which leaves more of the window free for the parts that actually matter to the task at hand.
- Context window
- The fixed amount of text, in tokens, a model can hold in view at once. See AI Foundations for the full explanation.
- External memory
- Facts or results an agent saves outside the context window, such as to a file, and reads back in only when needed.
Permissions, review, and a human in the loop
7 min readA chat reply that is wrong costs you a moment of confusion. An agent that is wrong can delete a file, send a message, or spend money before anyone notices, because it is not just producing text, it is taking real actions through tools. That gap is exactly why permissions and review are not an afterthought; they are part of what makes an agent safe to actually use.
What to gate
| Category | Example action | Why it needs a limit |
|---|---|---|
| Data | Deleting or overwriting files, dropping a database table | Hard or impossible to undo |
| Money | Making a purchase, sending funds, changing a billing plan | Direct financial consequence |
| People | Sending an email, posting publicly, messaging a customer | Reaches someone else and cannot be unsent |
| Systems | Changing account or security settings, granting access | Can widen what the agent, or someone else, can do next |
Common ways to add a limit
- Ask before acting: the agent pauses and asks approval before a specific, listed kind of action.
- Read-only by default: the agent can look at things and suggest changes, but cannot make changes without a separate step.
- Scoped tools: give the agent only the tools it needs for the task, not broad access to every system it could reach.
- A review step: a person checks the agent's work, especially anything irreversible, before it goes live.
None of this is about distrust of the model specifically. It is the same reason a new hire does not get to wire company funds on day one: the more consequential and harder to undo an action is, the more it deserves a second set of eyes, whether that action came from a person or an agent.
- Human in the loop
- A required person review or approval step before an agent's action takes effect.
- Scoped tools
- Giving an agent only the specific tools and access it needs for a task, instead of broad access to everything it could reach.
Section 4 quiz
25 questions. Pass at 75% to master this section. Retakes are unlimited, and the quiz is where the learning sticks.
What is the key test for whether a system is behaving like an agent?