# Agent vs RPA vs a Plain Script

> Agent vs RPA vs a plain script: how each one works, where each one breaks, and how to pick the simplest fit, explained for your AI interview.

**In short:** A plain script runs fixed code that a developer wrote. RPA, robotic process automation, is a software robot that repeats a person's digital tasks, often by copying clicks on a screen. An AI agent lets a model choose its next step, so use one only when the steps can't be listed in advance.

AI and LLM interview question Q196, Agents and tool use. Beginner, occasional (our estimate). From Venkat R. Murty's free Interview Kit: https://designervenkat.online/interview/ai/agent-vs-rpa-vs-a-plain-script

## Say it in 30 seconds

A plain script is fixed code that does the same steps every time. RPA is a software robot that repeats digital tasks, often by copying clicks, so it can break when the screen moves. An agent is a model that picks its own next step. For a repeated task with fixed fields, I'd use a script. I'd use RPA only when there's no other way in, and an agent only when the steps can't be listed in advance.

## Say it in 2 minutes

Think of three ways to hand over a repetitive office job. A plain script is a standing order: the same steps and the same fields, every time, written by a developer. RPA, robotic process automation, is a software robot that does a person's repetitive digital tasks, often by copying clicks and typing on a screen. An AI agent is different again. A model reads the situation, picks the next tool or click, and decides when the job is done.

The choice comes down to how predictable the work is. If a claims team copies fixed fields from one file format every night, a script is the simplest option and the easiest to test. If the only way in is a desktop screen with no other door, RPA can work, but it breaks when a button moves or a new pop-up appears.

An agent fits when the steps can't be listed in advance, like reading a messy customer email and deciding what to check. Anthropic's December 2024 guide on building agents says to find the simplest solution possible, and to add complexity only when needed. It also warns that autonomy brings higher costs and compounding errors. So I'd test agents in a sandbox, limit what they can touch, and keep a person on risky actions.

In an interview, I'd say the choice out loud: a script first, RPA as the last resort on a screen with no other door, and an agent only for open-ended work.

## What are the three, in plain words?

Picture three ways to hand over a job. A plain script is a standing order: do exactly these steps, with exactly these fields, every time. A developer writes it in code, and it never changes its mind.

RPA, robotic process automation, is a software robot that does a person's repetitive digital tasks. Classic RPA follows steps that someone recorded or scripted for it, and it does not reason about what those steps are for.

An AI agent is a model that reads the situation, picks the next tool and decides when to stop. A claims team might use one to read a messy customer email and decide what to check. Nobody writes every step for it in advance.

- **Plain script:** Fixed code that runs the same steps, with no model making choices.
- **RPA:** Robotic process automation: a software robot that does a person's repetitive digital tasks.
- **Agent:** A model that picks its own next step and tool until the task is done.
- **API:** A direct door a program can use to read or write data, without clicking a screen.

## How does each one decide what to do?

- **Script: Fixed code.** Runs the steps its developer wrote. No model and no screen. The same input gives the same result.
- **RPA: A software robot.** Does a person's repetitive digital tasks by following recorded or scripted steps, often copying clicks into an application.
- **Agent: A model in charge.** Reads the task, picks the next tool or click, reads the result, and decides when to stop.

> "RPA is a software technology that automates repetitive, rule-based, and labor-intensive back-office workflows such as filling in forms, searching for information, or sorting invoices." (AWS)
>
> "Workflows are systems where LLMs and tools are orchestrated through predefined code paths." (Anthropic, workflows)
>
> "Agents, on the other hand, are systems where LLMs dynamically direct their own processes and tool usage, maintaining control over how they accomplish tasks." (Anthropic, agents)

Anthropic's guide calls the fixed-path kind with LLM calls a workflow, and the model-led kind an agent. A plain script has no model in it, so it sits below that split: it is simpler than a workflow, not a form of one. RPA sits outside that split too. Its steps are fixed, and it often works on a screen built for people.

## Which one fits a real claims team?

Take a mid-size insurer that gets 4,000 claim forms a week from three partner garages. Each form has to be copied into the claims system by hand. Three things differ: the file format, the system, and the messiness of the input.

1. **Forms from one garage, one fixed layout:** A plain script. It reads the fixed fields, posts them, and sends anything with a missing field to a person.
2. **An old claims system with no API:** RPA is the only way in for now. Keep the bot, add a check that stops it when the screen looks different, and plan to replace it.
3. **Customer emails with photos and free text:** An agent reads the mess, pulls out the policy number and drafts the entry. A person approves each posting before it goes in.

*Diagram, Three ways to automate one office task: Three options for one repeated task. The numbered arrows say when each one is the right pick: fixed fields point to a script, a screen with no other door points to RPA, and steps that can't be listed point to an agent.*
1. The fields and steps never change: a script.
2. No other door in, so a bot copies the screen.
3. The steps can't be listed in advance: an agent.

> **Tip:** Often the best setup mixes them: a script for the fixed part, and one model step for the messy part. Name the fixed part first in an interview.

## Where does each one break?

Each option fails in its own way. A script breaks when its input stops matching what it expects. RPA often breaks when the screen changes. An agent breaks when a wrong guess carries into later steps, and each run costs more than a script run.

