AI Agents for Testing: What an Agent Is, and What It Needs From You
An agent is a language model that has been given tools and a loop. That is the whole idea. Everything that makes it useful or dangerous follows from those two things.
In this article
- Model, assistant, agent
- The four parts of a QA agent
- A tool definition, concretely
- Where agents earn their place in QA
- Where they do not
- Running one safely
Model, assistant, agent
| What it does | Example in QA | |
|---|---|---|
| Model | Answers once | Write me boundary cases for this field |
| Assistant | Answers in a conversation, with context | An IDE assistant suggesting the next line |
| Agent | Decides, acts with tools, observes, repeats | Open the app, find the form, fill it, report what broke |
The jump is the loop. An agent chooses an action, performs it, reads the result and chooses again. Nobody approves each step, which is exactly why the boundaries matter.
The four parts of a QA agent
- Goal – what done looks like, stated so the agent can tell when it has got there.
- Tools – the functions it may call: open a page, click, read the DOM, call an API, read a log. Each one is a door you opened deliberately.
- Memory – what it knows between steps. Usually a scratchpad plus the last few results.
- Stop conditions – a step limit, a time limit and a cost limit. Without these it loops.
An agent with no step limit and a flaky tool will try the same failing action until something runs out. Set the limit before the first run, not after the bill.
A tool definition, concretely
// what the agent is allowed to do, and nothing else
const tools = [
{
name: 'click',
description: 'Click a visible element identified by its accessible role and name.',
parameters: {
role: { type: 'string', enum: ['button', 'link', 'checkbox', 'tab'] },
name: { type: 'string' },
},
},
{
name: 'readPage',
description: 'Return the accessibility tree of the current page.',
parameters: {},
},
// deliberately NOT provided: navigate to an arbitrary URL, run shell commands,
// read the file system, call a payment endpoint
];
The list of tools you do not provide is as much a design decision as the list you do.
Where agents earn their place in QA
- Exploratory sweeps – walk the application, record what it found, flag console errors, broken images and dead links. Cheap breadth a human would not spend a day on.
- Triage – read a failing run, cluster the failures by cause, and write the first draft of the bug report.
- Self-healing suggestions – when a locator breaks, propose a replacement and log it for a human to accept. Suggest, never silently rewrite.
- Release readiness – gather results from several sources and summarise against gates you defined.
Where they do not
- As the only thing deciding whether to release. A gate an agent can talk itself past is not a gate.
- Anywhere a wrong action is expensive – production, payments, anything that sends email to real people.
- As a replacement for a deterministic regression suite. An agent that explores is not a test that proves the same thing twice.
Running one safely
- Test environments only, with data you can throw away.
- A read-only tool set first. Add each writing tool one at a time.
- Hard limits: steps, wall-clock time and spend.
- A full transcript of every action and result, kept with the run.
- A human accepts anything that changes the repository.
Key points
- An agent is a model plus tools plus a loop – design the tools, and the loop's limits.
- The tools you withhold are the real safety mechanism.
- Suggest and log; never let an agent silently rewrite a test.
- Breadth and triage, yes. Release decisions and production, no.
Practise this on the free applications at jstestingacademy.co.in/qa-apps – no account needed.


