Build vs buy AI agents: the agent is the small part
A working AI agent takes days. The layer under it has about seven parts, and someone owns each one after launch. Decide on that, not on the demo.

Should you build or buy your AI agents?
Building means your team writes the agents. It also puts together what they run on: the order of steps, records of each run, a safe place for code, access to models, user rights and triggers. Buying means a platform supplies that layer and your team writes the agents on top. In our view, the agent itself is rarely the deciding cost. The layer under it is.
A developer with a coding agent builds a working AI agent in a few days. It reads new support tickets, calls an internal API and writes a summary for the team. The demo goes well. Then the questions change: can we run twenty of these, for several teams, for a year, with an audit coming?
"Build vs buy" is the right question to ask at that point, and teams are right to take building seriously. A coding agent makes the first version fast and cheap, and the team keeps full control. The usual comparison, though, sets the weeks to build the first agent against the price of a licence. That compares the cheap part. The part that decides is AI agent infrastructure: the layer that starts, limits and records your agents, and that someone has to own after launch.
Before you read on: in the second year of a self-built setup, which takes more of your team's time, the agents or the layer under them?
What does AI agent infrastructure include?
Most people answer the agents. Prompts need tuning, tools need fixing, and users ask for changes.
Look at what a self-built setup puts around those agents. It usually comes to about seven parts:
Orchestration: which step runs when, what is retried, and what happens when a step fails.
Run records: what each step received, what it returned, and why it failed.
A code sandbox: a closed place where generated code runs, with limits on what it can reach.
Model access: which model each agent uses, the keys, and a way to change provider.
Identity and access: who may build, change, start and read what.
Triggers: schedules, webhooks, chat and an API that start the work.
Voice, if your agents take calls.
Each part is often a separate open-source project or service, with its own updates and security fixes. Between the parts sits glue code: the code your team writes so that the parts work together.
Why is the second year the expensive one?
Each of the seven parts changes on its own schedule. A security fix in one part changes how it behaves, and the glue code that joins it to the next part has to follow. With seven parts, your team keeps up with seven release cycles and every joint between them. For what one upgrade alone asks of a team, see Before you upgrade your self-hosted agent server.
Meanwhile the agents themselves tend to settle. Once an agent does its job, most changes to it are small. The practical consequence: the work in year two follows the number of parts and joints, not the number of agents. And glue code is often understood by the one person who wrote it.
Building an agent is a project; owning the layer under it is a job that does not end.
Call that the ownership cost, and put it next to the licence price when you compare. Building can still be the right call: for a team with platform engineers who want that job, or for a need that no platform covers.
How do you decide between building and buying?
Take the seven parts one by one. For each, ask who owns it after launch, and what happens when it breaks.
Orchestration. A run stops halfway through, at night. Who finds it, and can it restart from the failed step?
Run records. Can you say what an agent did last Tuesday from records alone? For what a run record should hold, see The agent finished. Nobody can say what it did. For what an auditor may ask about agents, see ISO 42001 and AI agents.
Code sandbox. What on your internal network can generated code reach today? Who checked?
Model access. Who changes a key when it leaks, and how long does a change of provider take?
Identity and access. When someone leaves, who removes their rights in every part?
Triggers. A webhook stops firing. Who notices, and how?
Voice. If agents take calls, who owns the phone connection and the call records?
If every answer names a person who has the time, building can work. If several answers are "nobody yet", that is the cost you were about to take on.
| Your situation | Lean towards |
|---|---|
| One or two agents, one team, no audit planned | Building can be enough |
| Many agents across several teams | Buy the layer, build the agents |
| An audit or a regulator will ask for records | Check run records and access first |
| Generated code will touch internal systems | Check the sandbox first |
| Nobody wants to own glue code | Buy the layer |
What does EpicStaff supply under your coding agent?
These questions apply to any platform, ours included. Our answer is to keep your coding agent for what it does well, writing code, and to buy the layer under it. For what to check before a coding assistant touches your code, see When your AI coding assistant uploads your whole repo. This is what EpicStaff supplies for the parts above.
The sandbox. By default, code that flows and agents run in the sandbox cannot reach addresses on your private network; it reaches only EpicStaff's own file store and DNS. Internet access stays on unless you switch it off.
Files. A Python step can use the flow's attached files only for the actions you tick: read, write, delete. New steps start with none ticked. Each run also has its own working folder.
Run records. Switch on the session audit trail and it records each step of a run: an AI agent, a Python script, a knowledge lookup, a decision table and more. For each step you see what went in, what came out and any error, on your own servers. Tool calls an agent makes are recorded as events under that agent's step.
Model access. Pick your model from a built-in list. Each agent has its own model setting.
Secrets and rights. Secrets in the secret store are kept encrypted with a key derived from your installation's own secrets key, and are decrypted only for that organisation's own work. Only roles with the secrets "use" right can connect a secret to a flow; among the built-in roles, that is Org Admin.
Versions and moves. A person saves a version by hand. EpicStaff also saves one itself before a restore and before an import replaces a flow. Flows can be exported as a versioned file and imported again. Secrets from EpicStaff's secret store are not written into the file.
Q&A
How much do AI agents cost to run?
It depends less on the agent than on three things around it: the model calls each run makes, the infrastructure the agents run on, and the people who keep that infrastructure working. Count all three for a full year before you compare a build with a licence. The third is the one most estimates leave out.
What is the difference between an AI agent and an AI agent platform?
An AI agent is a model with instructions and tools that does one job, such as sorting tickets. An AI agent platform is where many agents are built, started, limited and recorded. One agent can live without a platform. Twenty agents across several teams usually need one, whether you build it or buy it.
Who should own AI agents in a company?
Two kinds of owner. Each agent needs a business owner who answers for what it does and approves changes to it. The layer under the agents needs a technical owner who keeps it updated, secure and running. When one person tries to be both for many agents, the layer is usually what gets left behind.
Does EpicStaff run agent code in a sandbox?
Yes. By default, code that flows and agents run in the sandbox cannot reach addresses on your private network; it reaches only EpicStaff's own file store and DNS. Internet access stays on unless you switch it off.


