You Know Money Is Being Spent. Not How Much or Why.
Each team calls the LLM API directly with its own key. The total cost appears at end of month. Attributing it to a team, project, or specific agent requires manual work nobody has time for.

AI GOVERNANCE
Many teams, many LLM providers, no central visibility of who is calling what, how much it costs, or what data leaves the perimeter. Your AI provider's dashboard only shows its own traffic, not an audit trail that's yours, reviewable by your security team.
The problem isn't adopting AI. It's governing it.
The AI Governance Gap
You know AI adoption is happening across the organization. What you don't have is a shared control layer across it.
Each team calls the LLM API directly with its own key. The total cost appears at end of month. Attributing it to a team, project, or specific agent requires manual work nobody has time for.
Two teams send semantically identical questions to the same model. They pay twice. Nobody knows, because there is no shared layer between them and the provider.
Prompt injection, PII in payloads, API keys hardcoded into prompts. Without inspection at the entry point, these surface only when something goes wrong.
Definition
AI governance is the set of policies, controls, and observability mechanisms that determine who in your organization can call which AI model, under what conditions, at what cost, and with what data leaving your perimeter.
It is not a compliance framework alone. It is not a dashboard. At the technical level, it is the enforcement layer between your teams and the LLM providers they call, applied at the point where the traffic actually flows: the API layer.
Without AI governance enforced at that layer, the only visibility you have into your AI traffic is the bill at end of month and the logs inside the vendor's portal, which is not your portal. With it, every LLM call is authenticated, authorized, rate-limited, logged, and attributable to a team, a user, or a cost center, before the request leaves your infrastructure.

Why the API Layer
Every LLM call is an API call: an endpoint, a payload, a cost. The same infrastructure that governs REST traffic can govern LLM traffic, plus AI-specific additions: token budgets, prompt inspection, semantic caching.
The alternative is governance built into each application, every team with its own auth, logging, cost controls. That's shadow AI: a dozen teams calling a provider with a dozen keys, no central visibility, no way to answer who sent a prompt last Tuesday.
Governance at the API layer means one enforcement point, one audit trail, one config file, versioned in Git.
Every organization also writes a governance policy, usually owned by legal and compliance under frameworks like the EU AI Act. Necessary, but a wiki page can't stop a request or produce a log for your CISO. KrakenD does not replace the policy, it enforces it.

Categories of Control
Categories of control, applied at the gateway before the request reaches the model, each backed by a specific component, all defined in a single JSON config file that deploys as a Docker image and runs on any infrastructure. See the full AI Gateway »
Not every team should call every model. Not every user should access every agent. JWT, OIDC, mTLS, and API key validation are enforced at the gateway before the request reaches the model, the same auth stack already used for REST APIs.
How KrakenD Solves This: auth/validator points at your existing IdP, Entra ID, Cognito, Keycloak, Auth0. The same validator you already use for REST endpoints applies automatically to your LLM and MCP tool-call endpoints, no separate auth stack to build or maintain.
Which team is spending how much, on which model, per day, per month. Budget enforcement at the gateway means a runaway process or a misconfigured agent cannot generate unbounded LLM spend. Quotas are enforced before the request leaves the perimeter.
How KrakenD Solves This: governance/quota, backed by Redis for persistent, cross-instance counting, enforces hourly, daily, and monthly limits per user, team, or cost center, weighted by token cost per model. The remaining budget is returned to the client in response headers, so applications can react before they hit the ceiling.
PII in prompts, malformed or oversized payloads, prompt structures that let an end user inject arbitrary instructions. Inspection at the API layer happens before the payload reaches the model, so data that should not leave your infrastructure does not.
How KrakenD Solves This: JSON Schema validation rejects malformed or oversized payloads before they reach the backend. Request body modifiers can remove or replace specific fields, including sensitive data patterns, and prompt templates constrain what an end user actually controls in the payload sent to the model.
Your LLM vendor keeps logs inside their portal. Those logs are not yours. AI governance enforced at the API layer emits traces to your own observability stack, in the formats you already use, so the audit trail lives in your infrastructure, not in a vendor dashboard you lose access to when you change providers.
How KrakenD Solves This: native, vendor-neutral OpenTelemetry exports metrics and traces to Grafana, Datadog, New Relic, your SIEM, whatever you already use, enabled once at the service level. No separate agent, no vendor lock-in on where the logs live.

Real Architectures, No Names
Scenarios based on real customer architectures, each grounded in a verified, solvable technical problem.


