AI gateway
An AI gateway is a proxy that sits inline between applications and model providers and applies one security and governance policy to every prompt and completion. Its usual controls are guardrails, PII and secret handling, provider allowlists, usage and cost limits, and audit logging.
How it works
Applications send model calls to the gateway instead of straight to the provider. When a provider speaks a familiar API shape such as OpenAI’s, putting a gateway in front of it is a base-URL change rather than an integration project.
For each request, the gateway checks the destination against the allowlist, inspects the prompt for injection, personal data and secrets, applies the data policy for that destination, forwards the call, and inspects the completion on the way back. Every decision is logged. Policy can differ by destination: PII bound for OpenAI is masked by default, PHI bound for a provider that is not HIPAA-eligible is blocked, and source code sent to an internal model is allowed and logged. This is the request path that inference security is concerned with.
The same pattern applies to tools. An MCP gateway sits between agents and MCP servers and applies policy to tool calls and their results; see MCP security.
What it looks like
An engineer’s personal sk- API key turns up in a production service deploy. The gateway spots it through header inspection, matching the key’s hash against known personal accounts. Policy decides per environment: block in production, alert in development, rate-limit in pre-production. This deploy is in production, so the call is blocked and the key never reaches the provider.
Why it matters
A gateway gives one place to set model policy, one log of decisions, and one point at which to cut off a provider. Without it, each team wires its own provider keys and rules, and nobody can say which data went to which model.
It has two limits. A gateway can enforce policy only on traffic that passes through it, so a browser tab or a laptop tool that calls a provider directly goes around it. That is why gateways need shadow AI discovery beside them. A gateway also concentrates what attackers want. The LiteLLM compromise showed one LLM proxy holding the API keys for every provider, the cloud IAM roles behind them, and the database credentials for logging, budgets and rate limits.
What good looks like
- Inline, so detection happens before the model is called.
- Inspects both directions: inbound prompts and outbound completions.
- Per-destination data rules, written as policy rather than code.
- A monitor mode for tuning, then enforcement on the riskiest paths.
- Decision logs exported to the SIEM.
- The gateway treated as critical infrastructure: short-lived, scoped publishing tokens, pinned and verified build dependencies, and egress control on the CI runners that build it.
In the frameworks
- NIST AI RMF: in Wingback’s policy examples, the rule “agents may only invoke models from the approved-vendor list” records its evidence against GOVERN-6.1.
- ISO/IEC 42001: Wingback’s audit binder files the approved-vendor catalog of per-integration allowlists under A.10.3.
- EU AI Act: a rule that blocks PHI bound for providers outside the HIPAA-eligible list records evidence against Article 9.
- MITRE ATLAS: Wingback’s red-team library tags attacks on the gateway itself, such as gateway bypass, model-provider redirect and redaction evasion at the wire, to the Defense Evasion tactic.
How Wingback handles it
The gateway proxy in AI Runtime Defense is a drop-in for OpenAI, Anthropic, AWS Bedrock and Azure OpenAI compatible APIs, and puts other providers, including Google Vertex and Gemini, Mistral and Ollama, under the same policy. The same runtime can run as a Kubernetes sidecar or an SDK guard with no agent code changes, and teams that already run a gateway can bring their own. The Baseten connector puts the models you serve on Baseten behind the same gateway.
Keep reading
- GlossaryInference securitySecuring each request's path through a model provider: policy on every prompt and completion, guards against injection and…
- GlossaryRuntime AI defenseProtecting AI systems while they run, inline, rather than only scanning code or configuration beforehand.
- GlossaryMCP securitySecuring the Model Context Protocol: the servers, tools, and transports that agents use to reach external systems.