Skip to content

All posts

AIKyverno

How to Govern MCP and LLM Traffic with Agent Router and Kyverno Authz

Jim Bugwadia

AI: How to Govern MCP and LLM Traffic with Agent Router and Kyverno Authz

To govern AI agent traffic, route every model and MCP tool call through one gateway, then check each request against policy with live context. In this KyvernoCon talk, Agent Router (formerly Envoy AI Gateway) routes the traffic, Kyverno Authz decides using the caller’s current Kubernetes permissions, and Envoy enforces the decision.

Deepak Goel, CTO for Cloud Native at Nutanix, and Jim Bugwadia, Kyverno maintainer and Nirmata’s CEO, closed KyvernoCon at KubeCon + CloudNativeCon North America 2026 with this session, “Integrating Envoy AI Gateway and Kyverno Authz for Realtime Governance of LLM and MCP Traffic”. This post covers the architecture, when the gateway’s built-in checks are enough, the live demo, and what the integration does and doesn’t prove.

Why do agents need a router?

Without a shared router, every agent carries its own provider SDKs and request formats, its own credentials, its own retry and fallback logic, and a separate integration for each MCP server. That’s a lot of platform plumbing inside every application.

With a router, the agent owns the reasoning and the platform owns the traffic:

Without a shared router With Agent Router
Provider SDKs and formats in each agent A familiar model API and one MCP endpoint
Credentials in applications Platform-managed credentials
Retry and fallback logic in code Declarative routes and failover
A separate integration per MCP server Central limits and telemetry

This framing comes from Ignasi Barrera’s talk “Your Agents Need a Router”.

What Agent Router does

Agent Router is open source, built on Envoy and Envoy Gateway, and now hosted by the Agentic AI Foundation. It was formerly Envoy AI Gateway, and its CRDs, such as AIGatewayRoute and MCPRoute, still use the aigateway.envoyproxy.io API group.

Agent Router declares intent: logical model names mapped to providers, MCP server aggregation, routes and backend credentials, and quotas with usage attribution. Envoy carries the traffic: routing and retries, authentication and rate limits, circuit breaking and telemetry, and the policy hooks where Kyverno plugs in.

Agents get one contract for both:

Models Tools
Endpoint POST /v1/chat/completions POST /mcp
What the agent does Uses an OpenAI-compatible client and asks for a logical model name Connects to one MCP endpoint
What the router does Maps the name to a provider model; provider keys stay behind the router Aggregates multiple MCP servers and selects the tools exposed per route

Where Kyverno Authz fits

The short version from the talk: Agent Router routes, Kyverno Authz decides, Envoy enforces.

Kyverno Authz runs Kyverno’s CEL policies as an external authorization service for Envoy. After Envoy’s built-in JWT authentication, each request goes to Kyverno Authz before it reaches the model or MCP backend.

Stage How it plugs in Status What it does
Request authorization Envoy ext_authz Released Allows or denies before the backend runs. Reads MCP JSON-RPC and model request bodies, calls a Kubernetes SubjectAccessReview, and injects verified identity headers such as x-tenant-id.
Response governance Envoy ext_proc Prototype in the demo Inspects and rewrites response bodies, for example filtering the MCP tools/list per user. Execution authorization stays in ext_authz.

The response stage was built for the demo and is not a released Kyverno Authz feature. Filtering the tool list is a convenience for the agent, not a security boundary: the check on each tools/call request is what stops a hidden tool from running.

Native checks or Kyverno Authz?

Agent Router already has JWT authentication, static MCP tool selection, quotas, limits and access telemetry, and experimental CEL allow and deny rules on MCPRoute. The talk’s advice was to use the simplest control that meets the requirement, and to add Kyverno Authz where the built-in checks stop.

Requirement Agent Router and Envoy built-ins Kyverno Authz
Per-user tool and argument checks Yes, with MCPRoute CEL (experimental) The same versioned, unit-tested policy language for tools, models and the platform
Live Kubernetes RBAC No external lookups A SubjectAccessReview on every relevant request
Per-user tool discovery Filters tools/list using native authorization rules ext_proc filters tools/list using live Kubernetes RBAC (prototype)
Model request governance No CEL on AIGatewayRoute Body checks and a verified x-tenant-id header
Incident-scoped exceptions No exception lifecycle PolicyException with a governed TTL and request-time expiry
Policy decision audit Access logs only OpenReports results named by the deciding policy

Native MCPRoute CEL can inspect claims, tools and arguments. Its limits are the inputs it can see and its contract: it is experimental, allows at most 32 rules of 4,096 characters, sees request inputs only, and denies tool calls on runtime evaluation errors. These were checked against the demo’s Agent Router version, v1.2.0.

The use case: recover checkout safely

The demo modeled an operations agent with two teams, five tools and one deployment. Alice owns checkout in team-a-dev, and Bob owns checkout in team-b-dev. The aggregated MCP server exposes get_workload_status, get_events, get_logs, get_runbook and scale_deployment, limited to 1–3 replicas.

