03Chapter 3 of 5
Free course9 min read

How an agent decides what to do.

An agent works in a loop: read, think, act, observe. This chapter walks through one full pass over a real email from Mia's inbox, so you can see where the decisions happen.


Chapter 2 named the 4 parts of an agent: the Brain, the Playbook, the Hands, and the Notebook. This chapter shows what they do when an actual email lands in Mia's inbox. The work happens in a loop, and that loop is the single most important thing to understand if you want to evaluate any agent product without an engineer translating for you.

03.0

Why the loop matters

Mia got an email at 11:43 PM last Tuesday. It said: "Hey, do you have wifi at the shop? Looking for a place to work tomorrow afternoon." She read it in bed, replied "yes we do, see you tomorrow," and went back to scrolling. The whole exchange took 11 seconds.

Now imagine you were trying to teach an agent to handle that same email. You cannot give it a list of rules and walk away. Customers have too many ways to ask about wifi. They might say "internet," "outlets," "good for laptops," "remote work friendly," or "where can I sit and work?" Writing a rule for each phrasing is the dead-end road that traditional automation always ends up on.

An agent solves this a different way. It reads the email, decides what the person is actually asking, picks an action, takes that action, looks at what happened, and decides what to do next. Four steps, in a loop. The same 4 steps run for every email it touches. Understanding those steps is what lets you reason about why an agent did what it did, or did not do what you expected.

Note
When you are evaluating an agent platform, the question that surfaces the loop is: what happens when an email arrives that does not match any of my rules? A rule-based tool stalls or guesses. A real agent reads the message, reasons about it, and picks an action. The answer tells you which kind of tool you are looking at.
03.1

The 4 steps in one picture

Here is the loop as the agent sees it. Each step feeds the next. When the cycle finishes, the agent picks up the next email and starts over.

The agent's loop, one pass per email
Readpull the messagepull the messageThinkreason about itreason about itActuse a tooluse a toolObservecheck the resultcheck the resultwhat is thisdo this nextsee what happenednext message
The agent reads an email, reasons about what the customer needs, takes an action (drafts, sends, or flags), then looks at the result and goes back to the inbox for the next message. Same 4 steps every time.

It looks simple. The interesting parts are inside each step.

Read pulls the right email and the right context around it. Too little and the agent misses what the customer is actually asking. Too much and the model gets confused by inbox noise.

Think is where the model decides what the email is about, and that decision determines everything that follows. Every surprising agent reply you have ever seen traces back to this step going wrong.

Act is where the agent reaches out to a real connected tool (Gmail, the inventory spreadsheet, Slack) and does something. The choice of tool is part of the reasoning above, not a separate decision.

Observe is where the agent looks at what the tool returned and decides if the job is finished or if it needs another pass. Agents that skip this step quietly break the first time a tool returns an error.

03.2

Read and Think

Read is the easy step to dismiss and the easy one to get wrong. The agent needs the email body, the sender, the subject, and usually the most recent thread of replies between Mia's shop and that customer. If you only feed the agent the latest message and skip the thread history, it will answer a question that was already answered last week. If you feed it the whole inbox, it will get confused and slow. Picking the right slice is part of the work.

For Mia's wifi question, the agent pulls the email body and notices there is no prior thread with this sender. The context is the one message and the shop's general knowledge: hours, amenities, location. That is enough.

What the agent reads
●mail.google.com/u/0/#inbox/FMfcgz
Inbox · Beans and Books
Quick question
RH
Rylan H.<rylan.h@protonmail.com>
to hello@beansandbooks.shop
11:43 PM
Hey, do you have wifi at the shop? Looking for a place to work tomorrow afternoon.
Thanks, Rylan
The agent sees the same message Mia sees: sender, subject, body. No prior thread with this address, so context is this one email plus the shop's standing instructions.

Think is where the model goes to work. It reads what came in, holds the shop's instructions in mind ("answer customer questions warmly, mention hours if relevant, escalate complaints"), and produces a short internal note about what to do next. For this email, the note is something like: "Customer asking about wifi. Yes, the shop has wifi. Mention hours since they want to come tomorrow. Friendly, brief reply."

You will never see that internal note in a polished product. It happens inside the model in less than a second. But it is the most consequential step in the whole loop. Every wrong reply you ever see from an agent traces back to a bad reasoning step here. Either the model misread the situation, or the instructions did not give it enough to go on, or it lacked the knowledge to answer.

✱ Field note
When an agent does something surprising and you want to debug it, the question to ask the product is: show me what the model was thinking on this step. Any serious agent platform exposes those internal notes (sometimes called the trace or the reasoning log). If yours does not, you are flying blind.
03.3

Act and Observe

Act is where the agent stops thinking and starts doing. For Mia's shop the agent has a handful of tools available: it can draft a reply in Gmail, send a reply, flag the email for Mia to look at, or check the shop's calendar for booking availability. Picking the right tool is part of the reasoning step above. The agent decided to draft a reply, so now it calls the Gmail draft tool with the message it composed.

Acting on the wifi question
AgentGmailMiacreate draft replydraft saved, id 4f2flag for reviewedit and send

Observe is the step most people skip when they explain agents, and it is the step that separates a tool that works from one that quietly fails. After every action, the agent looks at what came back. Did the draft save? Did the email send? Did the customer reply with a follow-up question that needs a new pass? The agent does not assume the action worked. It checks.

For the wifi question, Observe is short. Gmail returned a draft ID, which means the draft saved. The agent flags the draft for Mia and ends the loop for this email. If Gmail had returned an error ("token expired," "quota exceeded"), Observe would have caught that and the agent would either retry, escalate, or fall back to flagging the email as needs-Mia. That fallback path is the difference between an agent that handles real-world mess and one that breaks on the first hiccup.

03.4

One full pass through Mia's inbox

Putting it all together, here is what one pass looks like end to end. Same 4 phases as the loop above, with the actual data from the wifi email annotated underneath each step.

One full pass on Rylan's wifi email
Readnew sender, no threadnew sender, no threadThinkwifi q, mention hourswifi q, mention hoursActgmail.create_draftgmail.create_draftObservesaved, flag for Miasaved, flag for Mia

Four lines. Less than a second of actual model time. The agent did the same work Mia would have done in her head when she replied at 11:43 PM, but it did it without waking her up, and it left the actual send-or-don't-send decision with her. That is what a well-built agent looks like in practice. It does the thinking quietly, hands you the result, and lets you keep authority over the final action.

KEY TAKEAWAYS
  1. Every agent runs the same 4 steps in a loop: Read, Think, Act, Observe.
  2. Read picks the right slice of context. Too little misses the situation, too much confuses the model.
  3. Think is where the decision happens. Every surprising reply traces back to this step.
  4. Act calls a real tool with real consequences. Picking the right tool is part of the reasoning, not a separate stage.
  5. Observe checks what happened. Agents that skip this break on the first error.
  6. You should be able to inspect the reasoning trace. If your platform hides it, you cannot debug anything.

End · Chapter 3 of 5

Mark it complete and it’s ticked off on your route.

Rivet, the product security agent for software teams, free to start. Human-led pentests and design review when you need them. AI agents are our specialty.

or get a free Rivet scan

BASEDChicago, IL · remote

FIELD NOTES

ONE SHORT EMAIL A MONTH

© 2026 ROUTEWORK — ALL RIGHTS RESERVED

Claude and Mythos are trademarks of Anthropic. RouteWork is not affiliated with Anthropic.