Choosing between rule-based systems vs agents is a choice about who decides the next step. In a rule-based system, a person has already decided: the rules were written in advance, and the system applies them. In an AI agent, the model decides at run time, step by step, from the goal, the tools available, and what it learns from results so far. The decision turns on how well the work can be stated in advance, how much it must be audited, and what happens when something unexpected arrives.
What a rule-based system and an AI agent each are
A rule-based system represents domain knowledge as rules and uses general-purpose reasoning to solve problems in that domain. Production systems use if-then rules to derive actions from conditions. A typical system has a rule base, an inference engine, working memory holding the facts of the current case, and a connection to the outside world. The engine runs a match-resolve-act cycle: it matches rule conditions against working memory, resolves which satisfied rule to execute, and acts, which may change working memory and start the cycle again.
An expert system is the best-known form: a knowledge base of facts and rules, plus an inference engine that deduces new facts. Its useful property here is explanation. The engine can explain a conclusion by tracing back over the firing of the rules that produced it.
Decision tables are a common way to write rules down: input values and the output they produce, one rule per row. The Decision Model and Notation standard, maintained by the Object Management Group, standardises this form. A table also declares a hit policy, which specifies what happens when more than one rule matches: under UNIQUE only a single rule may be satisfied, under FIRST the first satisfied rule wins, and under COLLECT all satisfied rules contribute, optionally aggregated. In the Camunda engine’s documentation, the default is UNIQUE. The table plus its hit policy is the decision logic. There is no hidden step.
An AI agent is different. NIST’s glossary defines an agent as software that can interact with its environment, receive information, and undertake self-directed actions in service of a larger, externally specified goal. Anthropic draws the line in the same place: workflows orchestrate language models and tools through predefined code paths, while agents are systems where language models dynamically direct their own processes and tool usage. An agent receives a goal, plans its own steps, calls tools, observes results, and adapts. The ReAct pattern (Yao et al., 2022) states that loop clearly: the model generates reasoning traces and actions in an interleaved manner, so reasoning helps it induce, track, and update plans and handle exceptions, while actions gather information, and the model creates, maintains, and adjusts high-level plans as it goes. A rule-based system executes a decision someone already made. An agent makes the decision again, for each case, at run time.
When a rule-based system is the right choice
Use rules when the work can be stated in advance. If inputs are bounded and well understood, the correct outcome for each combination can be written down, and the same input must always produce the same output, rules are the simpler and safer choice. The test is enumerability: can the team list the cases that matter, including edge cases, and write the rule for each one? If yes, there is nothing for a model to decide at run time that a person has not already decided.
Use rules when the decision must be shown, not just trusted. Where auditability or compliance requires showing exactly which rule fired and why, a rule base with an explanation trace answers directly. That replayability has two conditions: the rule set must cover the inputs it will actually receive, and overlapping rules must be resolved by a declared hit policy or conflict-resolution rule. Without them, the same inputs do not guarantee the same result, and determinism would be overstated. With them, the outcome for a given input is fixed by the rules as written.
Use rules when the task rarely changes and failure must be predictable. A stable pricing rule, a routing rule based on fixed categories, or an eligibility check with stated criteria are cases where the cost of a surprising answer exceeds the cost of maintaining the rules. When a rule is wrong, it fails the same way for the same input, which makes it findable, fixable, and testable.
When an AI agent is the right choice

Variable inputs alone do not settle the choice. Free text, varied documents, and requests phrased in ways the team has never seen may justify a bounded model call inside a predefined workflow — for example, a routing step that classifies the request — without requiring an autonomous agent. Choose an agent when the inputs vary and the required sequence or number of steps also needs model-directed planning and adaptation: agents are for open-ended problems where it is difficult or impossible to predict the required number of steps, and where a fixed path cannot be hardcoded. The model may operate for many turns, and the team must have some trust in its decision-making.
Use an agent when the goal needs multi-step judgement and recovery: the next step depends on the previous result, a step can fail and the plan must change, and information must be gathered from several sources. The ReAct loop is built for that work. In one reported evaluation, ReAct outperformed imitation and reinforcement learning baselines by an absolute improvement of 34 percentage points in success rate on ALFWorld and 10 percentage points on WebShop, prompted with only one or two in-context examples. Those are absolute gains over those baselines on those benchmarks, not success rates achieved. They support one narrow point only: on ALFWorld and WebShop, interleaved reasoning and action outperformed those imitation and reinforcement learning baselines. Whether a fixed path suffices for a given task is a separate question, answered by Anthropic’s architectural guidance — workflows for well-defined tasks, agents when flexibility and model-driven decision-making are needed — not by this benchmark.
Use an agent when adaptability matters more than bit-for-bit reproducibility, and when the cost of an occasional wrong answer can be contained. Anthropic recommends extensive testing in sandboxed environments and appropriate guardrails, because autonomy brings higher costs and the potential for compounding errors. An agent should pause for human feedback at checkpoints or blockers, and have stopping conditions, such as a maximum number of iterations, so a run that cannot finish ends in a controlled way. If the work cannot tolerate that containment, an agent is not yet the right choice.
The middle ground: rules and agents combined
Most real systems are neither pure rules nor pure agents. The question is usually which parts stay rules and which earn model judgement. In the first hybrid shape, rules constrain an agent. Guardrails validate input, output, or tool behaviour automatically, while human review pauses the run so a person can approve or reject a sensitive action. Together, in OpenAI’s description, they define when a run should continue, pause, or stop. Approvals are the human-in-the-loop path: the model can decide an action is needed, but the run pauses until it is approved or rejected, recording an approval interruption instead of executing the tool and returning a resumable state. Those checks have limits: in the OpenAI Agents SDK documentation, input guardrails run only for the first agent in a chain, output guardrails only for the final agent, and tool guardrails only on the tools they are attached to.
In the second shape, an agent sits inside a rule flow. A deterministic flow calls the model for one bounded sub-step, such as classifying a request, then returns to fixed logic for the decision and action. Anthropic’s workflow patterns describe the same idea: prompt chaining uses fixed subtasks with programmatic gates, routing classifies an input and directs it to a specialised follow-up, and parallelisation can run a guardrail check separately while another model instance handles the query. OpenAI documents the same nesting the other way: the approval pattern applies even inside a nested agent-as-tool call. The flow stays in charge of the sequence; the model owns one judgement inside it. To choose, ask of each step: can its correct outcome be stated in advance, must it be shown and replayed, and is a wrong result reversible or irreversible? Steps passing the first two questions stay rules. Steps failing them are candidates for a bounded model call inside the flow; they become candidates for an agent only when the step also needs model-directed planning across multiple steps and adaptation to what comes back, with audit requirements treated as constraints the design must satisfy rather than reasons to relax control.
A worked decision: rule-based systems vs agents on the same task

