AI and automation9 min read

How to build an AI agent for your business: eight steps from process to launch

Wiring up a model is the easy part. The real work is deciding what it may do, what it may not, and how you will know when it gets things wrong.

Frosted glass and crystal parts laid out on a pale workbench, ready to be assembled into a small mechanism

Connecting a language model to a couple of tools is now a quick job. Getting that agent to perform on your process, with your data and your edge cases, is a different discipline. This guide is for founders and operators who have to decide how to do it, whether or not they write code. If you want the basics first, start with what AI agents are.

The eight steps

  1. Pick a task, not a department

    “Handle support” is too broad; “answer order-status questions and route everything else to a person” is a task. Write down the success metric now: response time, cases resolved, error rate.

  2. Map the current process

    Where requests come from, which data is needed, who decides what, which exceptions occur. Existing procedures and real replies from your team are the raw material for the instructions.

  3. Check you actually need an agent

    If the steps never change, a fixed workflow is cheaper and more predictable. Agents earn their keep when the path varies from case to case.

  4. Choose the model and platform

    Prototype with a capable model to see what is possible, then try cheaper models against the same tests. The platform depends on integrations, volume and who will maintain it.

  5. Define tools and permissions

    Each tool is an action the agent can take: read an order, open a ticket, send an email. Grant only the tools the task needs, with the narrowest permissions.

  6. Write the instructions

    Goal, steps, tone, what to do when information is missing, when to stop and hand over. Long and clear beats short and ambiguous.

  7. Build the evals

    Collect real cases, including awkward ones, and decide what a correct answer or action looks like. Run them on every change to prompts, models or tools.

  8. Launch with a human in the loop, then widen

    At first the agent proposes and a person approves. Once the numbers hold, drop approval for low-risk actions and keep it for irreversible ones.

Where do you start when building an AI agent?

You start with the task and the success criteria, not the technology. Anthropic's documentation opens on exactly that point: a successful LLM application begins by defining success criteria and then designing evaluations to measure against them. Write one page covering who uses the agent, what it receives, what it must produce, which actions it may take alone and how you will know it is working. If that page stays blank, the problem is not ready for an agent.

An example: inbound support for a B2B SaaS

A small SaaS company gets a steady stream of support emails: password resets, invoice copies, feature questions, the occasional bug report. The agent classifies each message, answers account and billing questions using the help centre and the billing API, attaches invoice PDFs on request and turns bug reports into tickets with reproduction steps for the engineers. Success means time to first response and the share of conversations closed without a human, with a weekly check on customer satisfaction.

Which tools do you need: no-code, a framework or custom code?

It depends on who will maintain the agent, how many integrations it needs and how much traffic it will see. There are three main routes, and they combine well: plenty of agents start on a low-code platform and move to code once they grow.

Three ways to build an AI agent (MPN Group comparison)
Low-code platform (e.g. n8n)Agent framework or SDKCustom code on model APIs
Best forSmall teams, internal processesEngineering teams that want a fast startProducts where the agent is part of what customers pay for
StrengthsReady-made connectors, visible flow, quick iterationAgent loop, tool calling and hand-offs built inFull control over logic, cost, data and testing
Trade-offsComplex logic and automated testing are clunkierYou must understand what the framework does underneathMore build and maintenance effort
Choose it whenIt is your first agent or an internal automationPrototypes and mid-complexity agentsHigh volume, strict quality and security requirements

Anthropic's engineering team recommends starting with the model APIs directly, since many patterns take only a few lines, and understanding the underlying code if you do adopt a framework. For connecting tools, the Model Context Protocol is an open standard supported by Claude, ChatGPT and many developer tools: rather than writing every integration yourself, you plug in existing MCP servers, after vetting who maintains them and what they can access.

How do you write instructions and tools that work?

Write them like a runbook for a new, very literal colleague: goal, steps, exceptions, limits. A few rules that hold up in practice:

  • Reuse what you already have. Standard operating procedures, support macros and policy documents are, per OpenAI's agent guide, the best starting point for agent routines.
  • One clear action per step. “Ask for the order number” beats “gather the relevant information”.
  • Spell out the edge cases. Missing data, off-topic requests, angry customers: if you do not say what to do, the agent improvises.
  • Document tools as you would for a colleague. Clear name, purpose, parameters, return values. Anthropic calls this the agent-computer interface and advises documenting and testing it carefully.
  • Keep data and commands apart. Text inside an email or web page must never be able to rewrite the agent's rules.

