The NSA post-quantum advisory: what it means for AI API traffic
The short version
- On 2 December 2026 the NSA told the owners of US national security systems to move to post-quantum cryptography immediately. The reason it gave: AI companies disclosed new discoveries about the security of some cryptography.
- The NSA did not say which algorithms are affected. Filippo Valsorda, a cryptography engineer, read the advisory closely. His reading: 256-bit elliptic curves (P-256, X25519, Ed25519) are probably weaker than we thought.
- We tested the 23 API hosts that our gateway calls. 17 accept the hybrid post-quantum key exchange
X25519MLKEM768. 6 accept only classical X25519. - Our own gateway did not use it with any of them, because the server's TLS library was OpenSSL 3.0. We fixed that on 4 December: see what we changed. Many Python and Node apps on servers have the same problem. Below is the one-line check.
1. What the NSA said
The NSA published a Cybersecurity Advisory and a press release. The NSA, CISA and the White House Office of the National Cyber Director (ONCD) also published a joint statement. The advisory is for the owners, operators and vendors of National Security Systems. It tells them to "immediately accelerate" their move to post-quantum cryptography.
The reason is new. The joint statement says that US AI companies "have disclosed discoveries that impact the security of some cryptography". It does not name the companies, and it does not name the algorithms. It also says that these advances "do not present an immediate and widespread threat to that cryptography".
The advisory repeats an old warning, and that warning is the part that matters for most developers: "Adversaries are already collecting encrypted information to decrypt once the capabilities become available." This attack is called "harvest now, decrypt later". An attacker records your encrypted traffic today and decrypts it when a break becomes practical.
2. How Filippo Valsorda reads it
Filippo Valsorda maintained the Go cryptography libraries for years. He wrote "What to Make of the NSA Advisory" on the same day. Read his post: it is short and specific. His argument depends on what the advisory lists, and on what it does not list.
- The inventory list. The advisory asks owners to record algorithms that are not approved in CNSA 2.0 or CNSA 1.0. The list includes "elliptic curves other than P-384 or P-521" and EdDSA. Those words cover P-256 and Ed25519, the most common curves on the internet. X25519 uses the same curve as Ed25519. RSA is not on the list.
- The cause. No known quantum algorithm attacks only some elliptic curves. So he reads the disclosed discoveries as a classical attack, not a quantum computer.
- The fallback. For certificate roots, the advisory accepts RSA 3072 or P-384, and RSA 2048 "for legacy support". He reads RSA and P-384 as a temporary bridge, not a destination.
- Hybrids are now acceptable. The NSA did not like hybrid key exchange before. The advisory now points to an IETF RFC for it. In practice that means
X25519MLKEM768, which most browsers and CDNs already use.
His summary in one line: "256-bit elliptic curves (P-256 and Curve25519/X25519/Ed25519) are likely broken or significantly weaker than we thought". He calls his post a hasty draft. The NSA did not write those words. It is an inference from the wording, but it is a careful one.
Here is the difference between what is stated and what is inferred:
| Claim | Source |
|---|---|
| Move to post-quantum cryptography now, not on the old schedule. | Stated by the NSA |
| AI companies disclosed discoveries that affect some cryptography. | Stated in the joint statement |
| The threat is not yet immediate and widespread. | Stated in the joint statement |
| P-256, X25519 and Ed25519 are the affected algorithms. | Inferred by Valsorda |
| The attack is classical, not quantum. | Inferred by Valsorda |
| ML-KEM and ML-DSA are not affected. | Inferred by Valsorda from the advisory text |
| Which companies, which attack, and how fast it runs. | Not known |
3. Why AI API traffic is a good target
The traffic to an LLM API contains your prompts, your documents, your users' messages, and an API key in every request header. People send things to a model that they would not put in an email. That is the kind of traffic that someone records and keeps.
TLS does two jobs, and the advisory changes the urgency of each one differently:
- Key exchange protects confidentiality. If the key exchange breaks later, all recorded traffic becomes readable later. This is the urgent part. The fix is a post-quantum key exchange, and it exists today.
- The certificate protects authentication. A weak certificate key lets an attacker impersonate a server, but only while the attack is practical and only on a live connection. A recording does not help. This part is important, but you cannot fix it on your side: the API provider chooses its certificate.
4. We tested 23 AI API hosts
On 3 December 2026 we connected to each upstream host that our gateway calls. We used OpenSSL 4.1 with its default settings, and we recorded the key exchange group that the server chose and the key type of its certificate.
| Host | Key exchange | Certificate key |
|---|---|---|
generativelanguage.googleapis.com | X25519MLKEM768 | P-256 |
api.groq.com | X25519MLKEM768 | P-256 |
openrouter.ai | X25519MLKEM768 | P-256 |
api.mistral.ai, codestral.mistral.ai | X25519MLKEM768 | P-256 |
api.cloudflare.com | X25519MLKEM768 | P-256 |
api.cerebras.ai | X25519MLKEM768 | P-256 |
api.together.xyz | X25519MLKEM768 | P-256 |
api.ai21.com | X25519MLKEM768 | P-256 |
api.hyperbolic.xyz | X25519MLKEM768 | P-256 |
api.novita.ai | X25519MLKEM768 | P-256 |
router.huggingface.co | X25519MLKEM768 | RSA 2048 |
api.cohere.ai | X25519MLKEM768 | RSA 2048 |
api.fireworks.ai | X25519MLKEM768 | RSA 2048 |
api.studio.nebius.com | X25519MLKEM768 | RSA 2048 |
api.scaleway.ai | X25519MLKEM768 | RSA 2048 |
ai-gateway.vercel.sh | X25519MLKEM768 | RSA 2048 |
api.deepinfra.com | X25519 only | P-256 |
api.sambanova.ai | X25519 only | RSA 2048 |
api.upstage.ai | X25519 only | RSA 2048 |
dashscope-intl.aliyuncs.com (Qwen) | X25519 only | RSA 2048 |
integrate.api.nvidia.com | X25519 only | RSA 2048 |
models.github.ai | X25519 only | RSA 4096 |
We also checked api.openai.com and api.anthropic.com, which our gateway does not call. Both chose X25519MLKEM768.
Two results stand out. First, key exchange is in good shape: 17 of 23 hosts are ready. The other 6 refused a handshake that offered only the hybrid group. Second, no host uses a post-quantum certificate. Every certificate is P-256 or RSA, as on the rest of the web. Under Valsorda's reading, the 12 hosts with P-256 certificates have the weaker key. That is not something you or the providers can fix this week. The Web PKI has no post-quantum certificates yet.
5. The weak link was our own server
The server must accept a hybrid key exchange, and the client must offer one. We checked our client too. Our gateway runs on Ubuntu 24.04. Its Python links to OpenSSL 3.0.13, and OpenSSL added ML-KEM in version 3.5. So every request from our gateway to a provider used classical X25519, also to the 17 hosts that were ready.
The first hop was safe. Browsers and API clients connect to dreamprompting.com through Cloudflare, and that connection negotiated X25519MLKEM768. The hops after Cloudflare did not: Cloudflare to our server, and our server to the model provider.
Many apps that call an LLM API have the same problem, and their owners do not know it. The SDK is new, but the TLS library under it is as old as the operating system. Check yours with these commands:
# Python: the TLS library your requests use
python3 -c "import ssl; print(ssl.OPENSSL_VERSION)"
# Node.js
node -p "process.versions.openssl"
# Does a host accept the hybrid group? (needs OpenSSL 3.5 or newer)
openssl s_client -groups X25519MLKEM768 -connect api.groq.com:443 \
-servername api.groq.com </dev/null 2>&1 | grep "Negotiated TLS1.3 group"
If the first command shows OpenSSL 3.4 or older, your client cannot offer ML-KEM. Some builds link to other TLS libraries (BoringSSL, LibreSSL), so check the version of the library that is actually loaded. An OpenSSL upgrade usually means a newer OS release, a newer base container image, or a Python build that brings its own OpenSSL.
6. What to do
This list is for developers who send data to AI APIs. For the full list, wait for Valsorda's follow-up post, and read the NSA advisory.
- Upgrade the TLS library under your API client to a version that offers
X25519MLKEM768. This step protects recorded traffic, and it is the one with the most urgency. - Prefer providers that accept the hybrid group when you send sensitive prompts. The table above shows the current state of 23 hosts.
- Check SSH. Run
ssh -Q kex. OpenSSH 9.0 and newer offersntrup761x25519-sha512by default, and 9.9 addedmlkem768x25519-sha256. Our server already negotiates the first one. Valsorda also recommends newssh-mldsa44-ed25519host and user keys, which need a newer OpenSSH than most servers have. - Make an inventory. Find the places where your own code signs or encrypts with P-256 or Ed25519: JWT signing keys (
ES256,EdDSA), webhook signatures, encrypted backups. Plan how to replace them, and plan for a fast change if the attack gets cheaper. - Keep API keys short-lived. A key that you rotate often loses value if someone decrypts old traffic later.
7. What we changed (update, 4 December 2026)
This test found a problem in our own gateway, so we fixed it the next day. The site stayed up during the change.
- Gateway to providers. The app now runs on a separate CPython build that bundles OpenSSL 3.5.10. The system OpenSSL 3.0 stays for the other software on the server. Before the switch, Cloudflare's test endpoint reported
kex=X25519for our requests. After it, the endpoint reportedkex=X25519MLKEM768, for bothrequestsandhttpx. The gateway now offers the hybrid group on every provider call, and the 17 hosts that accept it choose it. - Cloudflare to our server. Traffic now comes through a Cloudflare Tunnel.
cloudflaredruns with--post-quantum, which offers onlyX25519MLKEM768and has no classical fallback. If the edge cannot do a post-quantum handshake, the connection fails, and it does not fall back to a weaker one. - The origin. Before, any Cloudflare IP could reach our server. Now only the tunnel can. A direct request to the server IP gets no answer.
- SSH and our own code. SSH already negotiated
sntrup761x25519-sha512. Our code uses AES and HMAC, and no elliptic curves, so it needed no change.
Two parts are not fixed, and we cannot fix them ourselves. The 6 providers without the hybrid group still get classical key exchange, and every provider certificate is still P-256 or RSA.
Want the same check on your system?
We now offer this as a service. We measure every connection, fix the weak ones with your team, and test again. See the post-quantum readiness audit.
Sources
- Filippo Valsorda, What to Make of the NSA Advisory, 2 December 2026.
- NSA, Cybersecurity Advisory: Immediate Actions to Push Toward Post-Quantum (PDF).
- NSA, press release, and the joint statement from ONCD, NSA and CISA.
- Breaking Defense, NSA urges "immediate" shift to post-quantum encryption for National Security Systems, 2 December 2026.
- Our measurements: OpenSSL 4.1.0 client, default groups, 3 December 2026. Results can change when a provider updates its edge. The server changes and the Cloudflare trace results are from 4 December 2026.