AI Agents & Automation

AI agent development: agents that work across your tools, within limits

An AI agent uses a language model to decide its next step, calls your tools to take it, checks the result and repeats until the task is done or handed to a person. We build agents for multi-step work, such as investigating a case across three systems and preparing an action for approval. The hard part is rarely the model. It is the permissions, approval gates and failure handling around it, and knowing when a fixed workflow would serve you better.

Book a workflow review

Agent, chatbot or workflow: what is the difference

The three are easy to confuse because they can all sit behind the same chat window. The difference is who decides the steps and what the software is allowed to change.

TypeWho decides the stepsWhat it can changeMain risk
ChatbotNobody: it answers one message at a timeNothing outside the conversationA confident wrong answer
Workflow automationYou, in advance, as fixed rulesExactly what the rules allowA case the rules did not foresee
AI agentThe model, within the tools you give itWhatever its tools permitA sensible-looking action that is wrong

An agent earns its extra risk when the path through a task depends on what it finds along the way. Our glossary entry on AI agents gives the short definition, and the article on agents versus workflow automation helps you choose.

Tools and permissions: an agent can only do what its tools allow

An agent acts through tools: functions with a name, a description and a typed input that your code runs on its behalf. The design rule is to make each tool narrow. “Look up an order by number” and “draft a refund up to the policy limit” are good tools. “Run any database query” and “call any endpoint” are not, because they hand the model your whole system.

  • Validate on the server. The model's tool call is a request. Your code checks the arguments, the user's rights and the record's state before anything runs.
  • Separate reading from writing. Read tools can be broad; write tools should be few, specific and logged.
  • Give each agent its own service account with least privilege, scoped to the customer or team it serves, never a person's login.
  • Set rate limits per tool, so a confused loop cannot send a thousand emails.

Tools can be wired through a model provider's function calling or through the Model Context Protocol, an open protocol for connecting AI applications to tools and data. The protocol changes how tools are connected, not how far they should be trusted.

Planned steps or fixed steps

Agents sit on a range from tightly scripted to open-ended. The more freedom the model has, the harder the agent is to test, so we give it as little as the task needs.

  • One model step in a fixed flow: code runs every step and the model does one job, such as reading an email.
  • A router: the model chooses among a few fixed paths, each one tested on its own.
  • Plan, then execute: the model proposes a plan, code checks it against rules, then the steps run.
  • An open loop: the model picks a tool, reads the result and decides again until it finishes. Flexible, and the hardest to predict.

Picture an agent that handles suppliers' requests to change delivery dates for a manufacturer's purchasing team. Reading the supplier's email and proposing a new date that fits the production plan suit the model. Checking that the sender is a registered contact for that supplier, and refusing changes to orders already received, belong in code, because they must happen every time whatever the model concludes.

Memory and state

Within a run, the agent's memory is its context: the task, the conversation and the tool results so far. Keep it lean. Long contexts cost more, slow responses and bury the instruction that matters, so summarise earlier steps and pass each step only the fields it needs.

Across runs, prefer your systems of record over hidden memory. If the agent learns that a customer prefers morning deliveries, write it to the CRM where staff can see and correct it. Any memory store the agent keeps is a database like any other: it needs retention rules, access control and strict separation between customers. For tasks that wait hours or days for an approval, the run's state is saved so it resumes exactly where it stopped.

Approval gates for actions that matter

Some actions should pause until a person approves them: anything irreversible, payments and refunds above a limit, messages to customers in sensitive situations, changes to master data and regulated decisions.

A good approval screen shows what the agent wants to do, why, and the evidence it used, and lets the reviewer edit the draft, approve or reject with a reason. Every decision is logged, and rejections become test cases. Watch the volume: a reviewer asked to approve hundreds of items a day starts approving without reading. Our article on when AI needs a human's approval sets out a risk matrix, and the human-in-the-loop entry defines the pattern.

Keeping cost and latency in check

Agent costs grow with the number of model calls in each run and the size of each prompt. Controls we build in:

  • A maximum number of steps and a token budget per run, after which the agent stops and hands off.
  • Timeouts on every tool and on the run as a whole.
  • A smaller, faster model for routing and classification, and a larger one only for the steps that need it, chosen by testing on your cases.
  • Caching of stable lookups, such as a product catalogue, so each run does not fetch them again.
  • Cost per completed case as the headline figure, rather than cost per call, which hides retries.

Designing for failure

Tools time out, APIs return errors, the model produces arguments that fail validation, and a run can stop halfway: the refund issued, the confirmation email not sent. Each case needs a defined response.

  • Retry temporary errors with backoff and a limit; never retry a rejected payment.
  • Give every write an idempotency key, so a retried step cannot run twice.
  • Send unfinished runs to an exception queue with the full trace, so a person can finish or reverse them.
  • Keep a switch that turns off the agent, or a single tool, at once.

Testing and security deserve their own attention. AI agent testing covers evaluation sets and regression runs, AI security covers prompt injection and excessive agency, and AI monitoring covers tracing every run in production.

When an agent is the wrong answer

  • The steps are always the same. A fixed workflow automation is cheaper, faster and easier to test.
  • You cannot say what a correct result looks like. If nobody can grade the output, nobody can test the agent.
  • The action is high-risk and cannot be reviewed in time. Keep it with a person, and let software prepare the case.
  • The only way in is the screen. An agent clicking through a user interface breaks when the layout changes; an API or export is worth building first.
  • Volume is low. If the task happens a few times a month, a checklist may be the right tool.
A small first step

A 30-minute workflow review

Pick one process that costs your team time. We look at it with you and tell you honestly whether automation or an AI agent pays, what it would take, and what to measure first.

Message us on WhatsApp

Questions we get asked

  • It depends on the task. We compare models from providers such as OpenAI and Anthropic on a test set built from your own cases, and weigh quality against cost, speed, language support and the provider's data terms. Different steps can use different models, and we keep the model behind an interface so it can be swapped when a better option appears.

  • Usually, but the connection becomes most of the work. Options include scheduled file exports, a read-only database view, or a small service that exposes the few functions the agent needs. Driving the screen like a person is a last resort, because it breaks when the interface changes. We start read-only and add write access once it is proven.

  • With layers rather than one control: narrow tools, server-side checks on every call, permissions scoped to the job, approval gates for sensitive actions, rate limits, a log of every step and a switch to turn it off. Together they make a harmful action much less likely, though never impossible, which is why monitoring continues after launch.

  • It depends mainly on the integrations, the approval paths and the test set, not on the model. A narrow agent for one workflow with two or three tools is often a matter of weeks once the workflow is mapped. Each extra system, language or approval route adds time, and we give an estimate when the scope is clear.

  • Not on its own, and you would not want its behaviour to change without testing. We collect corrections and rejected approvals, add them to the evaluation set, then adjust the instructions, tools or retrieval and rerun the tests before releasing the change. Fine-tuning a model is sometimes useful later, but it is rarely the first step.

Keep exploring

Ready to build something secure?

Tell us about your product. We will reply with a clear plan.

Start a project

We would like to use Microsoft Clarity to see how visitors use the site, so we can improve it. It sets cookies and is off unless you accept. Cookie policy