THE SHORT ANSWER
An AI agent combines a model with instructions, tools, state and control logic. For each step it interprets the current goal, selects an action, receives an observation from the environment, verifies progress and either continues, asks for help or stops. The surrounding software executes tools and enforces permissions; the model does not act by magic.
The OpenSkool agent loop
Use one backbone throughout this module: GOAL → UNDERSTAND → CHOOSE → ACT → OBSERVE → VERIFY → CONTINUE / STOP. The loop is useful because it separates a model's proposal from an action in the world and from the evidence that follows.
| Stage | System question | Possible result |
|---|---|---|
| GOAL | What outcome is requested? | A bounded objective and success rule |
| UNDERSTAND | What is known, missing or constrained? | Relevant state and uncertainty |
| CHOOSE | Which allowed next step best advances the goal? | A response, tool request or question |
| ACT | Can the proposed step be executed safely? | The host runs or refuses the action |
| OBSERVE | What changed? | A tool result or environment state |
| VERIFY | Did the step work and remain within bounds? | Evidence, error or approval request |
| CONTINUE / STOP | Is another step justified? | Proceed, escalate, fail or finish |
Evidence & context: Anthropic
A model is only one part of the system
Instructions shape decisions; tools define possible actions; the environment contains the files, services or people affected; state records what has happened; and control logic restricts what may happen next. A stopping condition can be a verified outcome, a maximum number of attempts, a budget, a deadline or a required human decision.
In function calling, a model can return a structured request naming a function and its arguments. Application code validates and executes that request, then returns the result. This distinction matters: generating a tool call is a proposal; trusted software still decides whether and how to carry it out.
Evidence & context: OpenAI Developers
Control the loop from four directions
| Control | Question | Design response |
|---|---|---|
| CAPABILITY | Can the system perform this step reliably? | Use evaluated models and well-defined tools |
| PERMISSION | Is it allowed to perform this step? | Restrict scopes and separate read from write |
| COST | Is another step worth its resources and delay? | Use budgets, bounded retries and routing |
| HUMAN OVERSIGHT | Must a person decide or approve? | Place review before consequential actions |
Illustrative example: prepare a meeting
An agent receives the goal of proposing meeting times. It reads permitted calendars, identifies missing time-zone information, asks the user, selects three options and drafts an invitation. It does not send the invitation until the user approves the recipients and time. It then observes the calendar result and stops only after the event exists once.
Sources & further reading
- Building effective agents
Anthropic. A provider's engineering taxonomy of agents and workflows, not a universal industry definition. We use the conceptual distinction, not its changing product recommendations.
- Function calling
OpenAI Developers. Official documentation for model-selected function calls. The application, not the model, executes custom functions and must validate arguments, permissions and results.
- Generative Artificial Intelligence Profile (NIST AI 600-1)
NIST. Risk-management guidance, including confabulation. It does not establish a universal error rate.
Examples and exercises are illustrative unless attributed to a source. No independent expert review is claimed.
A correction, a counterexample or an experience worth sharing?
Join the conversation ↗