How an AI Agent Works: Plan, Act, Check

· 6 min read

An AI agent works in a loop: it takes a goal, decides on a next step, uses a tool to carry that step out, reads what the tool returned, and checks whether the goal is met before it repeats or stops. On its own, the model only writes text. Separate software does the searching, file changes and sending, then hands each result back as more text.

The loop is simple. Much of what makes an agent safe to give real work is built around it: limits, approvals and a record of what it did.

What is the loop behind an AI agent?

Plan, act, check, and round again. In the plan step the model looks at the goal and everything that has happened so far, and picks one next move. In the act step it asks for a tool to be used. In the check step it reads the result and judges two things: did that work, and is the goal met yet? If not, it plans again. If so, or if something stops it, it writes a final report.

A fixed script follows steps someone wrote in advance. An agent chooses each next step as it goes, which is both its use and its risk. Unless something outside the model verifies the result, such as a test that passes or a file that exists, the check is its own judgement from the text in front of it, so "done" is only a claim. AI agents vs. chatbots compares it with an ordinary chat reply.

What is tool use, or function calling, in plain words?

A tool is anything the software around the model can do on request: search the web, open a page, read or write a file, run a command, send a message. Tool use, also called function calling, is how the model asks for one.

Picture an order form with fixed boxes. The model cannot press buttons itself, so it fills in the form: one box for the tool's name, others for the details, such as "search" and "opening hours Riverside pool". The software does the job if its rules allow it and pastes the outcome back as text for the model to read.

This is why limits belong in the software. The model writes requests, and the software decides which of them run. A rule that exists only as a sentence the model was asked to follow is a weak one.

Does an AI agent have memory?

Only what is put in front of it. In a typical agent, that is the goal, its instructions, and a record of the steps so far and what each tool returned. A detail you never wrote down, such as whether "nearest" means by road or in a straight line, is something it must guess.

Two limits follow. A long run makes a long record, and details from early steps can be missed or fall out of view, as the context window explains. And what a tool returns goes into the record as it is, so a wrong or out-of-date page can become something every later step builds on. Anything meant to last beyond the run needs a separate memory feature, covered in AI memory vs. context.

What does one agent run look like?

Suppose you ask an agent: "Find the opening hours of the three swimming pools nearest Alder Bay, save them in pools.txt, email the list to my swimming club, and stop after 12 steps." Every detail here is invented.

  • It runs a search and gets back five page titles.
  • It opens the first three. Two show opening hours. The third fails to load.
  • Check: two of three. It retries the third page once, gets the same error, then searches for that pool by name and finds a different page, whose hours are headed "Summer 2025". It cannot tell whether those are current, so it keeps them apart from the other two and says so.
  • It saves pools.txt, which it is allowed to do inside the folder you chose. Sending the email is set to need your approval, so it stops, shows you the recipient and the message, and waits.

The final report says two pools are confirmed, one has hours of unknown date, and one email awaits your decision. The log lists every page it opened. The 12-step limit was never needed here; it is for runs where a step keeps failing.

Where do agent loops go wrong?

These failures turn up most often.

  • Getting stuck. The same failing step is repeated with small variations while nothing improves.
  • Acting on a wrong assumption. Told to "send the report to the team", it picks the wrong mailing list, and every later step fits that mistake, so nothing looks off.
  • Declaring success too early. The check is often the agent's own opinion, so a half-finished job can come back labelled done.
  • Obeying text it read. A web page, email or file can contain instructions, and a model may treat them as orders. Prompt injection explained covers why that is so hard to prevent.
  • Running up work. Each pass is another model call over more text, so a loop with no ceiling can cost a lot before anyone looks.

Which controls make an agent safer to use?

Set these up before you hand over real work.

First, a clear goal with a stop condition. Say what finished looks like, what is off limits, and when to give up and report. "Find hours for three pools, save them to pools.txt, and stop after 12 steps, listing any you could not confirm" can be checked. "Look into pools" cannot.

Second, a limit on tools and steps. Give the agent only the tools the job needs, preferably ones that only read, and a ceiling on how many steps it may take. A tool the agent does not have is one it cannot misuse.

Third, approval before risky actions. Anything that sends, deletes, pays or runs a command should pause until you have seen the exact action, as why an AI agent should ask before it acts argues. When to keep a human in the loop helps you sort the risky steps.

Fourth, a log you can read, kept by the software: every step, what was requested and what came back. A closing summary is the agent's account of itself, while the log is the record, so read at least the steps that changed something.

Fifth, a way to cancel mid-run, and a way back: a copy or backup of anything the agent may change.

These reduce risk without removing it. An approval clicked without reading protects nothing. Start with small jobs you can verify, and read the log closely the first few times.

Where NAMELESS stands

NAMELESS is an AI model still in training. It is not yet available, it has no launch date, and nothing described here can be tried on it. The goal is a model on its own architecture, with unlimited context and no rereading of the conversation, extremely fast, with stronger logic and reasoning. However well a model reasons, something outside it still has to catch its mistakes: a stop condition, a step ceiling, approval before risky actions and a readable log. If this is the kind of model you want to follow, join the waitlist.

Keep reading

All posts