Post-Quantum Encryption: How We Moved LLM Gateway
Prompts recorded on the wire today can be decrypted once a large quantum computer exists. Here is how we moved LLM Gateway to post-quantum encryption: hybrid ML-KEM key exchange on every hosted endpoint and on 24 of 31 provider endpoints, dual-signed licenses, a required check for Airside carriers, and a daily job that fails if any of it regresses.
By LLM Gateway

Encrypted traffic has a shelf life. An attacker who records a TLS session today cannot read it, but can keep it. Once a large quantum computer exists, the classical key exchange that protected that session can be broken and everything inside it read. This is called harvest now, decrypt later, and it means the deadline for post-quantum encryption is not the day the quantum computer ships. It is the day the traffic is sent.
An LLM gateway is a good target for that kind of patience. Prompts carry source code, contracts, medical notes and customer records, and they all pass through one place on the way to a model provider. So this week we moved LLM Gateway to post-quantum encryption on every path we control, and added checks that keep it there. This post covers what changed, what did not need to, and what cannot be post-quantum yet.
What post-quantum encryption means for a gateway
A request crosses two network hops: from your application to the gateway, and from the gateway to the model provider. On both, TLS does two separate jobs.
- Key exchange agrees on the session key. This is what harvest now, decrypt later attacks. If it is classical (X25519, P-256), recorded traffic can be decrypted later.
- Authentication proves who the server is, with a certificate signature. A quantum computer could forge it, but only at connection time. It cannot be used to decrypt a recording.
The fix for the first job is X25519MLKEM768: a hybrid key exchange that runs classical X25519 and ML-KEM-768 together and derives the session key from both. ML-KEM is the lattice-based mechanism NIST standardized as FIPS 203 in August 2024. Hybrid matters because ML-KEM is young. If a flaw is found in it, the session is still as strong as X25519. If a quantum computer arrives, it is still as strong as ML-KEM. An attacker has to break both.
Where we stand today
| Path | Protection | Status |
|---|---|---|
| Clients to the hosted gateway, API and apps | X25519MLKEM768 on TLS 1.3 | 7 of 7 hostnames, checked daily |
| Gateway to model providers | X25519MLKEM768 offered first | Accepted by 24 of 31 default endpoints |
| Gateway to Airside carriers | X25519MLKEM768 required to list | Enforced at preflight |
| Stored provider keys and OAuth secrets | AES-256-GCM | Unchanged, already safe |
| API key hashes and signed tokens | HMAC-SHA256 | Unchanged, already safe |
| Enterprise licenses | Ed25519 and ML-DSA-65, both required | New licenses from December 2026 |
| Redis and Postgres | Private network, nothing outside reaches it | No traffic to record |
| Public TLS certificates, Google-signed tokens | RSA or ECDSA | Not post-quantum yet, cannot decrypt a recording |
The numbers in the first two rows come from a script in our public repository, run on December 3, 2026. You can run it yourself; it is covered below.
Clients to the gateway
Our hosted endpoints sit behind Google Cloud's Application Load Balancer, which negotiates X25519MLKEM768 with its default TLS policy. Every hostname we serve does: llmgateway.io, api.llmgateway.io, internal.llmgateway.io, docs.llmgateway.io, devpass.llmgateway.io, lounge.llmgateway.io and airside.llmgateway.io.
Whether your requests use it depends on your client. Current Chrome, Firefox and Safari offer the hybrid group. So does Node.js 24, and anything else built on OpenSSL 3.5 or later. You do not change any code:
1curl https://api.llmgateway.io/v1/chat/completions \2 -H "Authorization: Bearer $LLM_GATEWAY_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{"model":"gpt-5","messages":[{"role":"user","content":"hi"}]}'1curl https://api.llmgateway.io/v1/chat/completions \2 -H "Authorization: Bearer $LLM_GATEWAY_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{"model":"gpt-5","messages":[{"role":"user","content":"hi"}]}'To see what your own stack negotiates, ask OpenSSL 3.5 for the group:
1openssl s_client -connect api.llmgateway.io:443 -groups X25519MLKEM768 </dev/null 2>/dev/null \2 | grep "Negotiated TLS1.3 group"1openssl s_client -connect api.llmgateway.io:443 -groups X25519MLKEM768 </dev/null 2>/dev/null \2 | grep "Negotiated TLS1.3 group"Gateway to providers
This hop needed no new cryptography from us, only the right runtime. Our images run Node.js 24 with OpenSSL 3.5, which offers X25519MLKEM768 first on every outgoing TLS connection and falls back to a classical group only when the other side lacks it. A custom image built on an older Node.js loses it.
So the question becomes which providers accept it. We probed the default endpoint of every provider in our catalogue: 24 of 31 negotiated X25519MLKEM768, including OpenAI, Anthropic, Google AI Studio and Vertex AI, xAI, Mistral, DeepSeek, Groq, Cerebras, Together and Fireworks. Seven still answered with classical X25519. That list changes as providers upgrade their edge, so we report it instead of hardcoding it.
Refusing providers without it
By default a provider without a post-quantum key exchange is still reached over a classical one. Self-hosted deployments can turn that off on the gateway and the worker:
1UPSTREAM_TLS_POST_QUANTUM_ONLY=true1UPSTREAM_TLS_POST_QUANTUM_ONLY=trueWith it set, outgoing connections offer only hybrid ML-KEM groups (X25519MLKEM768, SecP256r1MLKEM768, SecP384r1MLKEM1024) on TLS 1.3. The handshake with a provider that lacks one 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.
The setting covers more than chat requests: realtime WebSocket sessions, custom providers and your own base URLs, the worker's polling of long-running video jobs, downloads of image and document URLs sent in requests, and webhook deliveries. It does not cover clients that open their own sockets, such as the Stripe and Google Cloud Storage SDKs. None of those carries a prompt to a provider.
Airside carriers must support it
Airside is the portal where inference providers list their own endpoints on LLM Gateway. Those endpoints serve prompts, so every carrier verification run now ends with a required post-quantum TLS check. It handshakes the endpoint the gateway will call, offering only hybrid ML-KEM groups on TLS 1.3, and fails unless one is negotiated.
A failed check blocks new listings, widened claims and relists. Daily verification reports it for listings already in service. For a new provider on the platform, post-quantum key exchange is an entry requirement, not a roadmap item.
Secrets at rest were already safe
Not everything had to move. Quantum computers break the asymmetric algorithms behind key exchange and signatures. Symmetric encryption and hashes are only weakened: the best known quantum attack halves the effective key length, which leaves 256-bit keys with a wide margin.
- Stored provider keys, connector secrets and MCP OAuth secrets are encrypted with AES-256-GCM.
- API keys are stored as HMAC-SHA256 fingerprints, and signed tokens use HMAC-SHA256.
Both stay as they are.
Enterprise licenses are dual-signed
Signatures were the other gap. Self-hosted Enterprise deployments verify a signed license token, and that signature was Ed25519, which a quantum computer could forge.
Licenses issued from December 2026 carry two signatures over the same content: Ed25519 and ML-DSA-65, the lattice signature NIST standardized as FIPS 204. Both must verify. The pinned public key decides the algorithm, never the token, so a dual-signed key cannot be downgraded to its Ed25519 half.
Older Ed25519-only licenses keep working through their expiry, but stop on 1 January 2028 if that comes first. A forged classical license stops being accepted on a fixed date, whatever expiry it claims. If your license runs past that date, ask sales for a replacement.
A daily check keeps it from regressing
A TLS policy is one load balancer setting away from silently falling back. So the repository has a check, scripts/check-post-quantum-tls.mjs, and a workflow that runs it every day at 06:45 UTC.
It connects to each of our hosts offering only hybrid groups. The job fails when a host answers a classical handshake but refuses a hybrid one on all three attempts. An unreachable host only warns, so a network blip does not page anyone. Provider endpoints are reported, not enforced, since their TLS configuration is theirs to change.
Run it against your own hosts with Node.js 24 or later:
1PQ_TLS_HOSTS=gateway.example.com,api.example.com node scripts/check-post-quantum-tls.mjs1PQ_TLS_HOSTS=gateway.example.com,api.example.com node scripts/check-post-quantum-tls.mjsWhat is not post-quantum yet
Three things, and we would rather list them than claim "quantum-safe":
- Certificates. Public TLS certificates are still RSA or ECDSA, ours included. This affects identity at connection time, not recorded traffic.
- Google-signed tokens. Google signs service-account tokens and Cloud Storage URLs with RSA and accepts nothing else.
- Seven provider endpoints. Traffic to a provider without a hybrid group uses a classical key exchange unless you refuse it with the setting above.
Redis and Postgres carry no TLS in our deployment by design. They run on a private network that only our services reach, so there is no traffic in transit to record. If your Postgres has to cross a network you do not control, note that Postgres 18 does not offer the hybrid group by default; the self-host guide has the ssl_groups line to add.
How to do the same in your stack
- Upgrade the runtime before writing any code. OpenSSL 3.5 and Node.js 24 offer
X25519MLKEM768by default. - Check what your edge negotiates. Most large CDNs and cloud load balancers support the hybrid group, but only on TLS 1.3.
- Leave AES-256 and HMAC-SHA256 alone. Spend the effort on key exchange first, then on long-lived signatures.
- Sign anything long-lived with two algorithms, and put an end date on the classical-only version.
- Write the check down as code and run it daily. A claim nobody tests decays.
The changes are in two public pull requests: post-quantum crypto and the Airside requirement.
Frequently asked questions
- What is post-quantum encryption?
- Post-quantum encryption uses algorithms that a large quantum computer is not known to break. For traffic in transit the important part is the TLS key exchange. LLM Gateway uses X25519MLKEM768, a hybrid that combines the classical X25519 exchange with ML-KEM-768, the key encapsulation mechanism NIST standardized as FIPS 203. An attacker has to break both to read the traffic.
- Is LLM Gateway post-quantum encrypted?
- Yes, for the key exchange on every path we control. All seven hosted LLM Gateway hostnames, including api.llmgateway.io, negotiate X25519MLKEM768 on TLS 1.3, and a daily check fails if one stops. The gateway offers the same group first on every connection to a model provider, and on December 3, 2026 it was accepted by 24 of the 31 default provider endpoints. Public TLS certificates are still RSA or ECDSA, as they are everywhere.
- What is a harvest now, decrypt later attack?
- An attacker records encrypted traffic today and stores it until a quantum computer can break the key exchange that protected it. The data is exposed in the future even though nothing was broken at the time. Prompts often hold source code, contracts and customer data that stay sensitive for years, which is why the key exchange has to be post-quantum now and not when the quantum computer arrives.
- Can I force LLM Gateway to use only post-quantum providers?
- On a self-hosted deployment, yes. Set UPSTREAMTLSPOSTQUANTUMONLY=true on the gateway and the worker. Outgoing connections then offer only hybrid ML-KEM groups on TLS 1.3, the handshake with a provider that lacks one fails like a network error, and routing falls back to a provider that supports it. The setting is off by default.
Models and providers in this post
Models
One API key for every model.
Route to 200+ models with automatic failover, caching, and real-time cost analytics. Free to start — no credit card required.
Not ready to switch yet?
Follow new model releases instead.
A short roundup when new models land. Unsubscribe anytime.