Build vs Buy AI Agents: A Practical Decision Framework
A practitioner’s guide to build vs buy AI agents. Compare options, see a decision matrix by workflow risk, and get concrete “pick X if” recommendations.
You’re weighing whether to build a custom AI agent or buy a platform. Short answer: buy a focused SaaS tool for a narrow, stable use case; pick a warehouse-native assistant for governed analytics and proven row-level security; choose a horizontal platform when you need speed across multiple domains but can live with its guardrails; build a custom agent only when the workflow is core to your competitive advantage and you control the integrations. If you do write, budget for identity, audit, evals, and runbooks—those are where the real work lives in enterprise AI.
The four options and where each actually fits
Every build versus buy decision for an AI agent lands in one of four buckets. Here’s what each is, and when it earns its keep.
- Custom agent (in-house, code-first). You own the stack: tools, state, prompts, evals, and deployment. Highest integration depth and model flexibility. Choose this when the workflow is differentiating, spans multiple internal systems, and must follow your identity/permissions model exactly. This is a custom build and it’s real engineering, not just prompts.
- Horizontal agent platform. An off-the-shelf orchestration layer with tool connectors, UI, and policy controls. Great for fast pilots across many teams. Lower operating burden than a custom AI solution, but you inherit the vendor’s abstractions. Good for broad internal automation experiments where speed matters more than perfect fit.
- Warehouse-native assistant. An agent embedded in your data warehouse or BI stack (semantic layer, row-level security, lineage, audit). Ideal for text-to-SQL, governed Q&A, and report generation. Trade some model freedom for first-class identity, auditability, and data residency.
- SaaS point solution. A narrow tool that automates one process end-to-end (e.g., L2 support triage). Low setup, proven outcomes, and predictable pricing. Great when the use case is standard and not your core product, or when you need value this week. Limited customization and exit options.
Pick fast: if your first question is “how do we integrate with SSO/RBAC and log every action,” you’re leaning warehouse-native or build; if it’s “can my team try this in an hour,” buy off-the-shelf and reassess later.
Side-by-side comparison: custom vs platform vs warehouse-native vs SaaS
| Dimension | Custom Agent | Horizontal Platform | Warehouse‑Native Assistant | SaaS Point Solution |
|---|---|---|---|---|
| Integration depth | Any API, private services, bespoke tools | Connectors + limited custom tools | First‑class with warehouse/BI; external via UDFs/webhooks | Preset integrations only |
| Identity & permissions | Exact match to your SSO/RBAC | Vendor’s model; SSO/RBAC mapped | Native RBAC/RLS; least‑privilege by schema | Role mapping via app configs |
| Auditability | You design logs/lineage | Built‑in with export | Warehouse logs + query history | App logs; export varies |
| Evals & guardrails | Full control, highest effort | Opinionated evals, faster to start | SQL‑centric checks; easier to verify | Predefined, limited to product scope |
| Model flexibility | Any model; swap at will | Models supported by platform | Warehouse/provider set; sometimes pluggable | Fixed to product choice |
| Operating burden | Highest (SLAs, oncall, upgrades) | Moderate (vendor handles core) | Moderate (DBA patterns apply) | Lowest (monitor usage) |
| Data residency | Your infra / VPC control | Vendor SaaS or private deploy | Data stays in warehouse | Vendor cloud; policy dependent |
| Cost at scale | Infra + team; efficient at high scale | Platform fees + usage | Warehouse credits + model usage | Per‑seat or per‑workflow fees |
| Exit options | Full ownership of code | Export flows; partial lock‑in | SQL/DB objects portable | Lowest portability |
Pick a custom build if you need deep, multi‑system integration, strict ownership, and model choice. Pick a horizontal platform to test many automations quickly and standardize policy. Pick a warehouse‑native assistant for governed analytics that must inherit existing RLS/lineage. Pick a SaaS point solution when speed, outcome guarantees, and low ops matter more than fine‑grained control.
Identity, permissions, and auditability: wire it before you wow
Most pilots skip identity and auditing. That’s why week two bites you: the first real question is “who approved this action, under which role, with what data?” If the AI agent can’t mirror production RBAC and leave a forensic trail, you will pause the rollout.
For analytics workflows, push permission checks into the warehouse. Use secure views with a user‑to‑entity entitlement map and keep your AI layer thin:
-- Entitlements drive row-level access
CREATE OR REPLACE TABLE entitlements (
user_name STRING,
customer_id STRING
);
CREATE OR REPLACE SECURE VIEW orders_secure AS
SELECT o.*
FROM orders o
JOIN entitlements e
ON e.customer_id = o.customer_id
WHERE e.user_name = CURRENT_USER();
In dbt, codify grants and document lineage so you can answer “why did the agent see this?”
# models/marts/orders.yml
documentation:
- name: orders_secure
description: Secure view with entitlement-checked orders
models:
marts:
+materialized: view
+grants:
select: ['ANALYST_ROLE','SUPPORT_ROLE']
Log every tool call with inputs, outputs, user, and role. Don’t store raw PII unless required—hash and store pointers.
-- Minimal audit schema
CREATE TABLE agent_audit (
id STRING,
user_name STRING,
role STRING,
tool STRING,
input VARIANT,
output VARIANT,
started_at TIMESTAMP,
finished_at TIMESTAMP,
success BOOLEAN
);
-- Example write from app code (pseudo)
-- INSERT INTO agent_audit (...) VALUES (...);
If you need a deeper treatment, see AI Agent Governance That Survives Production. For Slack-native agents that inherit RBAC and log actions in your warehouse, our overview is here: Slack AI Agents.
Evals, safety, and why reading data is not proof you can write
A pilot that “reads data” proves almost nothing about safe writes. Reads are idempotent and reversible. Writes need idempotency keys, conflict detection, and transactional guarantees. Your evals must simulate the worst day, not the best demo.
Start with offline evals on golden test cases, then add online checks that score every action. Treat tool calls like untrusted user input.
# Python-ish skeleton: tool with pre/post checks
class TicketTool:
def __init__(self, client):
self.client = client
def create_ticket(self, user, payload):
assert user.has_scope('support:create')
self._validate(payload)
ticket = self.client.create(**payload)
self._audit(user, 'create_ticket', payload, ticket)
return ticket
def _validate(self, payload):
required = {'title','customer_id'}
if not required.issubset(payload):
raise ValueError('missing fields')
For database writes, force explicit transactions and checksums. An agent that proposes SQL should not execute it blindly:
-- Safe-ish pattern: propose, verify, then commit
BEGIN;
CREATE TEMP TABLE proposal AS
SELECT * FROM updates_staging WHERE request_id = :id;
-- Invariant check: affected rows only for entitled accounts
SELECT COUNT(*) FROM proposal p
LEFT JOIN entitlements e USING (customer_id)
WHERE e.user_name != :current_user
OR e.user_name IS NULL; -- must be 0
-- Only then
UPDATE target t
SET status = p.status
FROM proposal p
WHERE t.id = p.id;
COMMIT;
Build evals that catch regressions you care about: row‑count deltas, policy compliance, PII leakage, latency SLOs. We outline pragmatic eval metrics and review loops in An AI Agent Evaluation Framework for Production Workflows. Remember: guardrail prompts help, but they are not a control. Controls live in code, policies, and the database.
Cost, data residency, operating burden, and exit options
Cost is not just tokens. It’s team hours, incidents, and the tail of maintenance. To evaluate cost at scale, measure:
- Throughput: actions/minute at P95 latency under live load.
- Warehouse runtime for agent SQL (e.g., a 40M‑row orders table on an X‑Small warehouse should return within seconds for indexed filters; if not, fix stats/partitions).
- Token spend per successful workflow, not per request. Count retries and tool calls.
- Oncall burden: pages per 1,000 actions.
Data residency: warehouse‑native assistants keep data in your DB; platforms and SaaS vary by region and VPC options. If residency or customer commitments are strict, start warehouse‑first and bring models to data, not the reverse.
Operating burden: custom agents mean you own deployments, upgrades, and shadow‑IT controls. Platforms reduce toil but trade you into their lifecycle. SaaS offloads ops—ensure you have export paths for your prompts, runbooks, and logs. Model flexibility matters if you plan to switch providers or use task‑specialized models.
Exit options: prefer patterns that store state in your systems (SQL tables, object storage). Avoid burying business logic solely in a vendor UI. For warehouse‑centric scenarios, see our notes on cost modeling in Snowflake Cortex Cost: Model It Before You Scale.
Decision matrix: choose by workflow risk and reversibility
Two variables decide most build vs buy calls: risk of harm if the agent is wrong, and reversibility of actions. Map your workflows, then pick accordingly.
| Workflow profile | Risk | Reversibility | Recommended path |
|---|---|---|---|
| Internal Q&A over governed BI | Low | High (read‑only) | Warehouse‑native assistant |
| Tier‑1 support triage | Medium | High (reassign/correct) | SaaS point solution or platform |
| Pricing updates, refunds | High | Low (writes; financial impact) | Custom agent with strict controls |
| Data pipeline remediations | Medium‑High | Medium (rollbacks complex) | Platform for read; custom for writes |
Rules of thumb:
- If the workflow touches money, PII, or compliance systems, build a custom agent or keep the platform in propose‑only mode.
- If the workflow is a commodity (invoice routing, common IT tasks), buy ai agents as a SaaS or use a platform template.
- If the value is insight and speed for analysts, a warehouse‑native assistant wins on governance.
- Hybrid is normal: build the last 20% around a platform (approval flows, entitlements, eval jobs).
We cover connecting agents to the rest of your stack in Internal AI Platform Architecture. For enterprise text‑to‑SQL pitfalls and trust, see Enterprise Text‑to‑SQL.
Architecture patterns and sample code you can deploy
A minimal custom agent often looks like “LLM + tools + policy + audit.” Keep tools small and deterministic. Put business rules in code and SQL, not prompts.
# Python-ish: Slack Q&A with read-only SQL tool
from slack_bolt import App
from my_llm import call_model
from tools import sql_query
app = App(token="xapp-...")
TOOLS = {
"sql_query": sql_query # enforces RLS via secure view
}
@app.message("^ask ")
def handle_ask(message, say):
user = message["user"]
question = message["text"][4:]
plan = call_model(
system="You are a cautious data analyst. Never write.",
tools=list(TOOLS.keys()),
prompt=f"User {user} asked: {question}",
)
answer = execute_plan(plan, user)
say(answer)
def execute_plan(plan, user):
# Only allow whitelisted tools; log every call
for step in plan["steps"]:
assert step["tool"] in TOOLS
result = TOOLS[step["tool")](user=user, **step["args"])
audit(user, step, result)
return plan["final"]
Constrain the agent’s data surface with views tuned for AI:
-- Semantic view for safe Q&A
aCreate or replace VIEW ai_orders AS
SELECT order_id, order_date::date AS order_date,
customer_id, total_amount, status
FROM orders_secure
WHERE order_date >= dateadd('year', -2, current_date);
Document capabilities in YAML the same way you document models, so operations can diff changes:
# ai/agent.yml
name: support_assistant
capabilities:
- intent: "order_status"
tools: [sql_query]
datasets: [ai_orders]
- intent: "refund_policy"
tools: [] # read-only FAQ
If you want this pattern in Slack with approvals, we’ve documented the approach in Building a Slack AI Agent That Can Actually Query Your Warehouse and a higher-level capability view at Slack AI Agents. For connecting many integrations, see Internal AI Platforms.
When to build vs buy AI: team, skills, and the 30% rule
What is build vs buy? It’s a cost–benefit analysis: do you invest in building an in‑house system or buy off-the-shelf software that solves most of the problem now. For AI agents, the calculus includes risk, reversibility, and how often the workflow changes.
The “30% rule in AI” is a practical heuristic: only build the 30% that creates competitive advantage, and buy the rest. Don’t hard‑code the number—scope the smallest custom slice that materially differentiates you, and keep everything else standard. If your team is spending cycles reproducing a vendor UI instead of shipping a policy engine or eval harness, you’re building the wrong layer.
Build if:
- The workflow is core product experience, or its quality is a differentiator.
- You require exact alignment with enterprise RBAC, audit, and data residency.
- You have engineering, process design, and project management skills in-house to run oncall and iterate.
- You need model flexibility (e.g., mix of large language model backends) and hybrid deployment.
Buy if:
- The use case is standard, and the vendor’s guardrail/policy model is acceptable.
- You need to automate now and can adapt to the tool’s way of working.
- You can exit gracefully by exporting data, prompts, and logs.
Am I wrong to outsource the plumbing while insisting on doing all the agentic work myself? Usually, yes. Outsource the commodity plumbing (UI, queueing, retries) and invest your ai engineering time in policy, evals, and integration correctness. For a deeper checklist, see An AI Agent Evaluation Framework for Production Workflows and AI for Data Teams: Workflows That Actually Stick.
FAQs from practitioners
Can a purchased AI agent handle complex, multi‑step customer service workflows?
Often yes—if the workflow matches the product’s assumptions. Platforms and SaaS agents do well on triage, classification, knowledge lookup, and templated replies. The moment you need cross‑system writes with fine‑grained policy (discount rules, entitlements), expect to extend or add a custom layer.
Could we have built this ourselves?
Ask three things: did we need model flexibility; did we need deeper integration than the vendor API supports; and will maintaining this UI and runbook distract from core product? If two answers are “yes,” a future custom build is likely.
Do you have sufficient compute resources?
For warehouse‑centric agents, start small (X‑Small) and profile SQL. For model throughput, scale by concurrent actions, not seats. Measure P95 end‑to‑end latency with real prompts, tools, and data.
Buying off‑the‑shelf or build a custom agent?
Buy for commodity automation and fast ROI. Build a custom when identity, audit, data residency, or integration depth are hard requirements. A hybrid—platform + custom tools—often ships fastest with the right controls.
What should engineers actually build?
Policies, evals, and tiny, deterministic tools. Don’t rebuild generic UIs if a platform provides them. Put approval flows and audit in your systems. That’s where long‑term leverage lives.
Pick a path, then prove it with one high‑value workflow under real constraints. If you want a gut‑check on architecture or a second set of hands to deploy, start here: Start a project with Vertex.
About the author
Eric Provencio — Analytics engineer who has built and run production data platforms for Disney, Hulu, Nike, Peloton, Gopuff, and Kaplan. Founded Vertex Data Consulting to do the deep work most data teams never find time for: dbt Cloud migrations, repo performance, Airflow reliability, and AI agents that actually touch the stack.