Revenue-based pricing  ·  Our fee is half the savings we project

Ellipse Automation
All posts
ai-consultingai-implementationautomation

AI Agents vs Scripts: When to Use Each One

·Etienne Chanut

Use a script when every step follows a rule you can write down before the run, and use an AI model when a step needs judgment or language, such as reading a messy email or deciding which client a request belongs to. That is the short answer to when to use AI agents vs scripts, and I think most real processes need both: code holds the rules, and the model handles what no rule covers.

The difference shows up in how each one fails. A script costs nothing per run and fails loudly when its input changes; a model is paid per run and fails confidently, with an answer that looks right. So the default is a script, and every model step has to earn its place.

The short version

  • Fixed rules and an answer you can write down in advance belong in a script; judgment and language belong in an AI model.
  • A script costs nothing per run and fails loudly. A model is paid per run and fails confidently, so every model step needs a check after it.
  • Anthropic's own guide says a single, well-set-up model call is usually enough for many applications; an autonomous agent fits only work whose steps cannot be listed in advance.
  • For one client, 46 banned words and patterns moved out of the prompt and into code checks after a model upgrade started ignoring them.

Script, workflow or agent: three different tools

Most arguments about AI agents vs scripts mix up three tools: a script, a fixed workflow with a model step, and an agent.

A script is code that runs the same steps every time: check a field, move a file, send a row to the right sheet. A workflow is still a script, but one of its steps calls a model, for example to read an incoming email and pull out the order number.

An agent is different in kind. The model decides what to do next, which tool to call and when the job is done.

Take one process and all three show up. Matching a payment to an invoice by its number is a script. Reading a supplier's email to work out which invoice they mean is a model step, and chasing an unpaid invoice across the inbox, the bank feed and the CRM until it is settled is agent work.

Anthropic, the company behind the Claude models, draws the same line in its guide to building agents: in a workflow the code paths are set in advance, while an agent directs its own process. Its advice is to start with the simplest solution and add complexity only when it is needed, which "might mean not building agentic systems at all". For many applications, it says, a single model call set up with the right context and examples is usually enough.

AI agentWorkflow with a model stepScript
Who picks the next stepThe model, while it runsThe code; the model fills one stepThe code, every time
Cost per runHigher: agents trade cost and speed for better resultsOne model call per itemNothing beyond the server it runs on
How it failsConfidently, and it keeps goingQuietly, inside the model stepLoudly: it stops or throws an error
FitsWork whose steps you cannot list in advanceReading or writing inside a fixed processFixed rules and fixed formats

When to use AI agents vs scripts: four questions

Four questions sort each step of a process into script, model step or agent, and say how much checking it needs, before anyone builds anything.

Can you write the right answer down before the run? If yes, it is a rule, and a rule belongs in a script. Whether a domain can receive mail, whether an invoice total matches its lines, whether a message contains a banned word: each has one right answer you can test.

Does the input arrive in a fixed shape? A form field or a spreadsheet column suits a script. Free text, such as an email, a call note or a chat message, needs a model to read it, and the code acts on what the model pulled out.

Can you list the steps in advance? If yes, build a workflow and give the model only the steps that need it; if each step depends on what the last one found, as in research or tracing a problem across several systems, that is agent work. In Etiennator, our own system of agents, a client request is agent work: agents split it into tasks and do each one in a sandbox, and a head agent reviews the result before it reaches me.

What does a wrong answer cost, and who catches it? A model's wrong answer looks like a right one. Deciding which client a new task belongs to is a model step for us, and with its written checklist it picks right on 122 of 131 test tasks, which is good, and still leaves 9 wrong answers that look exactly like the right ones.

Where both meet: code holds the rules, the model does the language

The pattern I recommend is a fixed workflow where code enforces the hard rules and checks what the model returns.

The model reads, writes and sorts. The code decides what happens next, checks the model's output against rules that never change, and stops the run when a check fails, so the output goes back for a fix instead of out the door.

