Agent gateway: what it adds beyond an LLM gateway
An agent gateway governs an agent's calls to models, tools, and other agents. What it enforces on each kind of traffic, and how it differs from an LLM gateway.
- Published
- Reading time
- 15 min read
In short
- An agent gateway is a proxy that sits on all three kinds of traffic an AI agent produces: calls to models, calls to tools over MCP, and calls to other agents over A2A. It checks who the agent is acting for, what it may reach, what it may spend, and records each hop.
- The hard part is identity. A request from an agent carries two identities, the agent's and the person or system it acts for, and the gateway has to keep both on every downstream model, tool, and agent call.
- Grants do not chain. An agent that is allowed to call another agent has not been given that agent's model or tool access, and a good gateway checks each hop separately.
- An LLM gateway prices and routes model calls. An agent gateway adds tool allowlists, agent registration, and a session log that joins one task's model, tool, and agent calls under one ID.
An agent gateway is a proxy between AI agents and everything they call: model providers, tool servers, and other agents. It checks who each agent is acting for, decides which models, tools, and agents that caller may reach, enforces a budget, and writes every hop to one log that can be read back as a single task.
An LLM gateway already does part of this for model calls. The agent gateway exists because agents make two more kinds of call that an LLM gateway does not see, and because a single user request can now fan out into dozens of model, tool, and agent calls that need to stay attributed to the person who started them.
What an agent gateway governs
An agent gateway governs three kinds of traffic: an agent's calls to models, its calls to tools, and its calls to other agents. Each one has its own protocol and its own failure, so the gateway applies a different check to each, under one identity and one log.
| Traffic | Protocol | What the gateway checks | What goes wrong without it |
|---|---|---|---|
| Agent to model | OpenAI, Anthropic, or another provider API | Model allowlist, token budget, rate limit | A loop that never ends bills until someone notices |
| Agent to tool | MCP over stdio or HTTP, or a REST API exposed as tools | Which tools this caller sees, which run without approval | The agent can reach every tool the server exposes |
| Agent to agent | A2A over JSON-RPC, REST, or gRPC | Which agents this caller may reach, and with what credentials | Any agent can call any other, and nobody knows who asked |
The three lanes share one requirement that makes them a single product rather than three proxies: the identity of the original caller has to survive every hop. A support agent acting for Dana should reach the tools Dana may use and spend against Dana's team budget, whether it calls a model directly or hands half the job to a research agent that then calls its own tools.
The A2A project's enterprise guide asks for the same things at the protocol level: authenticate every request, grant only the permissions an operation needs, trace each call with propagated context, and put API management in front of externally exposed agents. An agent gateway is where those rules are enforced once instead of in every agent.
Identity: who the agent is acting for
An agent gateway has to carry two identities on every request: the agent's own, and the user or system the agent is working for. Most gateways authenticate the first one easily. The second is what keeps a tool call or a delegated task attributed to a person and limited to that person's permissions.
The failure this prevents has a name. The OWASP Top 10 for Agentic Applications lists Identity and Privilege Abuse as ASI03: an agent reuses credentials or inherited trust to do something its user could not. A shared service-account key on an agent is the common cause, because every request then looks like the agent and none look like the user.
Gateways solve it in one of two ways:
- Forward the caller's credential. The gateway passes the caller's key or token to the agent, and the agent reuses it on its own model and tool calls. Bifrost does this when Forward Bifrost authentication is enabled on a registered agent.
- Assert the caller in headers. The gateway authenticates the caller and sends the resolved identity downstream. LiteLLM forwards
X-LiteLLM-User-IdandX-LiteLLM-Team-Idto the agent backend, and its docs warn that these headers cannot expand the agent's own permissions.
Both depend on the agent cooperating. A gateway can authenticate the hop it sees, but if the agent drops the forwarded credential and calls the next service with its own key, attribution ends there. Test this explicitly: run one task as a low-privilege user and confirm that every downstream log row shows that user, not the agent.
Tool allowlists: what each agent can reach
A tool allowlist decides which MCP tools each caller can see and call. It belongs in the gateway because an MCP server lists every tool it has to every client, and a model given forty tools will eventually call one it should not. The allowlist should deny by default and only ever narrow.
Bifrost shows the shape a good allowlist takes. Its tool filtering intersects three sets: the tools configured on the MCP client, the tools allowed on the caller's virtual key, and any narrower list sent in request headers. A header can remove tools for one request but cannot add any, and a virtual key with no MCP configuration sees no tools except those on clients marked Allow by Default. agentgateway writes the same rule as CEL expressions over MCP method calls, so a rule can match on a JWT claim and a tool name together.
The second half of the allowlist is execution. Seeing a tool and running it unattended are different permissions. Bifrost returns tool calls to the application for approval by default, and its Agent Mode runs only the tools listed in tools_to_auto_execute, which must be a subset of the tools the model may call. Keep tools that write, send, or delete off the auto-execute list.
Authentication to the MCP servers themselves, tool poisoning, and token handling are covered in what an MCP gateway does and MCP security. The agent gateway's job is to apply those controls with the same identity it uses on the model and agent lanes.
Agent-to-agent calls: registration and grants
For agent-to-agent traffic, the gateway keeps a catalog of registered agents and a grant per agent saying which callers may reach it. Callers discover an agent through the gateway's copy of its agent card, which is rewritten so that every endpoint in it points back at the gateway.
The rewrite is what keeps the gateway in the path. An A2A agent card lists the agent's endpoints and authentication requirements. If a client reads the original card, it learns the agent's real address and can call it directly. Bifrost, Kong, and Azure API Management all rewrite it. Bifrost fetches the live card on each request and rewrites endpoints and auth requirements, Kong rewrites the url field and any additionalInterfaces URLs, and Azure API Management replaces the hostname and adds its subscription-key requirement. How the A2A flow itself works is in the A2A protocol explainer.
Grants should be per agent and should not chain. In Bifrost, a virtual key granted the library-research agent can call that agent's routes and no other. That grant does not authorize the research agent's own model or tool calls, which need their own permissions. LiteLLM resolves agent access as the intersection of the key's list and the team's list, so the most restrictive side wins.
A grant controls who may call an agent. It does not make the agent's answer trustworthy. A remote agent's output is untrusted text, and the agent that receives it should treat it the way it treats a tool result.
Budgets for a loop, not a request
An agent's spend is set by how many times its loop runs, not by one request. A per-request token limit does not stop an agent that makes three hundred small calls, so an agent gateway needs budgets per key, team, or project over a period, plus a cap on loop depth.
The budget mechanics come from the LLM gateway: virtual keys with a spending limit and a reset period, enforced before the request reaches a provider. Bifrost answers an exhausted budget with 402 and budget_exceeded, and agentgateway sets per-key budgets in dollars or in tokens, with a list of models each key may reach.
What the agent setting adds is attribution across hops. When a support agent delegates to a research agent, the research agent's model calls should be charged to the original caller's budget, which only happens if the caller's credential was forwarded. Otherwise the research agent's own key pays for everyone and the budget stops meaning anything.
Depth is the other control. Bifrost's max_agent_depth, default 10 and settable from 1 to 50, caps how many model round trips with tool calls one request may run in Agent Mode before the gateway returns what it has. The agent loop explains why loops run long and where to stop them.
Audit: one session across three logs
An agent gateway's log should answer "what happened in this task" across all three lanes, not three separate questions. That requires a shared ID: every model call, tool call, and agent call made for one task carries the same session or task identifier, and the gateway joins them on it.
A2A already supplies the IDs. Each task has a task ID, and related tasks share a context ID. Bifrost groups Agent Logs into sessions by context ID and shows the LLM and MCP calls from the same session next to each operation. The join depends on the agent: it must send x-bf-session-id with the context ID and x-bf-agent-correlation-id with the task ID on its own model and tool requests, because the gateway cannot infer which task a separate model call belongs to.
Kong records the A2A side as OpenTelemetry spans with task state, context ID, time to first byte, and SSE event counts, and Azure API Management adds genai.agent.id and genai.agent.name to traces when Application Insights is on. Either way, test the join: run one delegated task and confirm the model and tool calls appear under its ID.
Decide what content to store first. Agent payloads include user messages, tool arguments, and artifacts. Bifrost leaves raw HTTP capture off by default and caps it at 1 MiB in each direction, and Kong's log_payloads setting warns that it may expose sensitive data.
Agent gateway vs LLM gateway vs API gateway
An API gateway routes HTTP and counts requests. An LLM gateway understands model calls: it counts tokens, prices them, and fails over between providers. An agent gateway adds the two protocols agents use beyond model calls, MCP and A2A, and keeps one caller identity across all three.
| Capability | API gateway | LLM gateway | Agent gateway |
|---|---|---|---|
| Unit it limits | Requests | Requests and tokens | Requests, tokens, and loop depth |
| Knows the model and its price | No | Yes | Yes |
| Understands MCP tool calls | No | Sometimes, as an add-on | Yes, with per-caller tool allowlists |
| Understands A2A tasks | No | No | Yes, with agent cards and task IDs |
| Identity across hops | One caller per request | One caller per request | Caller kept through delegation |
| Log unit | Request | Request | Session or task |
The categories overlap more each release. Kong added A2A to its AI Gateway, Azure API Management imports A2A agents beside model APIs and MCP servers, and LiteLLM's proxy has an A2A gateway. In practice "agent gateway" names a gateway that covers all three lanes, and the question to ask a product is how much of each lane it actually enforces.
Agent gateway options, ranked
The ranking below is for a team that wants one self-hosted gateway for model, tool, and agent traffic. Each entry was checked against the vendor's own docs in November 2026.
| Rank | Gateway | Type | A2A | MCP | Best for |
|---|---|---|---|---|---|
| 1 | Bifrost | Open source core (Apache 2.0), self-hosted | JSON-RPC, REST, gRPC; per-agent grants | Tool filtering by intersection, approval by default | One gateway and one identity for all three lanes |
| 2 | agentgateway | Open source (Apache 2.0), Linux Foundation | Yes | CEL authorization on MCP methods | Kubernetes and Gateway API shops |
| 3 | Kong AI Gateway | Commercial, on Kong Gateway | AI A2A Proxy plugin, Enterprise, 3.14+ | AI MCP Proxy plugin | Teams already running Kong |
| 4 | LiteLLM | Open source proxy | /a2a/{agent_id} with key and team permissions | Yes | Teams already on the LiteLLM proxy |
| 5 | Azure API Management | Managed Azure service | JSON-RPC only | Yes | Azure-first organizations |
1. Bifrost
Bifrost, an open-source AI gateway by Maxim AI, is the one this article would pick by default. It runs the LLM, MCP, and agent lanes in one binary under one set of virtual keys, which is what makes caller identity and budgets carry across hops.
As an agent gateway, it registers an existing A2A agent from its card URL, serves it at /agents/a2a/<agent-name>/, and lets client and agent use different transports, for example JSON-RPC in and gRPC out. The reasons it leads:
- Grants are per agent and do not chain, so a delegated agent's model and tool calls are checked again.
- Tool filtering narrows by intersection and denies by default, and tool calls are not executed unless listed for auto-execution.
- Agent Logs join a session's operations with its model and MCP calls by context ID.
- Enterprise adds agent grants through access profiles and projects, user attribution, and identity from an existing provider over OIDC and SCIM.
The same governance reaches past servers. Bifrost Edge, which requires the Enterprise gateway, routes AI traffic on employee machines through the gateway and applies MCP server allow and deny decisions on each device. Pricing follows a simple model: the open-source core is free, Enterprise is custom-priced, and Edge is priced per device.
Plan around two limits. A2A is the only agent protocol Bifrost supports as of November 2026, and the session join works only for agents that send the two correlation headers.
Best for: platform teams that want model, tool, and agent traffic governed under one identity in their own infrastructure, including regulated environments.
2. agentgateway
agentgateway is the open-source project many people searching "agentgateway" are looking for. It is written in Rust, licensed Apache 2.0, was donated to the Linux Foundation in 2025, and was accepted into the Agentic AI Foundation in 2026. Its docs describe one data plane for HTTP, gRPC, LLM, MCP, and A2A traffic.
Policy is CEL throughout: authorization rules match JWT claims against MCP methods and tool names, and per-key budgets in dollars or tokens cover the model lane. It runs as a standalone binary, in Docker, or on Kubernetes as a Gateway API implementation.
Best for: teams on Kubernetes that want an open-source gateway expressed as Gateway API resources and CEL policy.
3. Kong AI Gateway
Kong AI Gateway handles A2A traffic as an AI Agent entity with AI Policies attached for authentication, access control, and observability. The AI A2A Proxy plugin needs Kong Gateway 3.14 or later and the AI Gateway Enterprise license. It detects A2A requests over JSON-RPC and REST, extracts task metadata, and rewrites agent cards. MCP goes through the separate AI MCP Proxy plugin.
The plugin is a transparent proxy that does not change routing or manage task state. Authentication is configured separately, through an AI Auth Strategy on the AI Agent entity in the newer model.
Best for: organizations that already run Kong for their APIs and want agent traffic under the same control plane.
4. LiteLLM
LiteLLM's proxy exposes registered agents at POST /a2a/{agent_id} and lists only the agents a key may reach at GET /v1/agents. Agent permissions are set per key and per team and resolve as their intersection, and the proxy forwards the caller's user and team IDs to the agent.
Its default is open: a key with no agent restrictions reaches every agent unless agent_access_default_deny is turned on.
Best for: teams already running the LiteLLM proxy for model traffic that want agents behind the same keys.
5. Azure API Management
Azure API Management imports an A2A agent from its card URL and governs it with the same XML policies as any other API, next to model APIs and MCP servers. It rewrites the agent card to its own hostname and subscription-key requirement.
The limits are specific: only JSON-RPC A2A agents are supported, the rewritten card drops other transports, and access is controlled through APIM subscription keys and policies.
Best for: organizations that already publish APIs through Azure API Management.
When you need an agent gateway, and what it costs
You need an agent gateway when agents start calling each other across teams, or when someone has to answer who an agent was acting for. One agent with a fixed tool list and one model needs an LLM gateway at most.
Signals that the time has come:
- Agents from different teams call each other, or will.
- Agents act for end users whose permissions differ.
- Security wants one allowlist of approved agents and tools, and one log of what each did.
- Finance wants agent spend charged to the team that started the task.
The costs are concrete. Every hop adds a network round trip, and a delegated task adds several. The gateway becomes a dependency for every agent, so run at least two instances. The session join requires agents to send correlation headers and forward credentials, which is code in every agent. And protocols are still moving: check that the gateway speaks the A2A version and MCP revision your agents use before upgrading either side.
Frequently asked questions
What is an agent gateway?
An agent gateway is a proxy between AI agents and the models, tools, and other agents they call. It authenticates the agent and the user it acts for, enforces model and tool allowlists, budgets, and per-agent grants, and logs every hop under a shared session ID. It extends an LLM gateway with the MCP and A2A protocols.
What is agentgateway?
agentgateway is an open-source gateway, written in Rust and licensed Apache 2.0, that proxies HTTP, gRPC, LLM, MCP, and A2A traffic in one data plane. It was donated to the Linux Foundation in 2025 and accepted into the Agentic AI Foundation in 2026. Policies are written as CEL expressions, and it runs standalone or on Kubernetes through the Gateway API.
What is the difference between an agent gateway and an LLM gateway?
An LLM gateway routes, prices, and limits model calls. An agent gateway does that and also governs an agent's tool calls over MCP and its calls to other agents over A2A. It keeps the original caller's identity across those hops and logs by session or task instead of by request.
Is there an open source agent gateway?
Yes. Bifrost's core is open source under Apache 2.0 and covers model, MCP, and A2A traffic, with Enterprise features on top. agentgateway is an Apache 2.0 Linux Foundation project, and the LiteLLM proxy includes an A2A gateway. Kong's A2A plugin and Azure API Management are commercial.
Does an agent gateway replace an MCP gateway?
It includes one. An agent gateway's tool lane is an MCP gateway: it authenticates to MCP servers, filters which tools each caller sees, and logs tool calls. The difference is that the agent gateway applies the same identity and budget to the model and agent lanes, so one task's tool calls and agent calls are governed together.
Do agents have to use A2A to go through an agent gateway?
Only for the agent-to-agent lane. Model calls use the provider's API and tool calls use MCP, and both can pass through the gateway without A2A. An agent that calls other agents over a custom HTTP API can sit behind any gateway as an ordinary route, but it loses agent card rewriting and task-level logs.
Sources
- 01Agent Gateway overviewBifrost docs
- 02Register an agentBifrost docs
- 03Agent accessBifrost docs
- 04Agent LogsBifrost docs
- 05Tool filteringBifrost docs
- 06Agent ModeBifrost docs
- 07Introductionagentgateway docs
- 08MCP authorizationagentgateway docs
- 09Per-key dollar or token budgetsagentgateway docs
- 10A2A traffic in AI GatewayKong docs
- 11AI A2A Proxy pluginKong docs
- 12Agent Gateway (A2A protocol)LiteLLM docs
- 13Agent permission managementLiteLLM docs
- 14Agent access managementLiteLLM docs
- 15Import an A2A agent APIMicrosoft Learn
- 16Enterprise implementation of A2AA2A Protocol
- 17OWASP Top 10 for Agentic ApplicationsOWASP GenAI Security Project