Analysis

Build or Buy: The Real Math on In House Healthcare AI Agents

ByClunic Research Team12 min read

Free tool

AI Readiness Assessment

Twelve factual questions on data access, governance and change capacity.

Need it signed off?

Thirty free minutes with an analyst on the vendor, the workflow and the rule you are unsure about.

Book an evaluation call

What are you actually deciding?

Almost nobody is deciding whether to train a model. Foundation models are bought or accessed by API in either scenario, and the difference in output quality between a good vendor product and a competent internal build using the same underlying model is usually small.

What you are deciding is who owns the twenty or so things around the model: the integration into the EHR, the retrieval layer, the evaluation harness, the monitoring, the audit log, the access controls, the incident process, the on call rota, the change management when the model provider ships a new version, and the person who answers at seven in the morning when a clinic cannot document. That list is the product. The model is a component of it.

Framed that way the question becomes tractable. You are choosing between renting a platform with a service level commitment and an indemnity, or standing up an internal one and carrying both yourself, permanently. The right answer depends on whether the workflow is differentiating, whether a vendor serves it adequately, and whether you already have the engineering function rather than intending to build one.

The failure mode is a build justified on the cost of licences alone. Licence cost is the most visible number and the least complete one, and comparing it to a build estimate that stops at first release is the single most common way this decision goes wrong.

What does building actually include?

A realistic scope, based on what we see teams discover in sequence rather than in advance.

  • The agent itself. Prompting, tool definitions, orchestration, retries, guardrails. This is the part teams estimate accurately and it is a minority of the work.
  • Integration. Authentication, context passing, reading clinical data, and writing structured data back under clinical governance. Write back is consistently the largest single item and consistently the last one scoped. It varies enormously by platform, which is why our Epic and Oracle Health integration notes read so differently.
  • Evaluation harness. A held out set of real cases with expected outcomes, run automatically on every change, including the adversarial and edge cases. Without it you cannot safely change anything, which means you will stop changing it.
  • Monitoring and drift detection. Per action outcome tracking, alerting on anomalous action mixes, and periodic quality sampling by a clinician.
  • Audit log. An exportable record of inputs, actions, systems touched, outcomes and escalations, retained per your policy and queryable by people who are not engineers.
  • Controls. Action allow lists, volume and spend caps, escalation triggers, a reversal path per action type, and a kill switch somebody has tested. All of these are required for anything acting autonomously, as we set out in agents, copilots and automation.
  • Model lifecycle management. Providers deprecate versions and change behaviour. Somebody has to re run the evaluation harness, decide, migrate and communicate, on the provider's schedule rather than yours.
  • Support and on call. Clinical hours coverage at minimum. This is the item most often assumed to be absorbed by an existing service desk that has no ability to debug an agent.
  • Documentation and governance evidence. Everything your own governance committee would demand of a vendor, produced by you, about you.

Read that list as a product roadmap rather than a project plan, because it does not end. The evaluation harness, the monitoring and the model lifecycle work continue for as long as the agent runs.

Can you hire and keep the team?

This is where most build cases quietly fail, and it fails on retention rather than on hiring.

A minimum viable standing team for one production agent, in our experience, is a technical lead, one or two engineers who can work across the model layer and the integration layer, a data or evaluation engineer who owns the harness, and a fraction of a clinical informaticist who owns quality review. Security, privacy and platform infrastructure are drawn from existing functions but consume real capacity from them. That is roughly three to four full time equivalents of dedicated engineering before you have a second agent, and the second agent adds less than the first because the platform is shared.

Two structural problems follow. The first is compensation: health systems compete for these people against technology employers, and the gap is wide enough that the successful hires are usually motivated by mission, which is a real but fragile retention strategy. The second is the bus factor. A two person team that built an agent nobody else understands is an operational risk that will be discovered at the worst moment, and documentation does not solve it because the knowledge that matters is tacit.

Ask the question directly before committing: if the two people who build this leave in eighteen months, what happens to the system? If the answer is that it freezes, the build is a project rather than a capability, and projects that cannot be changed cannot be governed, because governance requires the ability to act on what monitoring finds.

What does the total cost comparison look like?

We do not publish dollar figures here because they vary by an order of magnitude with scale, and a made up number is worse than none. What is stable is the shape: which cost lines exist in each option, who carries them, and which are routinely underestimated.

