What Are AI Agents?
An agent is a model in a loop with tools and a stopping condition. Agency is a spectrum, not a personality. Most products need less of it than the demo.
- agents
- tools
If the model cannot change anything outside the text box, you have a chatbot. That is a legitimate product. Stop calling it an agent because the landing page needed a noun. AI agents start when the model can propose an action, your code may run that action, and a loop decides whether to stop.
The demo is always a free-running planner that “just handles it.” Production is a GitHub issue bot that may list issues, add a bug label, and draft a comment, then halt after three steps or one write. Agency is a spectrum. Most apps should live on the thin end.
Key takeaways
- An agent is a model in a loop with tools and a stop rule you own.
- A chatbot that only emits text is allowed. It is not an agent.
- Agency is a spectrum: extract, route, one tool call, multi-step, multi-agent.
- Most product work is “one tool, maybe two,” not a planner with a personality.
- Caps, auth, and a definition of done are the product. The model is the sampler in the middle.
What AI agents are, and what they are not
Minimum ingredients:
- A model that can emit either a final message or a structured tool call.
- Tools your process knows how to run (search,
list_open_issues,post_comment). - A loop that feeds tool results back as observations.
- A stop condition that does not depend on the model’s manners: max steps, wall clock, abort, “no tool call,” “write already happened.”
Take any one of those away and you have something else. No tools: a generator. No loop: a single function call dressed up. No stop: a bill.
This is closer to a request handler with a weird coworker than to a person. The coworker suggests add_label. Your handler checks the repo ACL and runs GitHub. The JSON is a proposal. See function calling.
Agency as a spectrum
Name the level you are actually shipping. Inflating the name does not add capability.
| Level | What the model does | Stop | Example |
|---|---|---|---|
| Processor | Map text to a schema | One completion | Extract orderId from an email |
| Router | Pick a path | One completion | “billing” vs “docs” vs “human” |
| Single tool | One structured call you run | Call, then maybe a recap | get_invoice(id) |
| Multi-step | Call, observe, call again | Max steps / deadline | Issue bot: list, then label, then comment |
| Multi-agent | Separate prompts and toolboxes | Per-agent caps plus a supervisor cap | Researcher + patch-applier with different FS rights |
Levels 1-3 are where frontend teams get value first. You already know how to type a response, show a spinner, and hit a route. Level 4 is the think, act, observe loop. Level 5 is multi-agent systems, and it is usually a substitute for a missing tool until it is not.
An issue bot, not a persona
A concrete thin agent. User says: “Triage acme/web issues about the login page.” The model never gets curl or a shell.
type IssueId = string;
type IssueTool =
| { name: 'list_open_issues'; args: { repo: 'acme/web'; query: string } }
| { name: 'add_label'; args: { issueId: IssueId; label: 'bug' | 'docs' | 'question' } }
| { name: 'post_comment'; args: { issueId: IssueId; body: string } };
type AgentEvent =
| { type: 'final'; text: string }
| { type: 'tool'; call: IssueTool };
async function runIssuePass(events: AgentEvent[], user: { token: string }) {
const last = events[events.length - 1];
if (last.type === 'final') return last;
switch (last.call.name) {
case 'list_open_issues':
return github.search(user.token, last.call.args);
case 'add_label':
await assertCanWrite(user, last.call.args.issueId);
return github.addLabel(user.token, last.call.args);
case 'post_comment':
await assertCanWrite(user, last.call.args.issueId);
return github.comment(user.token, last.call.args);
}
}
Notice what is not here: a name, a backstory, a “you are a senior triage engineer” novel. The schema and the ACL do the steering. The loop (next page in this cluster) caps steps. Writes go through assertCanWrite. Reads can be parallel; writes should be serial and often paused for a human.
If the product only drafts the comment and a person clicks Send, you still have an agent, just with a short leash. That is usually the right leash.
Most products need less agency than the demo
Demos optimize for “it kept going.” Products optimize for “it stopped in a known state.”
You probably want less agency when:
- The user can do the click themselves in two seconds (don’t automate the settings page).
- The action is irreversible (refunds, deletes, emails to customers).
- The environment is untrusted (retrieved HTML, uploaded PDFs: prompt injection).
- You cannot see a trace. If you cannot answer “which tool, which args, which observation,” you cannot debug.
You might want more agency when:
- The task is a sequence of reads (search logs, then open one trace, then summarize).
- The write is gated (draft a PR, do not merge it).
- A human is in the loop on the side-effect tools.
Failure modes (loops, hallucinated observations, skipping confirmation) are their own catalog: agent failure modes. The beginner move is not “read that list and add twenty guards.” The beginner move is: fewer tools, smaller max-steps, no shell.
Frontend instincts still apply. Users mash Stop: AbortController. The model has no memory across requests unless you send it. Keys stay off the bundle.
Interview answer (out loud)
“An AI agent is a model in a loop with tools and a stopping condition I own. If it cannot change anything outside the string, it is a chatbot, and that is fine. Agency is a spectrum from structured extraction up through multi-step tool use. I would ship an issue bot with three tools, auth on writes, and a max-step cap before I shipped a free-running planner. The JSON is a proposal. My process runs the function.”
Further reading (primary sources)
Related on this site
Related guides
- Function Calling and ToolsTool calling is the model emitting a structured call you execute. You run the function. The model never gets a shell unless you hand it one.
- Tool Schema DesignA tool schema is an API the model will misuse. Names, enums, tight types, and descriptions that prevent "search" from becoming "drop table".
- Agent Failure ModesAgents loop, lie about tool results, skip confirmation, and get stuck apologizing. Catalog the failures and the circuit breakers.
- Agent HandoffsA handoff passes the conversation to another agent with a slimmer prompt and different tools. What to copy, what to drop, and how to avoid ping-pong.
- Agent MemoryAgents forget when the context window ends. Working memory, session summaries, and long-term stores are three different systems. Do not mix them.