What Is an AI Agent?
What an AI agent is, how its loop of model, tools and results works, and how it differs from a workflow, explained simply for your AI interview.
In short
An AI agent is a system where a language model works toward a goal by calling tools and deciding its own next step after each result. It keeps looping until the goal is met or a stop rule ends the run, so it acts as well as answering.
11 min readBeginnerVery common · estimateFacts checked 26 November 2026
Say it out loud
Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.
An AI agent is a system built around a language model. It runs a loop. It reads my goal, picks a tool such as a policy lookup, sees the result, and decides the next step until the goal is met or a limit stops it. The key difference from a simple chatbot is that it takes actions through tools. Because it acts on its own, I put step limits, permission checks and a human approval step around it.
A simple chatbot reads your message, writes a reply and stops. An AI agent keeps going. It is a system built around a large language model (LLM) that works toward a goal by calling tools, such as looking up a record, reading a file or sending a message. It chooses its next step after each result. OpenAI describes agents as systems that independently accomplish tasks on your behalf.
Under the hood it is a loop. The model gets the goal and the list of tools. It asks for one tool, my code runs that tool, and the result goes back into the model. The loop repeats until the goal is met or a stop rule fires, such as a maximum number of steps. Anthropic says agents are typically just LLMs using tools based on environmental feedback in a loop.
In an interview, I draw the line between a workflow and an agent. A workflow follows a path that developers write in code. An agent lets the model pick the path while it runs. Anthropic recommends finding the simplest solution possible, so I would not build an agent for a job a fixed script can do.
Agents bring risk. They cost more per task, and errors can compound across steps. So I set a step limit, give each tool the least access it needs, and send risky actions to a person. In a claims agent, it can read the file and ask for a repair quote, but a human approves any payment.
What is an AI agent, in plain words?
A simple chatbot reads your message and writes a reply. That is the end of it. An AI agent is a system built around a language model. It is given a goal and a set of tools, then works through the steps itself until the goal is met.
Think of a new claims handler in their first week at an insurer. They get a file, look up the policy, check the photos, call the garage, and only then decide. Each step depends on what the last one found. An agent works the same way, with a model as the one deciding and tools as its hands. In an AI claims agent, the model asks a tool for the policy, then asks a tool for a repair quote, and your code runs each tool.
Key words
- Agent
- A system that picks its own next step and uses tools to reach a goal.
- Model
- The language model that reads the goal and each result, then decides.
- Tool
- A function your code can run, such as looking up a policy or sending an email.
- Loop
- The repeat cycle: decide, call a tool, read the result, decide again.
How does an agent loop work, step by step?
OpenAI's 2026 guide says an agent has three core parts: a model, tools and instructions. The model is the part that decides. OpenAI's guide names the repeating cycle a run. A run is typically a loop that keeps going until an exit condition is reached.
One run of an agent
Your goal
e.g. settle one car claim
Model
reads the goal and each result
Each turn
Call a tool
your code runs it, not the model
Reply to the user
when the goal is met
Stop
the goal is met
- 1The goal goes in as the first message.
- 2The model asks for one tool, such as a policy lookup.
- 3The tool's result goes back into the model, and the loop repeats.
- 4Once the goal is met, the model writes its answer.
- 5The answer goes to the person, and the run ends.
- 1
Get the goal
Your app gives the model the goal, its rules and the list of tools it may use.
- 2
The model picks one tool
It asks for a tool and the inputs it needs. It does not run the tool itself.
- 3
Your code runs the tool
Your code checks the request, runs the tool and collects the result.
- 4
The result goes back in
The model reads the result and decides the next step.
- 5
Stop when done or at a limit
The loop ends when the goal is met or a step cap is reached.
Here is the loop in a few lines of plain Python. The model is a stand-in, so the loop and its stop rule are easy to see. The step cap is the line that matters most.
# A simplified claims agent loop. The "model" is a stand-in that picks the next tool.
MAX_STEPS = 15
PLAN = ["lookup_policy", "read_photos", "request_repair_quote"]
TOOLS = {
"lookup_policy": lambda: "policy P-2291 is active",
"read_photos": lambda: "3 photos, rear bumper damage",
"request_repair_quote": lambda: "quote received: 1240 USD",
}
def model_pick(step):
# Stand-in for the model: asks for the next tool, or None when it has enough.
return PLAN[step] if step < len(PLAN) else None
def run_agent(goal):
for step in range(MAX_STEPS): # the step cap stops a runaway loop
tool = model_pick(step)
if tool is None:
return "DONE: " + goal
if tool not in TOOLS:
return "STOPPED: unknown tool " + tool
result = TOOLS[tool]() # your code runs the tool, not the model
print(step + 1, tool, "->", result)
return "STOPPED: step limit reached, send to a human"
print(run_agent("settle claim 88712"))Output
1 lookup_policy -> policy P-2291 is active 2 read_photos -> 3 photos, rear bumper damage 3 request_repair_quote -> quote received: 1240 USD DONE: settle claim 88712
This demo finishes in three steps, so the cap never fires. If the model kept asking for the same lookup, the loop would stop at step 15.
How is an agent different from a workflow?
A workflow is a fixed path that developers write in code. An agent lets the model decide the path while it runs. Both can use language models and tools. The difference is who chooses the next step.
Workflow versus agent
New customer request
a refund or a claim, say
Workflow
Your code runs the steps
the order is fixed in your code
Agent
Model picks each step
picks each next tool itself
Predictable path
easy to test and audit
Path varies by case
needs limits and checks
- 1The request follows the fixed steps.
- 2The request goes to the model, which picks each step.
- 3The steps run in the order your code sets.
- 4The path changes with each case, so it needs limits and checks.
Three AI companies describe agents in similar words:
“Agents are systems that independently accomplish tasks on your behalf.”
OpenAI
“Agents, on the other hand, are systems where LLMs dynamically direct their own processes and tool usage, maintaining control over how they accomplish tasks.”
Anthropic
“AI agents are software systems that use AI to pursue goals and complete tasks on behalf of users.”
Google Cloud
Tip
Asked to define an agent, give the one-line test: does the model choose the next step? If not, it is a workflow, and a fixed script may be the better and cheaper choice.
What makes an agent risky to run?
An agent can take actions, so its mistakes cost more. Anthropic names two costs of this autonomy: higher costs, and the potential for compounding errors, because each extra step can build on a wrong one.
Take a claims agent with made-up numbers. On a normal claim it makes about 12 tool calls. One day a bad tool result leaves it stuck on the same policy lookup. Without a step cap, that lookup repeats hundreds of times. With a cap of 15, the run stops, is logged and goes to a human claims handler.
- No stop rule
The loop keeps going
The stuck lookup repeats hundreds of times while the bill keeps climbing.
- With a stop rule
Stops at 15 steps
The run ends, is logged and goes to a person. The claim waits, which costs time.
OpenAI's guide says actions that are sensitive, irreversible or high stakes should trigger human oversight until confidence in the agent's reliability grows. Its examples are cancelling user orders, authorising large refunds and making payments.
What does the interviewer want to hear?
A strong answer covers
- A plain definition: a system that picks its own steps and uses tools to reach a goal.
- Agent versus chatbot: an agent uses tools and reads their results, while a simple chatbot just replies.
- Agent versus workflow: who chooses the next step.
- The loop, with a stop rule such as a step limit.
- Cost and risk: errors compound, so people approve risky actions.
- Simplest first: a fixed script often beats an agent.
Common traps
Trap"An agent is just a chatbot with a longer prompt."
BetterThe difference is the loop and the tools. A simple chatbot answers once, while an agent acts and reads the results.
Trap"The model runs the tools."
BetterThe model only asks. Your code checks and runs each tool, so that is where limits and approvals go.
Trap"Every LLM app is an agent."
BetterNot if the model only writes text. OpenAI says applications that don't use the model to control the workflow are not agents.
Can you spot the safe loop?
Spot the safe loop
Which option is the safest way to run a claims agent?
Quick check
An agent's bill jumps because a tool keeps failing and the loop keeps retrying. What should you add first?
Can you answer these from memory?
Flash cards · tap a card to flip it
What will they ask next?
Learn it in depth
Last updated on 26 November 2026
Building an agent that works through your tools and data?
I design and build AI agents, including the screens people use to run them and the limits and approvals behind them. Book a short call and tell me what your agent needs to do.