What Is an AI Agent? How It Works and How It Differs From a Chatbot
The definition, the agent loop and use cases from the OpenAI and Anthropic guides, the risks from OWASP and six steps to a first agent.
In short: An AI agent is software that carries out a goal you give it, step by step, on your behalf. The language model inside it picks the next step itself, calls tools such as search, a database or email, reads the result and keeps going until the job is done or it hits a limit. A chatbot mostly answers the question and leaves the next step to you.
An AI agent differs from a chatbot in one basic way. A chatbot answers your question and waits. An agent takes on a piece of work, such as settling a refund request, and takes the steps needed to finish it by itself.
What is an AI agent?
#An AI agent is a system that completes a task on your behalf with a high degree of independence and lets a language model make its decisions. The definition in OpenAI's A practical guide to building agents, published in April 2025, is that short: agents are systems that independently accomplish tasks on your behalf. The guide adds two core characteristics.
- A language model runs the work: The agent uses a language model to manage the workflow and make decisions. It recognizes when the work is complete, corrects its actions if needed and, if it fails, stops and hands control back to the user.
- It uses tools: The agent has access to tools that connect to external systems, both to gather information and to take action, and it picks which tool to call based on the current state of the work. It always does this within clearly defined guardrails.
Anthropic's Building effective agents, published in December 2024, draws a similar line. In its definition, an agent is a system where the language model dynamically directs its own process and tool use and keeps control over how it accomplishes the task. Anthropic has since added a note at the top of the page saying that much of the tooling landscape described in the post has changed since December 2024, and it points to its post on how it built Claude Managed Agents and to the Managed Agents documentation for its current approach. The definition of an agent and the distinction between workflows and agents stand unchanged in the main text.
The core part of an agent is a large language model (LLM). We explain how a model produces text and how an application connects to it through an API in What is an LLM.
How does an AI agent work?
#An AI agent works by running a language model in a loop together with tools and instructions. According to the OpenAI guide, an agent in its most basic form has three parts.
- Model: The language model that does the reasoning and makes the decisions.
- Tools: External functions or APIs the agent uses to take action. The model calling these tools is known as tool calling.
- Instructions: Explicit guidelines and guardrails that define how the agent behaves.
How does the agent loop work, step by step?
#These parts work in a loop. Picture an agent asked to settle a customer's refund request.
- The agent receives the goal: settle this customer's refund request.
- The model picks the first step and calls a tool if needed, for example to read the order record.
- It reads the result the tool returns. Anthropic considers it crucial that the agent gets "ground truth" from its environment at each step to assess its progress. A tool call result or the output of code it ran is this kind of information.
- It picks the next step based on that result. The plan can change as it learns along the way.
- It stops when the work is done or when it reaches a stopping condition. According to Anthropic, the task often ends on completion, but it is also common to add stopping conditions, such as a maximum number of iterations (steps), to keep control. The agent can ask a human for feedback at checkpoints or when it gets stuck.
Calling a model once with a single question does not set up this loop. What makes an agent an agent is that the model picks the next step and repeats this until it sees the result. The OpenAI guide also puts the loop at the center of how an agent works: the agent runs in a loop until it reaches an exit condition.
How does an AI agent differ from a chatbot?
#The difference between an AI agent and a chatbot is who runs the workflow. The OpenAI guide says so plainly: applications that use a language model but do not use it to control the workflow are not agents. Its examples are simple chatbots, single-turn model calls and sentiment classifiers.
| Criterion | Chatbot | AI agent |
|---|---|---|
| Main job | Answer questions, give information | Take a goal through to a result |
| Who picks the next step? | The user | The model, within the limits it is given |
| Tool use | None, or a single fixed lookup | Several tools, chosen as the situation requires |
| When does it stop? | Once it has answered | When the work is done, when it hits a limit or when it hands over to a person |
| If something goes wrong | A wrong answer stays on the screen | A wrong step can also affect the steps after it |
| Typical use | FAQs, product information, routing | Refunds, record updates, research and reports, code changes |
Many chat apps can call tools today. In that case the interface does not settle the question. What matters is who picks the next step in a task that takes more than one step. If you direct the steps, you have a chatbot. If the model directs them, you are working with an agent.
Chatbot or AI agent: which one do you need?
#Whether you need a chatbot or an AI agent depends on the kind of work.
- Chatbot: A chatbot is enough when the user wants information and will take the action themselves. FAQs, product information and document summaries fall into this group.
- AI agent: You need an agent when the work requires actions in more than one system and the order of steps changes with the situation.
- Both together: A chatbot talks with the user up front, and an agent carries out the actions behind it. Put human approval on steps that cannot be undone.
Getting this distinction clear is also where a first agent project starts. RuneLab's AI Agent Fundamentals course opens with the differences between chatbots, workflow automation and agents, then works through choosing the right first use case for an organization by value, risk and feasibility.
How does an AI agent differ from a workflow?
#In a workflow the steps are set in code ahead of time, while in an agent the model directs its own process and decides which tools to use. Anthropic's Building effective agents groups both under "agentic systems" and draws this architectural line between them.
The same post recommends looking for the simplest solution possible first and adding complexity only when it is needed. Sometimes that means not building an agent at all. According to Anthropic, agentic systems trade latency and cost for better task performance. Workflows offer predictability and consistency for well-defined tasks, while agents are the better option where flexibility and model-driven decisions are needed. For many applications, a single model call improved with retrieval and in-context examples is usually enough.
- Workflow: If you can write the steps down in advance, a workflow is enough. For example, reading every incoming invoice, extracting the fields and writing them to the accounting system.
- Agent: An agent fits better when the number and order of steps change with the input, and writing that out as rules turns into a tangle of branches.
- Single model call: For a job that is done in one step, such as summarizing or classifying a text, a single model call will do.
In real processes the two often sit side by side. RuneLab's Agentic Workflow Design course starts from this distinction: it separates the steps in a process that need rules from those that need a model's decision, then builds a working flow in n8n or Power Automate with patterns such as prompt chaining, routing and evaluator-optimizer.
What are AI agents used for?
#AI agents add the most value in work that is hard to automate with rules. The OpenAI guide illustrates this with payment fraud analysis. A traditional rules engine works like a checklist and flags transactions based on preset criteria. An LLM agent works more like a seasoned investigator, weighing context and subtle patterns, and can spot suspicious activity even when no clear rule is broken. Among workflows that have resisted automation, the guide suggests prioritizing three kinds.
- Decisions that need nuanced judgment and exceptions: Context-sensitive decisions with many exceptions. The guide's example is refund approval in customer service.
- Rule sets that are hard to maintain: Systems whose rules have grown so many that updates become costly or error-prone. The guide's example is vendor security reviews.
- Work that relies on unstructured data: Interpreting natural language, extracting meaning from documents, talking with users. The guide's example is processing a home insurance claim.
Anthropic names two areas that stood out in its work with customers: customer support and coding agents. The examples from its own implementations are a coding agent that edits many files based on a task description, and the "computer use" example, where Claude uses a computer to get work done.
How are AI agents used in customer service?
#In customer service, an AI agent carries the conversation while using tools to pull customer data, order history and knowledge base articles, and it takes actions such as issuing refunds or updating tickets. That is why Anthropic sees customer support as a natural fit for agents.
The agent is not expected to solve everything itself, either. The OpenAI guide recommends that an agent hand over control when it cannot complete a task, and says that in customer service this means escalating the issue to a human agent. RuneLab's voice customer agent RuneVoice applies this handover on the phone. It answers from the organization's documents, the same source RuneDesk uses, does not make up an answer the source does not cover, and hands the call to a live agent instead. After each call it logs a summary and the outcome, and it takes calls in Turkish or English.
The common way to find answers in an organization's documents is RAG (retrieval-augmented generation). We explain how a model finds the answer in your documents in How RAG finds answers.
How do you build an AI agent?
#You can build an AI agent with code or with no-code tools, and the same steps apply whichever path you take. The OpenAI guide and the Anthropic post largely agree on them.
How do you choose the task, the structure and the tools?
#- Choose the task. The OpenAI guide recommends confirming that the work clearly meets the criteria above before you commit to building an agent, since otherwise a deterministic solution may be enough. Do not build an agent for work that rules can handle.
- Start with a single agent. According to the OpenAI guide, a single agent can take on many tasks as you add tools step by step, and this keeps complexity manageable. We cover when to move to more than one agent in One agent or many?
- Define tools narrowly and clearly. Write down what each tool does, what input it takes and what it returns. Anthropic devotes an entire appendix of its post to tool definitions and recommends giving them as much prompt engineering attention as your overall prompts. The same post points to the Model Context Protocol as one way to connect tools to a model, and we explain how it works in What is MCP. RuneLab's Tool-Using AI Agents: Function Calling in Practice course works through this step hands-on: tool schema and description design with JSON Schema, argument validation and an agent that runs on the OpenAI, Claude and Gemini APIs.
How do you set up limits, human approval and testing?
#- Write instructions and guardrails. The OpenAI guide recommends deriving instructions from existing operating procedures, support scripts and policy documents. Also write down what the agent must not do, and limit every action with a permission list. According to the guide, guardrails are not enough on their own and should be paired with robust authentication, authorization and strict access controls.
- Add stopping conditions and human approval. The OpenAI guide names two triggers for bringing in a human. One is the agent exceeding its limit on retries or actions, for example still failing to understand what the customer wants after several attempts. The other is sensitive, irreversible or high-stakes actions. The guide's examples are canceling user orders, authorizing large refunds and making payments. RuneLab's Human-in-the-Loop AI Agents course works on designing these thresholds: classifying tool calls by reversibility and business impact, setting risk-based approval thresholds by amount, confidence score and customer segment, and building approval flows that wait until a human responds.
- Test in an isolated environment and measure. Anthropic recommends extensive testing in sandboxed environments, along with appropriate guardrails. When choosing a model, the OpenAI guide also recommends setting up evals first to establish a performance baseline. We explain how to score agent output with a language model in LLM as a judge.
What are the risks of AI agents?
#The main risks of AI agents are compounding errors, rising cost, indirect prompt injection and actions that cannot be undone.
- Compounding errors: Anthropic writes that the autonomy of agents means higher costs and the potential for compounding errors. One wrong step early on can affect every step after it.
- Cost and latency: The longer the loop runs, the more model calls it makes. Our post on multi-agent systems has figures on how many more tokens an agent uses than a chat.
- Indirect prompt injection: According to OWASP's LLM01:2025 Prompt Injection page, indirect prompt injection occurs when a model accepts input from external sources such as websites or files. When the model interprets that content, it can alter the model's behavior in unintended or unexpected ways. A tool-using agent reads exactly this kind of content, so the risk is greater for agents. We walk through attack examples and defenses in What is prompt injection? RuneLab's AI Agent Security, Identity and Authorization course starts from this scenario: blocking unauthorized tool calls triggered by indirect prompt injection at the policy layer, granting least-privilege access on the user's behalf with OAuth On-Behalf-Of (OBO), and isolating code-executing agents in a sandbox.
- Actions that cannot be undone: Put actions such as deleting records or sending outbound messages behind human approval. The OpenAI guide likewise recommends that high-risk actions such as canceling orders, authorizing large refunds and making payments trigger human oversight until confidence in the agent grows.
What is Hermes Agent, and how do you install it?
#Hermes Agent is an open-source, MIT-licensed AI agent built by Nous Research. The README in its GitHub repository introduces it as the self-improving AI agent. According to the README, it creates its own skills after complex tasks and improves them as it uses them, keeps memory across sessions, can run scheduled tasks and can split work across subagents running in parallel. You can use it from Telegram, Discord, Slack, WhatsApp, Signal and the command line. The model is up to you: you can connect Nous Portal, OpenRouter, OpenAI or your own endpoint.
Is Hermes Agent free?
#The Hermes Agent software is free. According to the project's LICENSE file, it is MIT-licensed, copyright 2025 Nous Research. To run, though, it needs at least one model provider, as the Providers page of the Hermes Agent documentation states. Nous Portal is subscription-based. If you use an API key from a provider such as OpenRouter or OpenAI, that provider's pricing applies. A local model running on your own computer through Ollama needs no key.
How do you install Hermes Agent?
#As of 4 November 2026, the latest Hermes Agent release is v0.22.7, and the official Hermes Agent installation page leads with the Hermes Desktop packages. The desktop packages are for macOS and Windows. The macOS DMG runs only on Macs with Apple Silicon, and on Windows the package installs through Windows App Installer.
To install from the command line only, without the desktop app, these commands are enough on Linux, macOS and WSL2.
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
source ~/.bashrc
hermes
On zsh, the macOS default shell, the second line is source ~/.zshrc. On Windows 10 and 11, Hermes Agent runs without WSL2. The README describes native Windows as fully supported, and the Platform Support page of the documentation lists Windows 10 and 11 among its top-priority platforms. To install, run this command in PowerShell.
iex (irm https://hermes-agent.nousresearch.com/install.ps1)
After installing, you choose the model provider and model with hermes model and the tools to enable with hermes tools. hermes setup walks you through every setting in a single wizard.
Read a script downloaded from the internet before you run it. On a first try, run the agent in a separate environment where it cannot reach your business data, because the risks of indirect prompt injection and irreversible actions apply to a personal agent too.
Frequently asked questions
#What does AI agent mean?
#An AI agent is software that carries out a goal on your behalf, step by step. It picks the next step and the tool to use by itself.
What is the difference between a chatbot and an AI agent?
#A chatbot mostly answers the question and leaves the next step to the user. An AI agent picks the next step and the tool by itself to take a goal through to a result. By OpenAI's definition, simple chatbots that use a language model but do not let it control the workflow are not agents.
What are some examples of AI agents?
#The examples in OpenAI's guide are refund approval in customer service, vendor security reviews and processing a home insurance claim. Anthropic gives coding agents that edit many files and the computer use example, where the model uses a computer to get work done. Anthropic also names customer support as one of the areas where agents stand out.
How do you build an AI agent?
#First check whether the work really needs an agent: if rules can handle it, a workflow is enough. Then start with a single agent, define its tools narrowly and clearly, and write instructions and guardrails. Put human approval on actions that cannot be undone, and test the agent in an isolated environment before it goes live.
What is Hermes Agent?
#Hermes Agent is an open-source, MIT-licensed AI agent built by Nous Research, and its README introduces it as the self-improving AI agent. It creates skills from experience, keeps memory across sessions and can be used from Telegram, Slack or the command line. You are free to choose the model provider.
Is Hermes Agent free?
#The Hermes Agent software is MIT-licensed and free, but it needs at least one model provider to run. Nous Portal is subscription-based, and with an OpenRouter or OpenAI key that provider's pricing applies. A local model running on your computer through Ollama needs no key.
How do you install Hermes Agent?
#Hermes Agent can be installed with the Hermes Desktop packages for macOS and Windows, or from the command line. On Linux, macOS and WSL2 the official install script runs with a single curl command, and on Windows 10 and 11 with a PowerShell command. After installing, you choose the model with hermes model and the tools with hermes tools.
When do you need more than one agent?
#The OpenAI guide recommends getting the most out of a single agent first, and a single agent with tools is often enough. When instructions contain many conditional branches, or the agent keeps picking the wrong tool among similar ones, splitting the work across several agents may be necessary.
Sources
#- OpenAI, A practical guide to building agents: the definition of an agent and its two core characteristics, the three parts of an agent, applications that are not agents, the payment fraud example and the three kinds of use case, starting with a single agent, instructions, guardrails and human intervention
- Anthropic, Building effective agents: the distinction between agents and workflows, when to build agents, the agent loop and stopping conditions, agent examples, tool definitions, sandboxed testing and the editor's note on the page
- OWASP Gen AI Security Project, LLM01:2025 Prompt Injection: the definition of indirect prompt injection
- Nous Research, hermes-agent GitHub repository: the README's description and features, supported channels and model providers, native Windows support
- Nous Research, hermes-agent LICENSE: the MIT license
- Nous Research, Hermes Agent v0.22.7 release page: the latest release
- Hermes Agent documentation, Installation: the Hermes Desktop packages, the command-line install and the commands to run after installing
- Hermes Agent documentation, Platform Support: Windows 10 and 11 support
- Hermes Agent documentation, Providers: the need for a model provider, the Nous Portal subscription and local Ollama without a key
