The word “agent” is being attached to almost every AI feature right now. A prompt calls a model, the model returns JSON, and suddenly the architecture diagram has an agent in it.
That label is not harmless. An agent brings a loop, tool access, state, new failure modes, more latency, and a larger surface to evaluate.
A useful default is much simpler:
Use the least autonomous architecture that can solve the problem reliably.
Sometimes that is one LLM call. Sometimes it is a workflow controlled by your code. An agent becomes useful only when the model must decide what to do next based on what it discovers.
This article gives you a practical way to choose.
Three architectures that are often confused
1. A direct LLM call
Your application provides an input. The model returns an answer or a structured object. Your code validates the result and continues.
Input → Model → Validated output
Examples include:
- Classifying a support ticket
- Extracting fields from an invoice
- Rewriting text for a specific audience
- Generating a summary from supplied documents
- Producing a typed object from a prompt
There may be retrieval or context preparation before the call. That still does not make the system an agent if the model is not controlling the execution path.
2. A deterministic workflow
A workflow uses multiple steps, but your application decides the order.
Input → Classify → Retrieve → Draft → Validate → Output
A model can power one or more steps. The important point is that code owns the control flow.
For example, a document processing system might:
- Extract text from a file
- Classify the document
- Choose a schema with normal application logic
- Ask a model to extract structured data
- Validate the result
- Send invalid results to review
This is more capable than one model call, but it is still predictable. You can inspect every stage, retry a specific step, and write focused tests for each transition.
3. A tool using agent
An agent receives a goal and controls at least part of the execution path. It chooses an action, observes the result, and then decides what to do next.
Goal → Decide → Use tool → Observe → Decide again → Finish
OpenAI describes an agent as a system that independently accomplishes tasks and uses an LLM to manage workflow execution. Anthropic makes a similar distinction between workflows with predefined code paths and agents where the model directs its own process and tool use.
The idea is closely related to the ReAct pattern, which combines reasoning with actions and observations from an external environment.
The key difference is control.
A model inside a workflow follows the path your code selected. An agent helps select the path.
A practical comparison
| Question | Direct call | Fixed workflow | Agent |
|---|---|---|---|
| Who controls the next step? | Application | Application | Model within guardrails |
| Number of model turns | Usually one | Known in advance | Varies by task |
| Tool choice | None or fixed | Chosen by code | Chosen at runtime |
| Predictability | High | High to medium | Medium to low |
| Latency | Lowest | Bounded | Variable |
| Cost | Lowest | Bounded | Variable |
| Debugging | One request and response | Inspect each stage | Inspect the full trace |
| Best fit | Transformation or judgment | Known business process | Open ended investigation and action |
This table is not a maturity ladder. An agent is not the advanced version of every LLM feature. Each architecture solves a different control problem.
The question that usually decides it
Ask this:
Can my application know the next step before it sees the current result?
If the answer is yes, keep the control flow in code.
If the answer is no because the result determines which source to inspect, which tool to use, or whether the plan must change, an agent may be justified.
Consider a production incident assistant.
A fixed workflow can always fetch the same dashboard, read the latest deployment, summarize recent logs, and prepare a report. That works when the investigation procedure is stable.
An agent is useful when the evidence changes the investigation. A database timeout might lead it to query slow operations. A deployment error might lead it to inspect a change set. A regional spike might lead it to compare infrastructure metrics. The next useful action is discovered during the task.
That is agent shaped work.
When one LLM call is enough
Use a direct call when the task has one clear transformation and the application already has the required context.
Good examples include:
- Turn these notes into a concise update
- Map this ticket to one of eight categories
- Extract these fields using this schema
- Compare two pieces of text
- Draft a reply from the facts provided
A direct call is easier to operate because it has a small failure surface. You can validate structured output, set a timeout, retry a safe request, and measure quality against a focused data set.
Do not add an agent just because the prompt contains several instructions. A capable model can perform substantial reasoning inside one call. Internal reasoning is not the same as autonomous execution.
When a workflow is the better design
Use a workflow when the task has several steps but the allowed path is known.
Imagine an internal request system:
- Classify the request
- Retrieve the relevant policy
- Draft a response
- Check the response against required rules
- Route uncertain cases to a person
The model still provides valuable judgment. Your code keeps control of sequencing, permissions, retries, and approval.
Workflows are especially strong when:
- The steps map to a business process
- Each stage has a clear input and output
- You need predictable latency or cost
- Different failures need different recovery logic
- Compliance requires an auditable path
- A write action must always pass through approval
A workflow can also include model based routing. If the model chooses one of a small set of validated routes, the overall system can remain deterministic enough to test and operate.
When an agent earns its complexity
An agent becomes useful when several of these conditions are true:
- The task is open ended and has more than one valid path
- The model must choose among tools using intermediate evidence
- The number of steps cannot be known in advance
- The system must recover from failed actions or incomplete information
- Success can be checked with tests, rules, or other clear evidence
- The available tools and permissions can be tightly bounded
- The value of completing the task exceeds the extra cost and latency
Strong examples include:
Investigating a software failure
The agent can search logs, inspect recent changes, run safe diagnostics, compare symptoms, and revise its theory as evidence arrives.
Updating a codebase toward a clear goal
The agent can inspect the repository, edit files, run tests, study failures, and repeat until the acceptance criteria pass.
Research across changing sources
The agent can search, open relevant sources, follow useful leads, reject weak evidence, and stop when the research question has enough support.
In each case, a fixed sequence would either be too rigid or would require you to encode a large decision tree that the model is better placed to navigate.
The cost of an agent is more than tokens
Every additional turn can add:
- Model latency
- Tool latency
- More tokens and provider cost
- Another opportunity to choose the wrong action
- More state to store and inspect
- A larger security boundary
There is also a simple reliability effect. If a ten step process had a 98 percent chance of success at every step, a simplified independent model would give the whole path only about an 82 percent chance of completing without an error.
Real failures are not independent, so this is not a production formula. It is a reminder that small uncertainties compound across a long run.
For agents, monitoring one final answer is not enough. You need the trace: model decisions, tool calls, results, guardrails, retries, and handoffs. OpenAI's guidance on agent evaluations recommends evaluating the complete workflow so you can see whether the right tools were selected and whether instructions were followed.
Autonomy also changes the security model
A direct call produces content. An agent may read private data or take actions in other systems.
That makes prompt injection, excessive permissions, accidental writes, and data leakage architectural concerns rather than prompt quality concerns.
OpenAI's agent safety guidance recommends structured data between steps, tool approvals, guardrails, and evaluation of traces. These controls matter because untrusted text can influence later tool calls.
A useful permission model is:
- Give each tool the narrowest capability it needs
- Separate read tools from write tools
- Validate every tool argument in application code
- Require approval before consequential actions
- Set limits on turns, cost, and elapsed time
- Define when the agent must stop and ask for help
- Keep an audit trail that explains what happened
An agent should never receive broad access merely because it might be convenient.
When an agent is unnecessary
You probably do not need an agent when:
- One response can solve the task
- The sequence of steps is already known
- Tool choice can be expressed with ordinary conditions
- The result must arrive within a tight latency budget
- Cost must be predictable per request
- A wrong action would be difficult to reverse
- You cannot define what successful completion looks like
- You do not yet have evaluations for the simpler design
A common warning sign is building an agent loop before establishing a reliable direct call. Start with the smallest working baseline. Measure where it fails. Add retrieval, a validation step, or a fixed workflow if that solves the real problem. Introduce autonomy only when the remaining failure is about choosing the path.
A decision checklist
Before building an agent, answer these questions:
- What exact outcome must the system produce?
- Can one model call produce it from the available context?
- If not, are the required steps known in advance?
- Does new evidence genuinely need to change the next action?
- Which tools are required, and can their permissions be narrowed?
- How will the system verify progress and completion?
- Which actions require human approval?
- What are the limits for turns, time, tokens, and cost?
- Can a failed action be retried or reversed safely?
- Do you have examples that test both success and failure paths?
The result usually points to one of three choices:
Can one response solve the task?
Yes → Use a direct LLM call
No → Are the steps known in advance?
Yes → Use a deterministic workflow
No → Must intermediate results determine the next tool or action?
Yes → Consider an agent with bounded tools and clear stop rules
No → Simplify the problem before adding autonomy
Final thought
The best AI architecture is not the one with the most autonomy. It is the one that places judgment in the right layer.
Let the model generate, interpret, and reason where those abilities create value. Let normal code own the path when the path is already known. Use an agent when the work truly requires exploration, adaptation, and action across tools.
Start with one call. Add a workflow when the process needs structure. Add an agent when the process itself must be discovered.
Top comments (0)