Consider triaging an incoming support request through both approaches. The example is illustrative, with invented thresholds shown only to make the table readable. It is not a reported case study. As a rule-based flow, triage is a decision table with hit policy FIRST, so the first matching row wins.
Decision table (illustration only — categories and routes invented for this example)
Hit policy: FIRST — first matching row wins
| Category | Customer tier | Billing dispute | Route to |
|------------|---------------|-----------------|-----------------|
| billing | any | yes | billing team |
| technical | premium | no | priority queue |
| technical | standard | no | standard queue |
| any | any | no | general queue |
An unlisted category with Billing dispute=no reaches the last row (the fallback) and routes to the general queue.
A request matching no row — for example, an unlisted category with Billing dispute=yes — is not decided by the table: in this illustrative flow it goes to human review. FIRST only says which matching row wins; it does not reject anything.The table’s strengths are visible: anyone can read which rule routed a request, test a new input, and replay a past decision. Its weakness is equally visible: an unlisted category with no billing dispute is routed to the general queue by the fallback row whether or not that is the right handling, an unexpectedly phrased request may match the wrong row, and a request matching no row at all depends on the surrounding flow’s human-review step. Adding a category means editing the table and re-testing the rows it touches. As an agent loop, the agent reads the whole request, checks order status and policy, and decides what it needs. If the request is unusual, it can ask a clarifying question, search for the policy, or escalate with a summary. That flexibility is also the risk: it might apply a policy the business does not allow, or promise an outcome the team cannot deliver. Hence guardrails, approval checkpoints before irreversible actions, and a record of what it did.
Trace one illustrative request through both: “The screen flickers since yesterday’s update, and my invoice shows a duplicate charge.” Recorded as category technical, tier standard, billing dispute yes, the request matches no table row, so the rule version sends it to human review — predictable, but slow, and the flicker itself is never investigated by the flow. The agent version reads the whole request, checks the invoice and confirms the duplicate charge, and then observes that a refund for that charge was already issued — the unexpected observation. It therefore does not issue a second refund; it pauses at the approval checkpoint and escalates with a summary of the duplicate charge, the existing refund, and the flicker report. To test each version, feed the same recorded inputs to the table and expect the human-review route, and run the agent in a sandbox with the already-refunded invoice and expect escalation rather than a second refund.
The checklist has five questions. Can the cases be enumerated? Must the decision be shown and replayed? How variable are the inputs? Are the actions reversible? How much surprise can the business tolerate? Rules win when cases are enumerable, the audit trail matters, and actions are hard to undo. Agents win when inputs vary, work is multi-step and recoverable, and surprise can be contained by checkpoints — but only when the sequence or number of steps cannot be hardcoded and needs model-directed planning and adaptation to results; variable inputs and multi-step work alone can instead be handled by bounded model calls within a predefined workflow.
Costs, failure modes and common mistakes
Rule-based systems fail by brittleness. The rules cover only what someone thought to write down, so inputs outside the rules’ effective coverage may be mishandled or rejected when no suitable fallback exists, and the set grows harder to maintain as the domain changes. Overlapping rules are a real failure mode, which is why a declared hit policy is part of correctness, not paperwork. Testing is comparatively straightforward: the same inputs can be replayed, and a changed rule checked against the cases it affects.
Agents fail differently. They can act confidently on a wrong conclusion, harder to spot than a wrong rule and potentially expensive when the action changes something outside the system. They trade latency and cost for task performance, in Anthropic’s words, so additional calls and turns can increase cost and latency, with the effect depending on orchestration — parallel calls, for example, do not add serial latency in the same way as sequential ones. Testing is harder because the same input need not produce the same path twice, which is why Anthropic recommends comprehensive evaluation, starting simple and adding multi-step systems only when simpler solutions fall short, and testing extensively in sandboxed environments.
The mistakes cut both ways. Using an agent where a rule would do adds cost, latency, and unpredictability for no gain, the mistake Anthropic’s simplest-solution advice targets. Encoding judgement into brittle rules is the mirror mistake: a rule set that tries to cover every variation can grow hard to maintain, and may still fail on an input nobody predicted when no fallback covers it. Skipping guardrails on irreversible actions is a mistake in either architecture, but costlier with an agent, because the agent chooses the action. And never revisiting the decision is a mistake in both: as the task changes or model costs fall, the balance moves, and the architecture should be re-checked against the same five questions. The right system is the simplest one that states its decisions clearly and fails in a way the team can find and fix.












