# What is an AI agent?

> An AI agent pursues a goal by looping through decide, tool use, and observe until it stops or asks a human.

Source: https://fullbytedeveloper.com/blog/what-is-an-ai-agent
Published here: 2026-11-16

An AI agent is software that uses a model to pursue a goal by choosing steps and tools in a loop until it finishes or asks a human. A chatbot that only returns text is not an agent. NIST's AI glossary calls an agent a program that takes self-directed actions toward an externally specified goal [1].

## Spot the decide-act-observe loop

Anthropic's 2024-12-19 guide separates workflows (fixed code paths) from agents (the model directs tool use from environmental feedback). Their short form: agents are typically large language models (LLMs, the text models behind chat tools) using tools based on feedback in a loop [2] [3]. OpenAI's practical guide says agents independently accomplish tasks on your behalf, and that apps which use an LLM without letting it control the workflow (simple chatbots, single-turn LLMs, sentiment classifiers) are not agents [5]. The developer track adds the same shape: instructions, guardrails, and tools [6].

OpenAI's running-agents docs describe the loop as: call the model, execute tool calls and continue, hand the job to another agent (a handoff), or return a final answer [7]. Anthropic's tool-use docs add that the model never runs tools itself. It emits structured requests; your client executes them and returns results in a loop that repeats while the reply's `stop_reason` is `"tool_use"` [4]. `stop_reason` is the field the model returns saying why it stopped, for example that it wants to call a tool or that it is done [4].

## Run a tiny educational loop

This script is not a product agent. It only shows the shape: decide, act, observe, stop. Create the same demo tree used in the [terminal commands part 1](/blog/essential-linux-commands-developers-part-1) post first, then run:

```bash
rm -rf /tmp/blog-demo
mkdir -p /tmp/blog-demo/{src,docs,.hidden}
cd /tmp/blog-demo
echo 'hello' > README.md
echo 'print(1)' > src/app.py
echo 'findme-unique-token' > src/needle.txt
echo 'note' > docs/note.txt
printf 'secret\n' > .hidden/key.txt
python3 - <<'PY'
observed = None
steps = []
for turn in range(5):
    if observed is None:
        action = ("list", "/tmp/blog-demo")
    elif isinstance(observed, list):
        action = ("count", len(observed))
    else:
        action = ("done", observed)
        steps.append(action)
        break
    if action[0] == "list":
        import os
        observed = [n for n in os.listdir(action[1]) if not n.startswith('.')]
        steps.append(("list", observed))
    elif action[0] == "count":
        observed = action[1]
        steps.append(("count", observed))
print(steps)
print("goal_met", observed == 3)
PY
```

You should see a list step with `README.md`, `docs`, and `src`, then a count of `3`, then `goal_met True`. A one-shot line like `print("There are probably some files.")` has no observe step, so it is the chatbot contrast, not an agent.

## Keep the caveats in view

The Center for Democracy and Technology's 2025-05-14 brief notes that "AI agent" still lacks one clear policy definition and spans chatbots to action-oriented systems [9]. Say "more agentic" when a product sits in the middle. NIST's 2025-08-05 tool-use note places models inside surrounding software (scaffolding) so they can manipulate tools; that is the leading pattern, not a claim that every chat product with search is an agent [8].

Do not treat agents as unsupervised by default. Anthropic's agent guidance is about when to add that loop and how to keep it simple [2]. For concrete stop-rules when a coding agent expands scope, use [how to stop an AI coding agent from over-engineering](/blog/stop-ai-coding-agent-over-engineering). For the related pattern of picking a fixed workflow before an agent, see [choose an AI workflow before building an agent](/blog/choose-ai-workflow-before-agent) and [five rules for building an AI agent that works](/blog/five-rules-for-effective-ai-agents).

## Keep an agent within its task

Use [Claude Code deny rules](/blog/claude-code-deny-rules) before granting tools, [context commands](/blog/claude-code-compact) when a task grows, and [a 429 retry](/blog/retry-after-header-python) when a service asks the client to wait.

For a later Anthropic Labs pattern that splits long builds across planner, generator and evaluator roles, see [Anthropic planner, generator, evaluator pattern](/blog/anthropic-planner-generator-evaluator).

Send this to the friend who calls every chatbot an AI agent.

Image: Diagram of an AI agent loop on a dark background. Four numbered cards sit in a row: 1 Goal, the job to finish; 2 Tools, the agent picks a tool and runs it; 3 Observe, it reads the result and decides what to do next; 4 Done, the goal is met, so it stops. Labels above the gaps between the cards read picks a tool, reads the result, and goal is met. A return arrow under the first three cards reads loops until it is done.
https://fullbytedeveloper.com/media/what-is-an-ai-agent/agent-loop.webp
An AI agent works a goal by using tools, reading the result, and looping until the job is done. A chatbot only answers in words.

Video: Agent loop animation
https://fullbytedeveloper.com/media/what-is-an-ai-agent/agent-loop.webm
The same agent loop, stepped one stage at a time: goal, tools, observe.
Poster: https://fullbytedeveloper.com/media/what-is-an-ai-agent/agent-loop.webp
Transcript: Short looping animation of the same four-card AI agent diagram. The Goal, Tools, and Observe cards highlight in turn to show the loop, while Done stays at the end of the row.

## Sources

1. [NIST CSRC glossary: agent (AI 100-2e2025), accessed 2026-11-12](https://csrc.nist.gov/glossary/term/agent)
2. [Anthropic: Building effective agents (2024-12-19)](https://www.anthropic.com/research/building-effective-agents)
3. [Anthropic: Trustworthy agents in practice (2026-04-09)](https://www.anthropic.com/research/trustworthy-agents)
4. [Anthropic: How tool use works, accessed 2026-11-12](https://platform.claude.com/docs/en/agents-and-tools/tool-use/how-tool-use-works)
5. [OpenAI: A practical guide to building AI agents (2026-01-15)](https://openai.com/business/guides-and-resources/a-practical-guide-to-building-ai-agents/)
6. [OpenAI: Building agents, accessed 2026-11-12](https://developers.openai.com/tracks/building-agents)
7. [OpenAI: Running agents, accessed 2026-11-12](https://developers.openai.com/api/docs/guides/agents/running-agents)
8. [NIST: Lessons learned on tool use in agent systems (2025-08-05)](https://www.nist.gov/news-events/news/2025/08/lessons-learned-consortium-tool-use-agent-systems)
9. [CDT: AI Agents In Focus (2025-05-14)](https://cdt.org/wp-content/uploads/2025/05/2025-05-14-AI-Gov-Lab-AI-Agents-In-Focus-brief-final.pdf)