How do you test an AI agent before it goes live?

You test it with evals: a set of real cases you rerun after every change. Because models can answer the same input differently, conventional tests are not enough. OpenAI's evaluation guide sets out five moves: define the objective, collect a dataset, choose metrics, run and compare, and evaluate continuously on every change. It also warns that starting with a multi-agent design adds complexity your evals should justify first.

What goes into the eval set

  • Typical cases drawn from recent real requests.
  • Hard cases: missing data, ambiguous wording, other languages.
  • Cases the agent must refuse: off-scope requests and manipulation attempts.
  • For each case, the answer or action you consider correct.

Grading can be largely automated: exact match for extracted fields, a second model acting as judge for free text, and human review on a sample. Anthropic's guidance favours many automatically graded cases over a handful graded by hand. A sceptical eval set is healthy: in Stack Overflow's 2025 developer survey, even the people who build with agents say they worry about their accuracy.

87%

of developers say they are concerned about the accuracy of AI agents, and 81% about security and privacy (2025)Source: Stack Overflow Developer Survey 2025 – AI

What guardrails does a production agent need?

It needs limits on what it can do, how long it can keep trying and when it must stop.

  • Retry limits. If the agent cannot work out the request after a few attempts, it hands over. OpenAI names exceeded failure thresholds as one of the two typical triggers for human intervention.
  • Least privilege. Read access where reading is enough; write access only to the fields that matter.
  • Action log. Every tool call stored with its inputs and outputs, so you can debug mistakes and explain what happened.
  • Spend caps. A ceiling on steps and cost per request, with an alert as it approaches.

How do you launch and maintain an agent?

Roll it out gradually and monitor it like any other production system, plus a watch on answer quality. Early on, the agent proposes and a person approves; each week you review the success metrics from step one, the failures and the cost per request. When a provider updates or retires a model, your evals tell you straight away whether the switch breaks anything.

Build and running costs deserve their own analysis, with third-party ranges and what drives them: see AI agent development cost. If the agent must answer from your company's documents, retrieval-augmented generation is usually the right pattern, covered in our LLM application development guide.

Which rules should you check before launch?

If the agent serves people in the EU, check three things before launch: transparency towards the people it talks to, a lawful basis and privacy notices for any personal data, and a data processing agreement with the model provider. From 2 August 2026 the AI Act requires people to know when they are interacting with an AI system unless it is obvious, and the GDPR applies to whatever personal data flows through the agent. Our guides to the EU AI Act for startups and GDPR and LLM apps go deeper; take professional advice for your specific case.

Frequently asked questions

How do I build an AI agent with OpenAI, Claude or Gemini?

Use the provider's API, directly or through a framework or a platform such as n8n, and connect the model to the tools it needs. The custom assistants in consumer chat apps are fine for internal experiments, but an agent wired into business systems runs through the API.

How long does it take to build an AI agent?

It depends mostly on the number of integrations, how clean the data is and how many hard cases there are. A prototype for a simple task comes together quickly; the slow part is reaching production-grade reliability, with evals and guardrails.

Can I build an AI agent without coding?

Yes, for internal use cases and modest volumes, using low-code platforms such as n8n. Once the agent faces customers or handles high volume, automated testing, security and cost control usually need engineering skills.

Which model should an agent use?

OpenAI's guide suggests prototyping with the most capable model to set a baseline, then trying smaller models against the same evals. Keep the cheapest one that meets your quality bar, and design the system so you can switch providers.

Should I build one agent or several?

Start with one. A single agent can handle a lot by adding tools gradually, which keeps evaluation and maintenance manageable. Split into several agents only when your evals show one has become too complex to perform reliably.

Sources

  1. OpenAI, A practical guide to building agents (2025) (19 October 2026)
  2. Anthropic, Building effective agents (19 dicembre 2024) (19 October 2026)
  3. Anthropic, Define success criteria and build evaluations (documentazione) (19 October 2026)
  4. OpenAI, Evaluation best practices (documentazione) (19 October 2026)
  5. OWASP, LLM01:2025 Prompt Injection (Top 10 for LLM Applications 2025) (19 October 2026)
  6. Model Context Protocol, What is the Model Context Protocol (MCP)? (19 October 2026)
  7. Stack Overflow, Developer Survey 2025 – AI (19 October 2026)

Figures and definitions checked on the dates shown.

Building a startup?

Let's talk