A person, or a second model that did not write the output, judges what no rule can catch: whether the answer is right and whether a client would accept it. Anything that leaves the system, such as an email sent, a payment or a change put live, waits for a person's yes.

A workflow with one model step

01

Code takes the input

a form, a file or an email arrives through a fixed trigger

02

The model reads or writes

pulls fields out of free text, or drafts the reply or the report

03

Code checks the result

banned words, required fields, numbers that must match the source

04

A fresh reviewer judges it

a person, or a second model that did not write it

05

A person approves what leaves

anything sent, paid or put live waits for a yes

The checks can be plain. If a model writes a summary from a spreadsheet, code can confirm that every number in the text appears in the spreadsheet, and hold the summary back when one does not.

What this looked like for one client

Our client sends weekly performance reports to e-commerce sellers who run paid ads through its platform, and an AI model writes them. The numbers were right; the writing was the problem. The rules about what a report must never say, 46 banned words, phrases and patterns that make text read as machine-written, lived inside the prompt, written as threats.

That held until a model upgrade. The newer model started ignoring rules written in that register, and banned words came back in output that used to pass.

We moved every hard prohibition out of the prompt and into code checks that run on every report, from closed lists that an automated check keeps in sync across every instruction file that touches the report. The prompt kept only the positive standard, templates and worked examples, and most prompt fixes since then have been deletions.

The judgment stayed with a model. A separate grader that never wrote the report reads it like the client's most skeptical stakeholder; a failed report goes to a separate rebuilder, and the rebuilt version gets a fresh grader pass, never the one that wrote it.

On one deliverable, the grader caught a legally required disclosure rendering outside the image, invisible on the page. No list of banned words would have flagged it; the full build is in nothing grades its own output.

Where this answer does not hold

A script fails loudly only when someone is listening, and we learned that on our own product.

Our own small SaaS for local-business data went 114 days without a working search before we noticed. Its welcome email job failed 1,491 times in a row without delivering one email, while the alert we watched counted signups, which kept arriving; the story is in how to know if AI automation is working.

We have not measured cost per run across all our builds, so this post gives no general ratio between what a script and a model cost. It depends on the volume and on the model you pick.

The takeaway

Start every step as a script and make the model earn its place: a step goes to a model when it needs judgment or language, and to an agent only when nobody can list its steps in advance. Then put a check after every model step, code for the hard rules and a fresh reviewer for quality.

This week. Pick one process you want to automate and write its steps on one page. Mark each step script, model step or agent using the four questions above, and write the reason next to every step marked agent.

The 10 questions we ask in an AI readiness assessment start from the same split. Marking which steps need a model and which are plain scripts is part of the first map we hand a company when we start inside it.

Key takeaways

  • Use a script when the right answer can be written down before the run, and an AI model when the step needs judgment or language.
  • A workflow with one model step is not an agent: the code still decides every step, and the model only fills the step that needs language.
  • Put a check after every model step: code for rules a list can state, a fresh reviewer for quality, and a person's yes for anything that leaves the system.
  • Rules written in a prompt can stop working after a model upgrade; the same rules written as code checks run on every output.
  • A script only fails loudly if someone listens, so the alert has to watch the outcome, not the activity.

Common questions

When should you use an AI agent instead of a script?

Use an AI agent when each next step depends on what the last one found, such as research or tracing a problem across several systems. If you can write the steps and the right answer down before the run, a script does the job for nothing per run.

Is a workflow with an AI step the same as an AI agent?

No. In a workflow the code decides every step and the model fills one of them, such as reading an email. In an agent the model decides the next step itself, which costs more per run and is harder to check.

Why does a script fail more safely than an AI model?

A script stops or throws an error when its input changes, so the failure is visible. A model keeps going and returns an answer that looks right, so every model step needs a check after it.

Ready to see the math

Your bottom line has room. We can show you where.

Book a free 30-minute call. We'll look at your refund rate and growth trajectory, then show you the savings we'd project. No pitch deck, no commitment.

Run your numbers with us

Free 30-minute call. The math is yours to keep either way.