Legacy AI Gateway
This page covers the legacy AI Gateway, which runs through the AI Gateway
operator and AIGateway resources. For the current AI Gateway, see
AI Gateway.
The legacy AI Gateway is a component of Stacklok Enterprise.
The legacy AI Gateway is a self-hosted control point between AI clients and large language model (LLM) providers. Platform and security teams use it to enforce identity, budget, routing, data protection, and audit policies for model traffic.
The legacy gateway governs model access. The Connector Gateway governs MCP tool access.
Identify your deployment
The legacy gateway is installed through the AI Gateway operator with
global.stacklok.aiGateway.enabled and is configured through AIGateway custom
resources. If this command lists any resources, you run the legacy gateway:
kubectl get aigw -A
The current AI Gateway is installed with global.stacklok.aiGatewayV2.enabled,
runs as the <RELEASE_NAME>-ai-gateway-v2 Deployment, and is configured through
Helm values. If this command lists a Deployment, you run the current AI Gateway:
kubectl get deploy -A | grep ai-gateway-v2
For the current AI Gateway, see AI Gateway. To move an existing deployment from the legacy gateway, see Migrate from the legacy AI Gateway.
What you can do
- Set cost budgets for users and groups.
- Route model names across providers with weighting and failover.
- Screen requests and responses for prompt injection, payment card data, and personally identifiable information (PII).
- Record structured audit events and forward them to a security information and event management (SIEM) system.
- Associate requests with identities while keeping provider credentials in the gateway.
- Export traces and metrics to an OpenTelemetry collector, attributed to the users and groups that sent the traffic.
How configuration works
Apply an AIGateway custom resource to configure providers, routing,
resilience, and screening. The AI Gateway operator reconciles the resource into
running infrastructure.
Manage budgets in the console or use the Enterprise Manager API for automation and bulk import. See Manage budgets and Budgets and pricing. To confirm that the legacy gateway enforces those budgets, see Enforce budgets at the legacy AI Gateway.
Before you start
Install the legacy gateway before applying the examples in this section. See Configure the legacy AI Gateway.
Examples on these pages use -n <NAMESPACE>, where <NAMESPACE> is the
namespace your legacy gateway is installed into.
For caller identity and catalog API endpoints, see the management API reference.
Contents
Overview and deployment identification
Govern, secure, and control access to large language model providers with the legacy AI Gateway, configured through AIGateway custom resources.
Configure the legacy AI Gateway
Enable the legacy AI Gateway in the platform chart, satisfy its prerequisites, and bring up a working gateway in the right order.
Model providers
Connect OpenAI, Anthropic, AWS Bedrock, Azure OpenAI, Google Vertex AI, and OpenAI-compatible providers to the legacy AI Gateway, and rotate their credentials.
Model routing
Map model names onto providers with a default route, weighted load balancing, priority failover, retries, and timeouts on the legacy AI Gateway.
Budget enforcement
Confirm that the legacy AI Gateway enforces budgets through its webhooks, and what callers see when a budget runs out.
Prompt injection screening
Screen inbound prompts for injection attacks with AWS Bedrock Guardrails, including rollout from monitor to enforce, IAM setup, and cost.
PCI/PII controls
Scan prompts and responses for credit cards, national identifiers, and other sensitive data, and block, redact, or log what is found.
Audit logs
Enable structured audit events for model requests, detections, and key lifecycle, then ship them to Splunk, Elastic, Kafka, or Loki.
Telemetry
Export legacy AI Gateway traces and metrics to an OpenTelemetry collector and attribute model traffic to the users and groups that sent it.
Management API reference
REST API reference for legacy AI Gateway caller identity and model and MCP server catalogs.