---
title: "Build vs Buy: AI Gateway and MCP Governance | Verosek"
description: "Should you build an LLM and MCP gateway in-house or buy one? What building it involves, which systems your agents would need, and what Verosek gives you on day one."
url: https://verosek.com/build-vs-buy
---

Build vs Buy

# Build the gateway, or ship the agent.

Routing model calls is a sprint. Deciding every tool call, scanning every boundary and proving it afterwards is the project. Here is what building it involves, and what Verosek gives you instead.

[Book a call](https://cal.com/verosek-solutions-u9ztip/30min)

Built in-house: routing, scanning, tool rules and an audit trail are four separate systems, joined by SDK adapters, retries, a key vault and on-call. With Verosek: the same four layers in one stack, under one tile.

Four systems to build, wire together and keep running.

One layer. Change the base URL and the key.

The real scope

## The proxy is the part you planned.

In-house gateways start as a proxy. Production adds the rest, one requirement at a time.

Week 1

### A proxy

Forward model calls, check a key, log the request.

Month 3

### A policy layer

Rules for each tool and argument, a parser for SQL, a PII library, a vault for connector credentials, retries and fallbacks across providers.

Year 2

### A platform team

Tracking provider API changes and MCP revisions, answering auditors, and patching new attack classes that arrive inside tool results.

Before you build

## Five things to weigh before you build.

[ 01 ]

### Time to the first governed call

Build

Adapters for each SDK and provider come first. Your first tool rule runs after them.

Verosek

Keep the SDK you use. Change the base URL and the key, and the rules apply from the next call.

[ 02 ]

### A surface that keeps moving

Build

Every provider API change, MCP revision and new attack class lands in your backlog.

Verosek

Changes land in the gateway. Your application code stays the same.

[ 03 ]

### Failing closed, by design

Build

Each scanner, store and dependency needs a decided failure mode, or it fails open by accident.

Verosek

A check that cannot run answers 503, never a pass. A request the audit trail cannot record is refused before anything runs.

[ 04 ]

### Evidence an auditor accepts

Build

Logs written by the system under audit, which the auditor has to take on trust.

Verosek

Each request leaves a sealed trace. On a self-hosted deployment, an auditor you give the verification key checks it offline, and EU AI Act and NIST AI RMF reports come from the same traces.

[ 05 ]

### The cost after launch

Build

A team to build it, then engineers to run it, patch it and answer for it.

Verosek

A subscription, and your engineers back on the agent.

[ Scope it ]

See which of these your agents would need.

Scope it

## What would your team have to build?

Pick what your agents do. Each choice adds the components your team would build and keep running; Verosek ships all of them as one layer.

Call more than one model provider or SDK · Answered by AI Gateway

Call tools on real systems · Answered by MCP Tools

Read untrusted content or personal data · Answered by Shield

Answer for what an agent did · Answered by Audit Vault

Built in-house 15 components to build and run

With Verosek 1 layer, one base URL

AI Gateway , MCP Tools , Shield , Audit Vault

What your team would build

Routing

- Adapters for the OpenAI, Anthropic and Gemini shapes, streaming included
- Routing, fallback and cooldown across your deployments
- A residency check before every call

Tool rules

- Rules per key, per tool and per argument
- SQL decided from the parsed query
- A credentials vault, with OAuth where the server needs it

Scanning

- Prompt injection and jailbreak checks
- Personal data and secrets found in inputs, outputs, tool arguments and tool results
- Hidden instructions caught in tool results

Audit trail

- A sealed trace for every request
- On a self-hosted deployment, verification your auditor runs offline with the key you give them
- EU AI Act and NIST AI RMF reports built from the traces

With 4 systems, add the glue: retries between the systems, one identity across them, and someone on call for all of it.

12 components to build and run. With 3 systems, add the glue: retries between the systems, one identity across them, and someone on call for all of it.

9 components to build and run. With 2 systems, add the glue: retries between the systems, one identity across them, and someone on call for all of it.

3 components to build and run. One system today; the glue arrives with the second.

0 components to build and run. None of these yet? Then a thin proxy will do for now. Come back when your agents start calling tools.

Side by side

## What building it involves, next to what Verosek gives you.

Capability · Build it yourself · With Verosek

SDKs and providers

An adapter for every SDK and provider

An adapter per SDK and per provider, with streaming and tool-call deltas translated both ways.

Three SDKs, unchanged

OpenAI, Anthropic and Gemini SDKs work unchanged against OpenAI, Anthropic, Google, Azure, Ollama and any OpenAI-compatible server. Errors come back in the caller's own SDK shape.

Tool-call decisions

Middleware for every tool

Middleware that knows which tools each agent may call, and with which arguments.

Per-key, per-tool rules

A call the request did not offer is refused and never run. Tools the gateway runs obey per-key, per-tool rules for SQL, NoSQL, key-value, search, documents, filesystem, API, messaging and more. Watch mode shows what a rule would have blocked before it enforces, data-flow rules flag or stop untrusted tool results that try to choose where data goes, and a tool Verosek runs is held back if its definition changes.

Database queries

A query parser you maintain

A query parser, or string matching that misses the cases that matter.

Decided from the parsed query

SQL is decided from the parsed query: operations, tables, flagged columns, row bounds and read-only mode.

Scanning

A scanner wired to each boundary

A PII library, an injection classifier and a secrets scanner, each wired to each boundary.

Four boundaries, with Shield on

With Shield on: prompt injection and jailbreaks, personal data and secrets in inputs, outputs, tool arguments and tool results, and hidden instructions in tool results. Rules block; model checks flag.

Evidence

Logs your auditor has to trust

Request logs, written by the system being audited.

A sealed trace for every request

Every request is a trace of typed steps, scrubbed of secrets and personal data and sealed with HMAC-SHA256. On a self-hosted deployment, an auditor you give the verification key checks it offline with one CLI command, and decisions also go to a signed log a third party can check with public keys. EU AI Act and NIST AI RMF reports come from the stored traces.

Failure behaviour

A failure mode for every dependency

A failure mode chosen for every dependency, or a silent pass when one breaks.

Fails closed

A check that cannot run answers 503 with Retry-After, never a pass. A request the audit trail cannot record is refused before anything runs. Text let through unread is named in a response header.

Credentials

A vault and an OAuth flow per server

A vault, an OAuth flow per server, and rotation.

100 connectors, credentials sealed

100 connector templates, with OAuth and PKCE where the server needs it. Credentials are encrypted at rest with AES-256-GCM and never returned.

Routing

Fallbacks you keep in step

Fallbacks, retries and limits per deployment, kept in step across instances.

Weighted routing with fallback

Weighted choice across your deployments, fallback by priority, cooldown after failures, per-deployment limits, and a residency rule checked against every candidate before any call.

Keys and isolation

Key lifecycle and tenant scoping

Key lifecycle, roles and tenant scoping on every query.

Hashed keys, scoped per organisation

Virtual keys are stored only as hashes and carry their models, budget, rate limits and expiry. A block takes effect on every instance from the next request. Each organisation reads only its own data, with admin, auditor and user roles.

Running it

High availability in the request path

High availability, migrations and upgrades for a service in the request path.

Several instances, one leader

Several instances behind a load balancer on one Postgres and one Redis, with fleet jobs on an elected leader. Migrations run as a one-off before a new version starts.

Keeping up

Your backlog, forever

Every provider and protocol change lands in your backlog.

Lands in the gateway

Changes land in the gateway, not in your application.

Honest fit

## When building it yourself is the right call.

### Build it yourself if

- You call one provider through one SDK.
- Your agents call no tools that touch real systems.
- No security review or auditor will ask what an agent did.
- The gateway is the product you sell.

### Verosek fits if

- Agents call tools on production systems: databases, tickets, payments, code.
- You run more than one model provider or SDK.
- A security review or an auditor will ask what an agent did, and you need to show it.
- Several teams ship agents and need one set of rules.

Already built part of it? Keep it. Verosek routes to any OpenAI-compatible server, so your existing gateway can sit behind it while Verosek decides the tool calls and keeps the record.

## Frequently Asked Questions

### Should we build or buy an AI gateway?

Build a thin proxy if you call one provider, your agents touch no real systems and nobody will audit them. Buy when agents call tools on production systems, you run more than one provider or SDK, or someone will ask you to prove what an agent did. That second list is where in-house gateways grow into platform teams.

### What does it cost to build an LLM and MCP gateway in-house?

Mostly engineering time: adapters for each SDK, rules for every tool call, scanning at each boundary, a sealed audit trail and a credentials vault, then people to keep it current as providers and protocols change. The scope picker on this page shows which of those systems your agents would need.

### Can we start with an open-source proxy and move later?

You can, and the move takes two values. What you cannot get back is a record of the calls made before it. Verosek does the routing as well, with budgets, rules, scanning and the record on one key. If you want to keep your proxy for now, Verosek routes to any OpenAI-compatible server, so it can stay behind it.

### How much code changes to adopt Verosek?

Two values in the SDK you already use: the base URL, and the API key, which becomes a Verosek virtual key. Your OpenAI, Anthropic and Gemini calls keep their shape.

### What if we stop using Verosek?

An app that runs its own tools leaves by changing two values. Tools Verosek ran for you go back to your own code or MCP client.

### Can we try it on our own traffic before it blocks anything?

Yes. Shield checks can run in log-only or flag mode against live traffic before they enforce, and tool rules can run in watch mode, which records what a rule would have blocked. You switch a check or a rule to enforce once it stops flagging real work.

## Ship the agent. Not the gateway.

[Book a call](https://cal.com/verosek-solutions-u9ztip/30min)