Cost lineBuyBuildUnderestimated in a build case
Model inferenceIncluded in licence, vendor absorbs price changesDirect, variable with volume, exposed to provider pricingYes, especially for agents that retry and self check
Initial engineeringNoneLargest visible line, typically two to four quarters to first production useNo, this is the line everyone models
EHR integrationVendor built and maintained, though your team still configuresYours, including write back, identity and context passingSeverely
Evaluation harnessVendor internal, plus your acceptance testingYours to build and maintain in perpetuitySeverely, and often omitted entirely
Monitoring and audit loggingVendor provides, you verify it is exportableYoursYes
Ongoing maintenanceIn subscriptionTypically the largest lifetime line, ongoing at 20 to 40 percent of initial build effort annuallySeverely
Model version migrationVendor problemYours, on the provider's timetableYes, usually not modelled at all
Support and on callContractual, with a response commitmentYours, including out of hoursYes
Compliance evidenceVendor produces, you reviewYou produce, about yourselfYes
LiabilityShared, bounded by contract and indemnityEntirely yoursNot a cash line, and the largest item
Switching costReal, and the main downside of buyingNone, and the main upside of buildingNot applicable

The honest summary is that buying front loads a recurring, predictable cost and caps your downside, while building converts that into a large capital cost plus a smaller but permanent operating cost plus unbounded liability. Organisations with strong engineering functions and long time horizons can win that trade. Most health systems do not have the second condition even when they have the first, because the leadership that approved the build is rarely the leadership that inherits year four.

One more asymmetry worth naming: vendor pricing in this category is still moving, and mostly downward per unit as competition increases. A build case justified against today's licence prices is competing against tomorrow's, and that is not a favourable comparison. Current published pricing, where it exists at all, is collected in our AI scribe pricing comparison.

Who carries the liability when you build?

You do, entirely, and this is the line that should carry the most weight and usually carries the least because it does not appear in a spreadsheet.

When you buy, the vendor signs a business associate agreement, carries insurance, indemnifies you within negotiated limits, and has a security programme that has been examined by other customers' auditors. When something goes wrong there are two parties, a contract and a documented allocation of responsibility. Your HIPAA obligations do not transfer, but the operational and financial exposure is shared.

When you build, you are the developer. Every question a vendor would have to answer becomes a question about your own engineering: how the model was evaluated, what the failure modes are, what testing was done on the populations affected, whether you monitored for drift, whether you acted on what you found. You are also the party that has to determine whether what you built meets the definition of a medical device and, if so, what that requires. See FDA oversight of AI enabled devices for where that line sits, and take regulatory advice before you assume it does not apply.

State law is moving in the same direction. Several states have enacted AI statutes with obligations that attach to developers as well as deployers, and building makes you both. Colorado, California, Texas and Utah have each taken different approaches, and organisations with European exposure face the developer obligations in the EU AI Act as well. Structuring your programme against the NIST AI Risk Management Framework helps here, because it gives you a recognised structure for the documentation you will now have to produce yourself.

None of this makes building unacceptable. It makes it a decision that legal and risk should be in the room for, at the point of the decision rather than at the point of the incident.

When does an internal build make sense?

Rarely, and the cases share a shape. All four conditions should hold, not two.

  1. The workflow differentiates you. It is something you do that peers do not, and doing it better is part of why patients, clinicians or payers choose you. A build that replicates a commodity workflow is paying a premium for a worse version of something you could rent.
  2. No vendor serves it adequately. Verified by actually looking, not assumed. The most common justification for a build is a requirement nobody tested against the market, and the category moves fast enough that a scan from eighteen months ago is out of date.
  3. You already run platform engineering. Not intend to. If you do not currently operate internal software with an on call rota, an evaluation practice and a release process, the agent will be the forcing function for building all of that, and that programme is much larger than the agent.
  4. You can carry the liability and want the option value. Explicitly, with legal and risk having said so in writing, in exchange for the genuine benefit that you are not dependent on a vendor's roadmap or survival.

In practice the cases that meet all four tend to be narrow orchestration layers on top of bought components rather than whole products: routing logic that encodes your own clinical protocols, a triage policy specific to your population, an internal referral pathway that reflects a network structure no vendor models. These are small, they are genuinely yours, and they sit above vendor products rather than replacing them.

The cases that meet none of the four and get built anyway are usually driven by one of three things: a licence cost that looked large in isolation, an engineering team looking for a strategic project, or a belief that internal control equals lower risk. That last belief is the most expensive, because internal control without an evaluation harness and a monitoring practice is not control, it is opacity with a familiar logo on it.

What about the middle path?

Most sensible programmes end up here, and it is worth naming the options rather than treating this as a binary.

OptionWhat you ownBest whenMain risk
Buy a productConfiguration and adoptionCommodity workflow, adequate vendors, no differentiationSwitching cost and roadmap dependence
Buy a platform, build the workflowsWorkflow logic, prompts, orchestration on a vendor platformSeveral related workflows, some differentiating, modest engineering capacityPlatform lock in at a deeper level than a product
Buy the components, build the orchestrationAgent logic and integration, on bought models and infrastructureReal platform engineering exists, workflow is genuinely yoursYou now own the evaluation and monitoring burden
Build end to endEverythingAlmost never in a provider organisationTalent concentration, liability, permanent maintenance