Policy has to answer four questions:

  1. Can this user act right now?
  2. Should this tool be discoverable?
  3. Is this model request acceptable?
  4. Is break-glass access scoped?

The demo used real Keycloak tokens, MCP sessions, SubjectAccessReview requests and deployment updates on a local kind cluster. The model backend was deterministic and OpenAI-compatible, so the demo tested the governance path, not LLM reasoning, provider spend or agent autonomy.

The live demo: same token, different live permissions

Alice’s agent holds one JWT and one MCP session to /mcp. A RoleBinding, alice-scale, lets her scale checkout in her namespace, and Bob has the same tools in his. Kyverno Authz runs a live SubjectAccessReview on both tools/list and tools/call.

  1. Revoke the RoleBinding. Alice’s tool list drops from five tools to four, and scale_deployment disappears.
  2. Alice’s agent calls scale anyway. The request gets an HTTP 403 before it reaches the backend. Bob is unaffected.
  3. Restore the RoleBinding. With the same token and the same session, the scale tool is back and the call succeeds.

No token was reissued and no gateway config changed. The decision followed Alice’s current Kubernetes permissions. The full suite of seven scenarios, including model request checks and scoped break-glass exceptions, passed 62 checks with 0 failures in an October 19, 2026 run.

Reference architecture

Layer Components
Agent or client A Keycloak JWT, calling /v1 and /mcp
Agent Router and Envoy JWT authentication, then ext_authz, then ext_proc. Routing and MCP aggregation: AIGatewayRoute to the model backend, MCPRoute to the Kubernetes tools and runbooks.
Kyverno Authz Policies and the exception loaded from files; a live SubjectAccessReview against the Kubernetes API; OpenReports decision results; allow, deny or rewrite
Kyverno admission and cleanup Rejects unsafe MCPRoute and AIGatewayRoute specs, and governs the exception’s TTL

The same engine does two jobs here: Kyverno Authz decides on live traffic, and Kyverno admission policies keep the gateway’s own configuration safe.

Limits and what’s next

This is a complementary stack, not a replacement gateway. Agent Router keeps one integration for models and tools, keeps secrets behind the router and handles routing and capacity. Kyverno Authz adds authorization with live external state, request and response governance, reusable CEL policies, exceptions and decision reports.

The talk was clear about what the demo doesn’t cover. Request authorization through ext_authz is released; response filtering through ext_proc is a prototype. Token ceilings in the demo are per-request guardrails, not spend accounting. The directions named for next steps, not commitments, were an upstream fix so externally evaluated policies skip self-validation, live exceptions sourced from Kubernetes, and decision reports for ext_proc.

Applying the pattern

For the policy model behind this, read tool-level authorization for AI agents and our MCP security checklist for enterprises. If you’re deciding where a gateway sits, see deploying an AI gateway in front of or behind your existing API gateway. For the rest of KyvernoCon, see our KubeCon + CloudNativeCon North America 2026 recap. To apply the same controls to agents across your organization, see Nirmata AIControls.

Frequently asked questions

What is Agent Router?

Agent Router, formerly Envoy AI Gateway, is an open source AI gateway built on Envoy and Envoy Gateway and hosted by the Agentic AI Foundation. It gives agents an OpenAI-compatible API for models and one MCP endpoint for tools, keeps provider credentials behind the router, and handles routing, failover, limits and telemetry. Its CRDs still use the aigateway.envoyproxy.io API group.

What does Kyverno Authz add to an AI gateway?

Kyverno Authz runs Kyverno CEL policies as an Envoy external authorization service. It allows or denies each model or MCP request before the backend runs, can read JSON-RPC and model request bodies, and can call the Kubernetes API, for example a SubjectAccessReview to check a user's current permissions. It also brings policy exceptions and decision reports.

Can't Agent Router's own MCPRoute CEL rules do this?

For simple per-user tool and argument checks, yes, and you should use the simplest control that works. Native MCPRoute CEL is experimental, limited to 32 rules of 4,096 characters, sees only request inputs and returns allow or deny. It can't look up live Kubernetes RBAC, change a response, govern model requests or manage exceptions.

Is filtering the MCP tools list a security boundary?

No. Hiding a tool from tools/list improves the user experience, because the agent only sees tools it can use. The authorization boundary is the check on each tools/call request, which still denies a hidden tool if the agent calls it anyway.

Jim Bugwadia, Founder & CEO, Nirmata

Jim Bugwadia is the founder and CEO of Nirmata, the creators of Kyverno. He is an active cloud-native community member who previously held engineering and leadership roles at Cisco, Bell Labs, and Motorola.

LinkedIn

Govern AI agents with AIControlsControl what AI agents do, and prove it.
Share

Stay up-to-date with the latest in AI, governance, and infrastructure

Subscribe to our free monthly newsletter to get industry news, DevOps tips, and articles right to your inbox on Kyverno, containerization, Kubernetes deployment & management and more.