Governing Enterprise AI Traffic at Scale: Design and Operation of a Policy-Driven, Multi-Vendor LLM Gateway on Envoy
Mithun SasidharanSrinivasan ManoharanRupesh ThakurAbhinav TKAshwin HegdeAnand Gautam
Mithun Sasidharan
Srinivasan Manoharan
Rupesh Thakur
Abhinav TK
Ashwin Hegde
Anand Gautam
+6
This paper presents the design and production operation of the Cosmos LLM Gateway at PayPal, a policy-driven, multi-vendor gateway built on Envoy that serves as the governed entry point for enterprise LLM traffic. Its central contribution is a latency-aware architecture that splits work: I/O-bound control decisions (authentication, credential brokering, policy and budget evaluation) run in an out-of-process external-processing service, while wire-format translation, token metering and prompt-cache shaping run in-proxy as a Rust WebAssembly filter, so streamed response body chunks never wait on out-of-process calls. Declarative governance uses Open Policy Agent with role-scoped authoring, approvals, pilots, shadow-mode rollout and versioned policy bundles. As of September 2026, it serves over 12,000 developers and hundreds of use cases, handling about 200 billion tokens per day across more than 100 models, with 99.999% availability and a benchmark adding a median of 4 ms and p99 of 11 ms overhead at over 2,200 requests per second.

arXiv ·
· October 26, 2026