Guides

AI agents vs automation scripts: which should handle your task?

Keep scripts for stable rules and use agents for decisions that require interpretation. A practical framework for dividing work, testing app access and checking the result.

Back to Blog

Use an automation script when you can specify the steps and check the result with clear rules. Use an AI agent when deciding the next step requires interpreting a brief, reading an unfamiliar state or choosing between tools. A workflow can use both: an agent handles a decision, a script processes the resulting data, and a separate check confirms the output.

If a script already produces the right file every morning, keep it. Give the agent work that needs its judgment, then measure whether that judgment helps the task finish.

For Mac app work, there is another choice inside that decision: the same task might use an API, a browser, native app controls or a desktop interface. Choose the route for each step as well as the system deciding what happens next.

What changes between a script and an agent?

In this comparison, an automation script is a program whose control flow is defined in code. It can contain conditions, retries and error handling. Given a supported input, it follows the branches its author supplied.

An AI agent uses a model to choose actions during execution. It observes the current state, selects a tool and uses the answer to decide what to do next. The model can choose to run a script as one of those actions.

Anthropic's engineering guide makes a related distinction between predefined workflows and systems where a model directs the process. A workflow can contain an LLM call while keeping its overall sequence fixed. Adding a model to a script therefore does not automatically make every step agent-controlled.

The practical question is where you need a decision that is hard to encode in advance.

A comparison you can apply to your task

Task conditionA useful starting pointWhat to verify
Fixed columns, known transformations and a defined output fileScriptRequired fields, calculations and output contents
Stable service API with known requestsScript or predefined workflowReturned identifiers and the resulting service state
Browser form with a known sequence and reliable selectorsBrowser automation scriptField values and confirmation state
A brief whose meaning changes the sequence of workAgent with bounded toolsWhether its interpretation matches the request
An unfamiliar app state requiring inspection and a choiceAgent with app accessThe selected target and the actual effect
A repeated workflow with a few ambiguous casesScript for the routine path, agent or person for exceptionsWhich cases were handled and which were deferred

These are starting points for a trial. A well-written script can handle substantial variation, and an agent can still choose the wrong action in a simple interface.

Start with scripts for stable transformations

Suppose you receive a CSV export with fixed columns and need to produce one summary per project. The rules specify which rows to include, how to calculate totals and how to name the output files.

That is a good script candidate. Python's CSV tools can read rows by field name and write a defined output structure. Your code can validate the expected headers, reject missing values and preserve the original export.

Write down what should happen when the input breaks a rule. A missing project identifier should produce a recorded exception that someone can resolve. Silently guessing which project owns a row would change the task.

An agent might help write or maintain this script. After review, the scheduled run can execute the fixed program. Include sample inputs and expected outputs so changes to the code can be checked.

This keeps interpretation concentrated where you need it: understanding a new requirement or investigating an exception.

Browser automation can be more capable than a click recording

A script does not have to click fixed screen coordinates. Browser tools can target controls by role, label or a testing identifier. Playwright's locator documentation recommends user-facing attributes and explicit contracts for resilient targeting.

For a known form, a browser script may fill the fields, submit the request and inspect the confirmation. A button moving across the page does not necessarily invalidate a role-based locator.

An agent becomes useful when the required path itself varies. A request might require interpreting which record matches a description, deciding which page contains the needed information or handling an unfamiliar dialog. It still needs a way to identify the intended control and check the resulting state.

Before replacing a browser script, identify the actual failure. A missing selector, an expired session and an ambiguous customer request need different fixes. A model call adds little to a selector you can repair directly.

Use agents where the instructions require interpretation

Consider an illustrative desktop task: “Prepare a review copy of this project using the client notes, and leave the editable source unchanged.”

The notes may contain inconsistent names, references to material inside the project or instructions that need clarification. An agent can inspect the available context, propose a mapping and choose tools for the approved work. It should ask when the intended change remains ambiguous.

A useful task boundary states the source project, the permitted changes and the destination for the review copy. The check might inspect the export settings and output file while confirming that the editable source remains intact.

Those checks matter even when the agent reports that it is finished. An export command can return successfully while producing the wrong selection, destination or format.

This example describes how to divide a workflow. It is not a claim that a particular app or agent completes it reliably. Test the required operations on the configuration you intend to use.

Split a workflow where the decision changes

Take a hypothetical job that turns a folder of project assets and a free-form brief into a review package. You can divide the work before choosing an automation product.

StageWho or what handles itEvidence to keep
List the assets and validate file namesScriptInput inventory and validation errors
Interpret the brief and propose how assets map to requirementsAgentProposed mapping with unresolved questions
Approve ambiguous choicesPerson responsible for the jobConfirmed mapping
Apply a known transformation to each approved itemScript or app operationInputs, parameters and returned results
Inspect a changing desktop state when neededAgent with app toolsObserved state and chosen action
Verify the packageDefined checks plus review where interpretation remainsOutput inventory and acceptance results

A fixed sequence can call a model for just the interpretation stage. A more variable task may need an agent to choose the sequence. The amount of model control should follow the variation in the work.

Once a path becomes repeatable, consider moving it into a reviewed script or explicit procedure. Keep exception handling visible so the routine path does not conceal unresolved work.

Compare the cost of reaching the result

A script's operating cost includes development, maintenance and recovery from failures. An agent adds model usage and can spend several turns inspecting an interface before acting.

Compare complete attempts on the same task. Record elapsed time, model cost where applicable, maintenance effort and human intervention. Include retries needed to obtain an acceptable output.

The cheapest failed attempt leaves work for someone else. Likewise, a fast sequence of tool responses says little about an incorrect output file. Our task-completion benchmark article examines this gap between recorded calls and finished work.

For a first evaluation, collect a few representative cases: an ordinary input, a known exception and an ambiguous request. Define the expected result for each before running the candidates. Choose a completion budget and a point where the automation must stop for review.

Where Braus fits into the workflow

Braus gives agents tools for working in Mac apps. Workers can use the virtual desktop, and Braus 1.1.0-2 adds separately enabled routes for native Mac controls, Chrome and local app adapters. Available operations depend on the target app, configuration and permissions.

That makes Braus relevant when a workflow needs an agent to observe and act inside an app. A stable transformation with a suitable API can remain in your existing script.

Braus's procedural memory can also describe work that combines interface actions and adapter operations. Recalled steps use current task values and still require live checks. Recall remains in development; it does not remove the need to evaluate the result. The current documentation explains that scope.

For the observation-and-action loop, start with our guide to computer-use agents. For a Mac task with limited integration options, see automating an app without an API.

Common questions

Can an AI agent replace my automation scripts?

It can take responsibility for some decisions and invoke scripts where useful. Replace an existing script when a trial shows a better complete workflow, including maintenance and recovery. A working script can remain a tool the agent uses.

Should I use an agent for every exception?

First identify whether the exception has a rule you can encode. For ambiguous or consequential choices, a person may need to decide. An agent can gather the evidence and propose a resolution within that boundary.

What should I automate first?

Choose one bounded task with a result you can inspect. Write down its fixed rules, variable decisions and required permissions. Script the fixed rules, test agent help on the variable decisions, and compare the resulting outputs.

If the unresolved step happens inside a Mac app, set up Braus and start with a read-only observation. Confirm that the agent sees the intended app and document before giving it a change to make.

All posts