LLM Gateway
Self Host

Post-Quantum Cryptography

Which parts of a self-hosted LLM Gateway deployment are protected against a future quantum computer, and how to turn on the rest.

Traffic recorded today can be decrypted once a large quantum computer exists, unless the TLS key exchange that protected it was post-quantum. LLM Gateway uses the hybrid X25519MLKEM768 key exchange wherever the other side supports it, and its stored secrets and signed tokens use algorithms that stay safe.

What is covered

PathProtectionAction needed
Gateway to providersX25519MLKEM768 when the provider supports itNone; optionally refuse other providers
Clients to your gateway, API and dashboardsSet by the proxy or load balancer in front of themCheck your hosts
Gateway, API and worker to Redis and PostgresA private network that nothing outside your deployment reachesKeep both off the public internet; see Redis and Postgres
Stored provider keys, connector and MCP OAuth secretsAES-256-GCMNone
API key hashes and HMAC-signed tokensHMAC-SHA256None
Enterprise licensesEd25519 and ML-DSA-65, both required, for licenses issued from December 2026Replace an older license before 1 January 2028

The official images run Node.js 24 with OpenSSL 3.5, which offers X25519MLKEM768 first on every outgoing TLS connection. A custom image built on an older Node.js loses it.

Two parts cannot be post-quantum yet. Google signs service-account tokens and Cloud Storage URLs with RSA and accepts nothing else, and public TLS certificates are still RSA or ECDSA. Both prove identity at connection time and cannot be used to decrypt recorded traffic.

Enterprise licenses

A license issued before December 2026 carries only an Ed25519 signature, which a quantum computer could forge. Those licenses keep verifying until 1 January 2028 and report invalid from then on, whatever their expiry date. Ask sales for a replacement before that date; it carries both signatures and needs an image from December 2026 or later. See Enterprise Licensing.

Refuse providers without it

By default a provider without a post-quantum key exchange is still reached over a classical one. To offer only hybrid ML-KEM key exchanges, set this on the gateway and the worker:

UPSTREAM_TLS_POST_QUANTUM_ONLY=true

With the Helm chart, which passes it to every service:

gateway:
  config:
    upstreamTlsPostQuantumOnly: true

The TLS handshake with a provider that lacks one then fails like a network error, and routing falls back to a provider that supports it. A request pinned to such a provider, or sent with x-no-fallback: true, fails. Which providers support it changes over time; the check below prints the current status of each provider's default endpoint.

The setting is not limited to provider requests. In the gateway and the worker it applies to every outgoing HTTPS request made with fetch, and to the gateway's realtime WebSocket connections:

  • provider requests, including realtime sessions, custom providers, your own provider base URLs, and the worker's polling of long-running jobs
  • downloads of image, document and video URLs sent in requests
  • webhook and data stream deliveries to your endpoints
  • other services those processes reach with fetch, such as analytics

It does not cover clients that open their own connections instead of using fetch. None of them carries prompts to a provider:

  • the worker's Stripe client, which sends billing data
  • the Google Cloud Storage client, which stores and signs URLs for generated videos, and the Google Cloud Trace exporter
  • the Redis and Postgres connections

Check the hosts you depend on before turning it on. The API service does not send prompts to providers and keeps the default behavior for its own requests, except for the URLs it fetches on a user's behalf.

Check your hosts

The repository includes a check that connects to each host offering only post-quantum key exchanges. It exits with an error when one of your hosts refuses, and prints the status of every provider's default endpoint:

PQ_TLS_HOSTS=gateway.example.com,api.example.com node scripts/check-post-quantum-tls.mjs

It needs Node.js 24 or later. Google Cloud's Application Load Balancer negotiates X25519MLKEM768 with its default TLS policy. For a proxy you run yourself, use a build on OpenSSL 3.5 or later and keep TLS 1.3 enabled.

Redis and Postgres

Run Redis and Postgres on a private network that only your services reach, as the Helm chart and Docker Compose files do. Traffic that never crosses a network you do not control cannot be recorded in transit, so LLM Gateway connects to Redis without TLS.

If Postgres has to cross a network you do not control, turn on TLS in the connection string, for example DATABASE_URL=postgres://…?sslmode=verify-full. Postgres 18 does not offer a post-quantum key exchange by default, even on OpenSSL 3.5: its ssl_groups setting defaults to X25519:prime256v1. Add the hybrid group on the server:

# postgresql.conf
ssl_groups = 'X25519MLKEM768:X25519:prime256v1'

Managed Postgres services choose this setting themselves; check with your provider whether it can be changed.

How is this guide?

Last updated on

On this page

Ready for production?

Ship to production with SSO, audit logs, spend controls, and guardrails your security team will approve.

Explore Enterprise