*Diagram, Where each one breaks: The same three options, each with the way it usually fails. The orange boxes are the causes, so a team knows what to watch for before it goes live.*
1. A new layout puts the fixed positions out of place.
2. A moved button sends the bot's click somewhere else.
3. One wrong guess carries into every later step.

A script is only as safe as its refusals. This made-up claims script sends an incomplete form to a person instead of guessing the missing field:

```python
# A made-up claims script: fixed fields only. Anything odd goes to a person.
REQUIRED = ["Policy No", "Claim Date", "Amount"]

def post_claim(form):
    # A field left out stops the posting; empty values are not checked here.
    missing = [field for field in REQUIRED if field not in form]
    if missing:
        return "SEND TO HUMAN: missing " + ", ".join(missing)
    return "POSTED: policy " + form["Policy No"] + " for " + str(form["Amount"])

print(post_claim({"Policy No": "PL-20417", "Claim Date": "2026-11-02", "Amount": 1250}))
print(post_claim({"Policy No": "PL-20417", "Amount": 1250}))
```

Output:

```text
POSTED: policy PL-20417 for 1250
SEND TO HUMAN: missing Claim Date
```

Microsoft describes its desktop flows as working with application UI elements, images, or coordinates. Coordinates are exactly why a moved button hurts a bot: the click goes where the button used to be.

Anthropic's computer use tool gives a model a screen to read and a mouse and keyboard to use. That makes it an agent that drives a screen, so the same screen risks apply, and its docs say to isolate the model from sensitive data and actions, because of prompt injection.

### How would you replace a fragile RPA bot?

Start with the question a senior engineer asks first: is there a door that doesn't need the screen? Anthropic's December 2024 guide says to find the simplest solution possible first, and to call LLM APIs directly before reaching for a framework, since many patterns fit in a few lines of code.

1. **Ask for an API first:** A direct door to the claims system beats any bot. Ask the vendor, check the docs, and only then look at the screen.
2. **Turn the fixed part into a script:** Where the steps and fields never change, a script with tests replaces the recorded clicks.
3. **Add an agent only for the messy input:** Keep the model for the step that needs judgement, with limits on what it can touch and a person on each posting.
4. **Log every run and alert on failures:** Count the stops and the odd cases each day, so a broken screen is found the same morning.

## What does the interviewer want to hear?

**A strong answer covers**

- [ ] A plain definition of each: fixed code, a screen bot, a model in charge.
- [ ] The question that decides it: can the steps be listed in advance?
- [ ] Why RPA is brittle: it depends on a screen that can change.
- [ ] Why agents cost more and can compound errors.
- [ ] Start with a script, use RPA only without an API, and add an agent for judgement.
- [ ] Testing, logging and a human check on risky actions.

**Common traps**

- Trap: "An AI agent is always the best choice." Better: Agents cost more and can compound errors. Use a script when the steps are fixed.
- Trap: "RPA is just AI with a screen." Better: Classic RPA copies recorded or scripted steps. Intelligent automation is the upgrade that adds AI to handle messy input.
- Trap: "A bot just clicks, so it can't go wrong." Better: A moved button or a new pop-up sends the click astray. Test it and watch its logs.

## Can you spot the fragile step?

**Spot the fragile step:** A bot approves claims on an old screen. Which step depends on where a button sits on the screen?

A. click(x=412, y=288)  # the Approve button
B. row = ledger_api.find(policy_no)
C. api.post('/claims/approve', json=claim)
D. claim = parse_csv(file, columns=['Policy No', 'Amount'])

**Answer:** A. Fixed screen coordinates break when a button moves. Finding the button by its label, or calling the system's own door, holds up better.

**Quick check:** A team copies 300 policy numbers every night from one fixed-format file into a ledger that accepts a file import. Which fits best?

A. An AI agent that picks each step
B. A plain script that reads the file and imports it into the ledger
C. An RPA bot that clicks through the ledger screen
D. A chatbot that answers questions about the file

**Answer:** B. The format and the steps never change, so a script is the simplest, cheapest and easiest to test. An agent adds cost and more chances for errors for no gain.

## Can you answer these from memory?

**Flash cards**

- **What is a plain script?** Fixed code that runs the same steps, with no model choosing.
- **What is RPA?** A software robot that does a person's repetitive digital tasks, often by copying clicks.
- **What is an agent?** A model that picks its own next step until the task is done.
- **Which one is the simplest?** The plain script, when the steps and fields never change.
- **Why does RPA break?** A moved button or new screen can send its clicks astray.
- **Why are agents risky?** Higher cost, and a wrong guess can compound over many steps.

## Likely follow-up questions

- Q157 What is an AI agent? https://designervenkat.online/interview/ai/what-is-an-ai-agent
- Q158 Workflow vs agent? https://designervenkat.online/interview/ai/workflow-vs-agent
- Q173 How do you stop endless agent loops? https://designervenkat.online/interview/ai/how-do-you-stop-endless-agent-loops
- Q181 How do you evaluate agents? https://designervenkat.online/interview/ai/how-to-evaluate-ai-agents
- Q187 How do you control agent cost? https://designervenkat.online/interview/ai/how-do-you-control-agent-cost
- Q194 How do you design stop conditions? https://designervenkat.online/interview/ai/how-do-you-design-stop-conditions

## Learn it in depth

- [Where agents pay off](https://designervenkat.online/learn/ai-engineering/agents-usecases)