The Industrial Company With a Heterogeneous Agent Fleet
The Team Building Role-Based Agent Access
The Regulated Environment With On-Premise GPUs
The Platform Team Exposing APIs to AI Agents
Hivebrite runs the community engagement platform behind 2,000+ alumni networks, professional associations, and corporate programs worldwide. When MCP became a practical way to expose APIs to LLM agents, the question was whether the same OpenAPI contract that already drove their REST API could generate MCP tools without duplicating configuration.
The answer was a single annotation per operation. Their build-time resolver reads it and emits both the REST endpoint and the corresponding MCP tool from the same definition. No second spec to maintain. No second security model to enforce. The JWT validation, schema validation, and rate limiting already built for REST come along automatically on the agent surface.
Today, more than 200 of Hivebrite's REST operations are wired as MCP tools from those same definitions using KrakenD's built-in MCP Server (see how the MCP Server works »). The cost of exposing an existing operation to an LLM agent is one annotation line. Three MCP-specific Go plugins handle the edge cases specific to their stack: argument forwarding to Rails bracket notation, error passthrough for agent-readable validation detail, and header-to-body promotion for pagination metadata. Everything else runs on the stock configuration.
One source of truth, two delivery surfaces. We expect this pattern to become fairly standard as more teams start exposing their REST surface to LLMs.
No Vendor Lock-In
No IdP migration, no new observability pipeline, no rip-and-replace of the gateway you already run. If you are currently on Kong, Apigee, Tyk, or AWS API Gateway, AI governance is one more reason to consider the switch.
JWT, OIDC, mTLS. No IdP migration required.
Native OpenTelemetry. Grafana, Datadog, New Relic, your SIEM. The trace goes where you already have tooling.
Stateless by design. No PVC, no coordinator node. Configuration is immutable and lives in Git.
OpenAI, Anthropic, Bedrock, Azure OpenAI, Gemini, on-prem models. Your application calls one endpoint. KrakenD decides the backend based on cost, latency, role, or compliance rules.
KrakenD's built-in MCP Server exposes your existing REST APIs as tools for LLM agents, from the same OpenAPI contract, with the same auth and rate limiting already in place.
KrakenD deploys as a standard Docker image on Kubernetes, any cloud provider, bare metal, or air-gapped on-premise environments. No managed service to provision, no cloud account required, no vendor dependency in the runtime. The same binary that governs your LLM traffic in GKE today runs in an air-gapped data center tomorrow, with no changes to the config.






Independently Verified
G2 Fall 2026 API Management, Mid-Market segment: KrakenD Quality of Support scores 98%, the highest of any vendor in the table. Mid-Market customers recover their investment in 3 months (category average, 11.65 months).
Source: G2 Fall 2026 API Management reports, Mid-Market segment. Data collected through July 28, 2026. Third-party verified peer reviews, not vendor claims.
AI Governance FAQ
No. KrakenD governs traffic that passes through a client you control. SaaS platforms that route LLM calls server-side go through the vendor's own infrastructure, not yours. It complements those layers by governing the pro-code and custom-built traffic sitting alongside them, it does not replace vendor-specific consoles.
KrakenD reads the JWT claim on each request, routes it to the correct backend, and enforces a token ceiling per team, project, or agent at the gateway level. No application code has to track or report its own usage. The same claim-based logic is what lets a single endpoint serve different roles differently, for example an executive view that aggregates multiple regional agents in parallel while a regional user only sees their own region.
Application-level logging only sees what that one application sends. When many teams call several providers directly with their own keys, there is no shared layer to attribute cost, catch duplicate prompts across teams, or produce one audit trail your security team can review without going application by application. A gateway sits in front of all of it, independent of which team or app is calling.
Yes, this is a common deployment pattern. KrakenD is stateless: no PVC, no node coordination, no database in the critical path. Configuration lives in Git, so any auditor can review exactly what is deployed without going through the LLM vendor. Token cost attribution per model and per team, and automatic failover when a model does not respond, both work the same way in this setup as anywhere else.
Multi-provider is the default, not an add-on. OpenAI, Anthropic, Bedrock, Azure OpenAI, Gemini, and on-prem models all sit behind the same endpoint. Your application calls one URL. KrakenD decides which backend actually serves the request based on cost, latency, user role, or compliance rules.
No. Your application keeps calling one endpoint. Routing decisions, token budgets, semantic caching, and prompt guarding are all configured at the gateway, not in application code. Exposing an existing REST operation as an MCP tool for agents follows the same pattern: one annotation per operation, not a rewrite.
An AI gateway is the infrastructure: the proxy that sits between your applications and LLM providers. AI governance is what that gateway enforces: access control, cost limits, audit trails, data protection. You need both. A gateway without governance policies is a passthrough. Governance policies without a gateway are a document. KrakenD is the gateway; the governance is the config you write for it. See the full AI Gateway »
No. Your provider's dashboard shows you their view of your traffic. KrakenD gives you your view, attributable to users, teams, and cost centers, stored in your own observability stack, independent of which provider you use. The two are complementary. You keep both.
No. AI governance enforcement runs in the same binary as your API gateway. There is no separate AI governance service to deploy, no additional database for the governance layer, no second control plane. The governance config lives alongside your existing gateway config in the same file.
KrakenD's conditional backend routing supports a fallback strategy that routes to a secondary model when the primary does not respond. Failover is declared in config and requires no application changes. The circuit breaker is complementary: it stops routing to a model that is consistently failing before fallback even triggers.
KrakenD governs LLM traffic and MCP tool calls through its built-in MCP Server. Agent-to-agent (A2A) traffic is a different protocol and not in scope for the current release. The MCP layer covers the tool execution surface, your existing REST APIs exposed as MCP tools, with auth, rate limiting, and observability applied at the tool level. Learn more about the MCP Server »
Yes. Single-provider setups benefit from governance in the same ways: cost attribution by team, prompt inspection, quota enforcement, and an audit trail that lives in your infrastructure. The multi-provider routing features become relevant when you evaluate a second provider or when pricing changes make switching attractive.
Walk through real-world scenarios: LLM routing across multiple providers, token budget enforcement per team, prompt security policies, and AI agent governance, all from a single config file on infrastructure you already trust.
Request a Demo See How the AI Gateway WorksStay up to date with KrakenD releases and important updates