The second row deserves particular attention because it is where the market is moving and where the marketing is loosest. A vendor platform that lets your team configure agents is not the same as building, and it is not the same as buying a product. You get real control over the workflow and you inherit real responsibility for its behaviour, while the vendor retains control of the substrate. Be precise in your governance about which side of that line each obligation falls on, because the ambiguity will otherwise be resolved during an incident.

A pragmatic sequence for a system with genuine engineering capacity: buy for everything commodity, use the bought deployments to build internal competence in evaluation and monitoring, and only then consider building the one or two workflows that are actually yours. The competence transfers; starting with the hard build does not.

How should you run the decision?

A sequence that takes a few weeks and produces a defensible answer rather than a preference.

  1. Write the workflow down as performed. Not as designed. The differentiation question cannot be answered against an idealised description.
  2. Scan the market properly. Include vendors your EHR partner integrates with and vendors it does not. Score against your requirements before seeing demos, using something like our pre demo compliance checklist, and record what you could not verify.
  3. Size the build honestly. Every line in the table above, including maintenance at a realistic annual percentage, model migration and on call. Have an engineer who will carry the pager review the estimate.
  4. Get legal and risk to state the liability position. In writing, for both options, before the decision.
  5. Test the talent assumption. Can you hire the team at your compensation bands, and what happens if the two key people leave.
  6. Decide against a written threshold. Which is a decision, not a preference, and can be revisited on evidence later.

Run that sequence and the answer is usually clear, and usually buy, with one or two genuine exceptions worth doing properly. That clarity is worth more than the decision itself, because a build entered with clear eyes and a funded maintenance line succeeds far more often than one entered on optimism about licence savings.

If you would rather have the market scan and the build estimate produced by someone with no stake in either answer, that is what our vendor selection and deployment roadmap engagements are for. We take no vendor commissions or referral fees, which is the only reason a build versus buy recommendation from an outside party is worth reading at all. Where the decision is buy, the failure patterns that follow are covered in why AI pilots fail in healthcare.

Sources

Primary material behind the claims above. Read the source before acting on any summary of it.

Questions we get asked

Is it cheaper to build AI agents in house than to buy them?

Almost never on a three year total cost of ownership basis, once integration, the evaluation harness, monitoring, model version migration, on call and ongoing maintenance are included at realistic levels. Build cases that appear cheaper usually compare licence cost against initial engineering cost and stop there. The genuine advantages of building are control, differentiation and independence from a vendor roadmap, and those are worth arguing on their own terms rather than dressing as cost savings.

How big a team do you need to run one production AI agent?

In our experience a minimum standing team is a technical lead, one or two engineers spanning the model and integration layers, a data or evaluation engineer owning the test harness, and a fraction of a clinical informaticist for quality review, with security and platform capacity drawn from existing functions. That is roughly three to four dedicated full time equivalents for the first agent. Subsequent agents cost less because the platform is shared, which is why a build only makes sense if you intend to run several.

Does building in house reduce our compliance risk?

It changes it rather than reducing it, and generally increases it. Buying gives you a business associate agreement, a counterparty with insurance, contractual indemnity and a security programme other customers have audited. Building makes you the developer as well as the deployer, so every question you would have asked a vendor becomes a question about your own engineering, and you also have to determine your own regulatory position. Internal control is not the same thing as lower risk.

What is the strongest argument for building?

Independence combined with differentiation. If a workflow is genuinely part of how you compete and no vendor serves it, building means your capability does not depend on another company's roadmap, pricing or continued existence. That is a real strategic asset. It is only realisable if you also have platform engineering, funded maintenance and an appetite for the liability, which is why the argument holds in far fewer cases than it is made in.

Can we start by buying and build later?

Yes, and this is usually the better sequence. Buying first gets the workflow into production, builds internal competence in evaluation, monitoring and clinical quality review, and produces real data about where a vendor product falls short. Those are exactly the capabilities a later build needs. Preserve the option by negotiating data portability and an exportable audit log at contract stage, because a vendor that will not export your data has made the later decision for you.

How do we avoid vendor lock in if we buy?

Negotiate for exportable data and audit logs in a documented format, a defined offboarding process with a timeline, and clarity on what happens to configuration and workflow logic you created inside the vendor's platform. Then actually test the export once during the first year rather than discovering at termination that it produces something unusable. Lock in is a real cost of buying, but it is a manageable one and it is smaller than the maintenance burden it replaces.