7 questions to ask before building an AI agent

By Yauheni Malashchytski · Published

Before building an AI agent, ask seven things: does it need to be an agent, how will you know it works, which rules must live in code, what format must it produce, who pays when it fails, how will you prove the new version is running, and what result would make you stop. If you can't answer the second, don't start.

I build and run LLM products: a language tutor that's still in pre-release testing and a paid question-answering bot, among others. Neither is a fully autonomous agent. They break in the same places an agent does, though, and I've kept the numbers. Most of the questions below come with one; the rest come from how we built the bot. You can read who's behind it on the about page.

1. Does this need to be an agent at all?

Start with the dullest option. Anthropic's engineering team recommends the simplest solution that works, and says that "might mean not building agentic systems at all". Agentic systems, they note, often give up speed and money for better results.

Their dividing line is a useful one. In a workflow, code decides the steps. In an agent, the model does. So write your process down as numbered steps. If you can, and the order rarely changes, you want a workflow with a model call or two inside it.

A question-answering bot over a document collection is a good example. Mine has one tool, document search, and one job: write an answer from what it finds. I've given the model nothing to plan.

2. How will you know it works?

Nesta's five questions start from a checkable outcome: if the end result is hard to verify, split the work into stages and check each one. I agree, and I'd add a second test: check that your test can tell a real improvement from noise, because mine couldn't.

In our evals, I rewrote one rule in a prompt and measured how often the tutor wrote a note in the wrong language:

Run Wrong-language notes
Old prompt 23%
New prompt, run 1 13%
New prompt, run 2 27%

After run 1 I had a win. After run 2 I had two runs of the same prompt that disagreed with each other (p = 0.007), so I withdrew the result. Stop at one run and you'd have shipped it.

Then read the test cases before you trust the score. In our evals, one test class was reported as "silent on 15 of 30 turns", a 50% failure. In 10 of those 15, silence was the right answer. The real miss was 5 of 20.

3. Which rules must be code?

List the things your agent must never do. Include the data it may not read and the tools it may not call. For each one, decide whether a sentence in the prompt is enough. For the serious ones, it isn't.

In our evals, we test how the pre-release tutor responds to messages about self-harm. There are 14 probes, 12 of them disclosures and 2 controls:

Stage Handled correctly
Baseline 2 of 14
Just before the server-side check 9 of 14
With the server-side check 14 of 14

The last step came from a check on the server that answers before the model is called. It caught all 12 disclosures on both models we ran. It's a small set, and one part of that check hadn't been exercised by the eval when we ran it, so I don't read 14 of 14 as "solved".

Prompts have a ceiling on ordinary rules too. One of mine was stated five times and still broken 23% of the time. Structure and position changed the model's behaviour; repeating the rule didn't.

4. What exactly must it produce?

If another program reads the output, the format is part of the design. Pick it by testing.

In our evals, the same replies carried two formats. Paired brackets came back malformed on 12.5% of turns. Plain lines with pipe separators parsed every time. If your provider offers structured outputs, test those as well, and count what fails to parse.

5. Who pays when it fails?

Model calls cost money whether the answer is good or not. Work out what happens to a customer's balance when a run times out, and when two requests arrive at once.

In the paid bot we used to charge after the answer was ready. Two questions sent together on a one-answer balance could both run. Now the charge happens when the question is queued, a failed or timed-out run is refunded, and a sweep every 60 seconds refunds anything orphaned by a restart.

Decide which checks may block a paying customer as well. A cheap classifier looks at each question before the bot charges for it. When that classifier breaks, the question goes through.

6. How will you prove the new version is running?

This one sounds too basic to ask. On 4 September 2026 a CI run in our main repository went green having built nothing, and 39 services served replaced code for two days. Pods were healthy and the logs were clean, because the old version kept working.

For an agent that gap is worse, since you may be measuring a prompt that never shipped. Check the version of the running image, and have something alert you when it doesn't match.

7. What would make you stop?

Write the decision rule before you see any numbers. Ours has three steps, in order, and one gate that overrides them:

  1. Floors. Miss one and the candidate is out.
  2. Quality, with a noise band measured in advance. Ours was 6 points, and anything smaller counts as a tie.
  3. Latency, then cost, to break ties.

Safety is the gate. Fail it and the other scores don't matter.

Because the rule came first, the candidate with the best quality numbers didn't ship. It was measurably less safe than the version already running. I doubt I'd have made that call as calmly with the table already on screen.

The checklist

  • We've written the steps down and still need the model to choose them.
  • We have test cases, and two runs of the same version agree.
  • Every serious "must never" rule has code behind it.
  • The output format has been tested, and failures to parse are counted.
  • Failed runs are refunded, and two requests at once can't overspend a balance.
  • We can name the version that's running right now.
  • The ship or stop rule is written down.

FAQ

What is the difference between an AI agent and automation?

Anthropic contrasts agents with workflows, the closest thing to automation, by who controls the steps. In a workflow, models and tools follow predefined code paths. In an agent, the model directs its own process and tool use. If your steps rarely change, I find automation easier to test.

When should you build an AI agent?

When the steps can't be fixed in advance and you can check the result. Anthropic suggests trying simpler options first, because agentic systems often cost more and respond more slowly in exchange for better task performance.

How many times should you test an AI agent before launch?

Run the same version at least twice and compare those runs first. If they disagree with each other, you're measuring your test. I treat two runs as the floor.

Can a system prompt stop an agent from doing something dangerous?

Don't rely on it alone. In our evals, a check in code that ran before the model took self-harm handling from 9 of 14 to 14 of 14. That's 14 probes, so treat it as a small test.

If you'd like a second pair of eyes

OverX AI scopes, builds and deploys custom AI agents, then trains your team, on a fixed scope or weekly. Bring your answers to these seven questions to the AI agent consultancy page and include the ones you couldn't answer.