# Post quantum API security: what your endpoints and agent clients negotiate

Post quantum API security for agent builders: test X25519MLKEM768 on your endpoints and HTTP clients, then plan API keys, JWTs and certificates by date.

## Summary

Post quantum API security comes down to one question per connection: did the TLS handshake use the hybrid group X25519MLKEM768? For most APIs the answer depends on two pieces of software you already run, the server that terminates TLS and the HTTP client inside your agent, and you can test both in a few minutes. Hybrid key exchange protects request and response bodies from traffic that is recorded today and decrypted later. It does not make your certificates, your JWT signatures or the way you issue API keys post-quantum, so those get their own plan below.

The push this month came from the NSA advisory "Immediate Actions to Push Toward Post-Quantum" ([NSA, Dec 2026](https://media.defense.gov/2026/Dec/01/2004039413/-1/-1/0/CSA_Immediate_Actions_Push_Toward_PQC.PDF)), which asks organizations to inventory their cryptography and switch TLS 1.3 to post-quantum hybrid settings, and from a [2 December statement](https://www.anthropic.com/news/joint-statement-post-quantum-cryptography) in which Amazon, Anthropic, Apple, Cloudflare, Google, Meta, Microsoft, OpenAI and Oracle backed moving to NIST's algorithms as soon as possible. For calibration: the [ONCD, NSA and CISA joint statement](https://www.cisa.gov/news-events/news/joint-statement-recent-advances-cryptographic-and-cybersecurity-capabilities) says recent AI-driven findings "do not present an immediate and widespread threat" to cryptography in use, and an [independent review](https://cirg.org/statements/1/) of Anthropic's lattice papers calls the new attack far beyond practical reach. Nothing you run today is known to be broken. The work is about getting ahead of a deadline.

## One tool call, several handshakes

Picture an agent that calls a data API through a gateway. That single tool call opens at least three TLS connections, and each one picks its key exchange on its own:

1. **Agent to your edge.** The agent's HTTP client (Node `fetch`, Python `httpx` or `requests`, Go `net/http`) sends the list of groups it supports. Your edge server picks one.
2. **Edge to origin.** If a CDN sits in front, it opens a second connection to your servers. Cloudflare's connection to origins [supports X25519MLKEM768](https://developers.cloudflare.com/ssl/post-quantum-cryptography/pqc-to-origin/), and origins that are not ready can sit behind Cloudflare Tunnel, which [carries traffic over post-quantum encryption](https://blog.cloudflare.com/project-quantum-leap/).
3. **Your server to upstream APIs.** Now you are the client. Your outbound library decides what to offer, and each provider's server decides what to accept.

A gateway that fronts many providers behind one key, like the model described on our [how it works](https://looot.ai/how-it-works) page, multiplies hop 3: one handshake per provider, each against a different TLS stack. You control what you offer on every hop. You only control what gets accepted on the hops where you run the server.

## Check the server side

Point OpenSSL 3.5 or later at your API host and offer only the hybrid group:

A server that supports it prints `Negotiated TLS1.3 group: X25519MLKEM768`. A server that does not will fail the handshake, because you gave it nothing else to choose. Look at the second line too. If it reads something like `ecdsa_secp256r1_sha256` or `rsa_pss_rsae_sha256`, the key exchange was hybrid but the certificate signature was classical ECDSA or RSA. That one output shows the gap this post keeps coming back to.

Two more server checks:

- **Docs and dashboards.** Open the page in Chrome, then DevTools, then the Security panel. It names the key exchange for the connection. Chrome has offered ML-KEM since [Chrome 131](https://security.googleblog.com/2024/09/a-new-path-for-kyber-on-web.html).
- **Edge numbers.** Cloudflare has used post-quantum key agreement by default since 2022 and reports that 73% of human (browser) connections to its network are post-quantum encrypted as of 3 December 2026 ([Cloudflare](https://blog.cloudflare.com/project-quantum-leap/)). [Cloudflare Radar's post-quantum page](https://radar.cloudflare.com/post-quantum) tracks adoption and tests a host.

If you terminate TLS yourself, Cloudflare's [support list](https://developers.cloudflare.com/ssl/post-quantum-cryptography/pqc-support/) shows hybrid key agreement on by default in NGINX built against OpenSSL 3.5 or later, Caddy 2.10.0 and later, and Traefik 3.4.2 and later.

## Check the client side

Agents are clients first. This is where old container images hide. Each runtime below offers X25519MLKEM768 by default from the version listed, according to its own release notes:

| Runtime | Default from | Check | Watch for |
|---|---|---|---|
| OpenSSL | 3.5.0, 8 April 2025 (NEWS) | `openssl version` | Distro packages still on 3.0 or earlier |
| Go | 1.24 (notes) | `go version` | A `Config.CurvePreferences` list without X25519MLKEM768; `GODEBUG=tlsmlkem=0` turns it off |
| Node.js | 24.5.0 and 22.20.0, which bundle OpenSSL 3.5 (v24, v22) | `node -p process.versions.openssl` | Builds linked to an older system OpenSSL; a hard-coded `ecdhCurve` |
| Python | Whatever OpenSSL the interpreter loads (ssl docs) | `python3 -c "import ssl; print(ssl.OPENSSL_VERSION)"` | Slim base images with an old libssl |

Python 3.15 adds `SSLContext.set_groups()` and `SSLSocket.group()`, so you can set and read the group directly. On older versions the defaults come from OpenSSL.

To see what a client negotiates in practice, call an endpoint that reports it. Cloudflare documents `/cdn-cgi/trace` as a [troubleshooting endpoint](https://developers.cloudflare.com/fundamentals/reference/cdn-cgi-endpoint/), and at the time of writing its output includes a `kex=` line with the group your client used. In Node:

In Go 1.25 or later, `ConnectionState.CurveID` [exposes the key exchange](https://go.dev/doc/go1.25), so you can log it on every outbound call to a provider:

Run these inside the image your agent ships in, not on your laptop. A laptop's system `curl` may use a different TLS library than the runtime in production and give you a different answer.

One Go note: the 1.24 release notes mention buggy servers that mishandle the larger hybrid handshake and offer `tlsmlkem=0` as the escape hatch. If a provider forces you to use it, scope it to that binary, log it and put a date on removing it.

## API keys, JWTs and signatures: a separate track

**API keys.** A bearer key rides inside the TLS session. If a session that carried it used classical key exchange and is decrypted years from now, the key is exposed along with the payload. Once both sides of your hops negotiate the hybrid group, rotate long-lived keys that crossed older sessions, and prefer short-lived, scoped keys for agents.

**JWT signing.** RS256 and ES256 are RSA and ECDSA signatures. A recorded token does not help an attacker after it expires; the risk is a future forger minting new tokens with your signing key's math. [RFC 9964](https://www.rfc-editor.org/info/rfc9964/) (May 2026) defines ML-DSA for JOSE, with `alg` values such as `ML-DSA-44` and a new `AKP` key type. Cloudflare plans post-quantum JWTs across its internal and customer interfaces by the end of Q2 2027 ([Cloudflare](https://blog.cloudflare.com/project-quantum-leap/)). Before you switch, confirm that every verifier and identity provider you depend on supports it. What you can do now:

- Move the accepted `alg` list into config, and make sure verifiers reject anything not on it.
- Publish keys through a JWKS with `kid` values so a new key type can sit next to the old one.
- Shorten token lifetimes so a cutover does not strand old tokens.

**Webhook HMACs** use shared secrets, not public-key math. [NIST IR 8547](https://csrc.nist.gov/pubs/ir/8547/final), NIST's final transition plan (October 2026), covers digital signatures and key establishment: it deprecates the quantum-vulnerable ones after 2030 and disallows them after 2035.

**Certificates.** From 15 March 2027 (Chrome 164 and later), Chrome will block TLS certificates whose chain includes any CA certificate with an ECDSA P-256 key ([Chrome Root Program](https://groups.google.com/a/ccadb.org/g/public/c/E4M_IG6VT_o)). Leaf certificates with P-256 keys still work for now. CAs have been told to issue from P-384 or RSA 3072 and up, which Chrome calls an interim step that does not protect against quantum computers. The long-term answer is [Merkle Tree Certificates](https://datatracker.ietf.org/doc/draft-ietf-plants-merkle-tree-certs/); Cloudflare plans to issue its first ones in early 2027. Your SDK clients use their own trust stores, so the Chrome rule does not bind them directly. But API hosts often share a certificate with the dashboard and docs that people open in Chrome, so check the chain now.

## What changes for agent tool calls

- **Remote MCP servers and tool endpoints are HTTP APIs.** Run the same server and client checks on them. A local stdio server has no handshake of its own, but every outbound call it makes does.
- **Pinned images age quietly.** Teams pin agent images for reproducible runs, and the pinned libssl decides your key exchange. Add the `kex` check to CI so an old base image fails the build.
- **Fan-out needs logging.** One task can touch a dozen hosts. Log host and negotiated group per call, then sort by classical-only to get your vendor list.
- **Ask providers directly.** NSA action 5 is to apply vendor updates and use only approved, post-quantum profiles. Ask each provider which groups their endpoints accept and when they plan to change certificates. Ask any gateway in the path the same questions. Our [security page](https://looot.ai/security) lists what looot does and does not claim.

## A timeline for API teams

| Date | What happened or happens | Source |
|---|---|---|
| 13 Aug 2024 | NIST finalizes FIPS 203 (ML-KEM), 204 (ML-DSA), 205 (SLH-DSA) | NIST |
| May 2026 | RFC 9964 defines ML-DSA for JOSE and COSE | RFC Editor |
| Aug 2026 | RFC 10024 standardizes hybrid TLS 1.3 key agreement, including X25519MLKEM768 | RFC Editor |
| Dec 2026 | NSA advisory with six immediate actions | NSA |
| 2 Dec 2026 | Industry joint statement backing the move | Anthropic |
| 15 Mar 2027 | Chrome 164+ blocks chains with a P-256 CA key | CCADB |
| End of Q2 2027 | Cloudflare targets post-quantum JWTs, TLS and SSH on its interfaces | Cloudflare |
| 2027 | Cloudflare targets fully post-quantum, moved up from 2029 | Cloudflare |
| 2030 / 2035 | NIST plan (final): deprecate, then disallow quantum-vulnerable algorithms | NIST IR 8547 |

## Checklist for this sprint

- [ ] Run the `openssl s_client -groups X25519MLKEM768` test on every public API host.
- [ ] Print the OpenSSL version inside each agent and worker image.
- [ ] Remove hard-coded group lists (`CurvePreferences`, `ecdhCurve`, `ssl_ecdh_curve`) or add the hybrid group to them.
- [ ] Log the negotiated group on outbound provider calls.
- [ ] List every place you sign or verify JWTs, with `alg` and key age.
- [ ] Check each certificate chain for a P-256 CA key before 15 March 2027.
- [ ] Send providers the two questions above and record the answers.

## Get your API stack reviewed

If you would like someone to walk the hops with you, AY Automate audits API and agent stacks and turns the findings into a dated migration plan. The [Claude Code security audit](https://www.ayautomate.com/services/claude-code-security-audit) page explains the scope; to talk first, [book a call](https://www.ayautomate.com/consultation).

## Questions

### Does my API need to change code to get post-quantum key exchange?

Usually not. On OpenSSL 3.5 or later, Go 1.24 or later, or Node.js 24.5.0 / 22.20.0 or later, the hybrid group is offered by default, so the work is upgrading runtimes and removing hard-coded group lists.

### My endpoint negotiates X25519MLKEM768. Is my API post-quantum?

Its traffic is protected against harvest now, decrypt later. The certificate that proves the server's identity and any JWTs you sign still use RSA or ECDSA, and those move on a separate timeline.

### Should I sign JWTs with ML-DSA today?

RFC 9964 defines ML-DSA for JOSE, but check that every verifier and identity provider in your chain supports it first. Most teams should get algorithm allow-lists and key rotation ready now and switch when their libraries do.

### Does the Chrome P-256 rule affect API clients that are not browsers?

The rule is Chrome's, and non-browser clients use their own trust stores. API hostnames often share certificates with dashboards and docs that people open in Chrome, so check the chain before 15 March 2027 anyway.

### Did AI break the encryption my API uses?

No. The ONCD, NSA and CISA joint statement says the recent findings do not present an immediate and widespread threat, and the lattice results Anthropic published are theoretical.

## For agents

### Code (bash)

```bash
openssl s_client -connect api.example.com:443 -servername api.example.com \
  -groups X25519MLKEM768 </dev/null 2>&1 | grep -E "Negotiated|Peer signature type"
```

### Code (js)

```js
const res = await fetch("https://www.cloudflare.com/cdn-cgi/trace");
const text = await res.text();
console.log(text.split("\n").find((line) => line.startsWith("kex=")));
```

### Code (go)

```go
resp, err := http.Get("https://provider.example.com/v1/health")
if err == nil {
    log.Printf("host=%s kex=%s", resp.Request.URL.Host, resp.TLS.CurveID)
}
```
