AI AI Pulse

Envoy gets token quotas: the proxy becomes a budget layer

AI News Source: SecurityBrief

Google Cloud gave Envoy token quotas per minute and per day, HTTP 429 before inference, and request translation across OpenAI, Anthropic and Gemini.

What changed

On November 23 and 24, Google Cloud published a set of extensions to Envoy, aimed at letting the open-source Layer 7 proxy govern autonomous agent traffic. Envoy started at Lyft and is a graduated CNCF project. Google Cloud uses it in its application load balancers and in the Agent Substrate data plane on GKE.

The work covers four areas: request-body parsing with model format translation, token-based traffic quotas, model and MCP tool routing, and security checks.

Google Cloud gives two reasons. Traditional Layer 7 proxies read URLs and methods, but key policy data for agents often sits inside the request body. And agent workloads are better measured in tokens than in request counts.

How the quotas work

The second area is the most practical. Envoy can set tokens-per-minute and tokens-per-day quotas per tenant, project or model. When a request arrives, it estimates input tokens before inference, compares that with the quota record, and returns HTTP 429 if the limit is exceeded. The request never reaches the inference cluster.

The proxy also tracks cumulative token use and message counts. The second measure targets runaway agent loops: a chain of tool calls can keep request counts low while the bill explodes.

Separately, Envoy can parse JSON bodies, identify the target model and convert between OpenAI, Anthropic and Gemini schemas. It can parse server-sent event streams in real time and count the tokens actually returned. That matters most when switching providers or moving to a self-hosted model, because application code does not need rewriting.

Routing and security

There are three routing behaviours. Prompts that share the same system instructions go to GPU workers that already hold the matching cache in memory, to cut latency. If a primary model fails or returns 429, the proxy retries or redirects to a secondary pool without client changes. For MCP traffic, routing can use JSON-RPC 2.0 bodies and the Mcp-Method and Mcp-Name headers, and the backend rejects requests whose declared tool does not match.

On security, Envoy connects through external processing interfaces to Model Armor, ShieldGemma or local classifiers, and inspects prompts and tool calls for injection and data leakage. Where agents run in isolated runtimes, Envoy acts as both ingress and egress gateway and restricts outbound domains.

One detail covers resuming suspended work. When a paused agent instance wakes up, Envoy can buffer the first packet and forward it after the instance resumes.

What to discount

First, Google published no performance numbers and no third-party validation. Cache-aware routing is described only as reducing latency, with no benchmark.

Second, the four areas are not one switch. Blocking a tool call requires an active policy engine, a connected authorisation extension, and path matching that covers every route an agent uses: Gemini generateContent, Anthropic's /v1/messages, rawPredict for platform-hosted Claude, and OpenAI-compatible /chat/completions.

Third, Google's own documentation says semantic governance action checks do not cover streaming. Requests to streamGenerateContent, streamRawPredict or with stream set to true fall outside the documented coverage, and the guidance is to configure agents without streaming. A tool call inside a streamed response may not be blocked.

Fourth, configuration is real work. Routing uses contains() matching, gRPC traffic must be excluded, and failOpen plus the policy profile must be set explicitly. A wrong configuration is harder to diagnose than no configuration.

Who should care

Teams already running Envoy or a gateway built on it get a cheap upgrade path. Treat tokens as a first-class metric and enforce budgets at the proxy, instead of writing a separate limiter in every application.

Teams without a gateway should settle one question first. Agent cost overruns usually come from loops, not from model prices.

Nothing here is investment advice.

Source: SecurityBrief

Related