Post-quantum TLS on agentgateway: how to turn it on and prove it works Agentgateway v1.8.1, built with the aws-lc-rs crypto backend, offers the hybrid X25519MLKEM768 post-quantum key-exchange group on any HTTPS listener by default, requiring no certificate changes, and operators can verify negotiation with OpenSSL 3.5 or newer via the output line "Negotiated TLS1.3 group: X25519MLKEM768." The setup follows the NSA's December 2 advisory, Immediate Actions to Push Toward Post-Quantum, which directs operators to move TLS services to TLS 1.3 and enable post-quantum key exchange using the hybrids defined in RFC 10024. Setting minTLSVersion: TLS_V1_3 and keyExchangeGroups: [X25519_MLKEM768] on the listener refuses classical-only clients with a handshake failure (SSL alert number 40) instead of falling back, and the optional SymCrypt backend has no ML-KEM, so the hybrid is unavailable there. The NSA’s December 2 advisory, Immediate Actions to Push Toward Post-Quantum https://media.defense.gov/2026/Dec/01/2004039413/-1/-1/0/CSA Immediate Actions Push Toward PQC.PDF , tells operators to move TLS services to TLS 1.3 and turn on post-quantum key exchange where it is available, using the hybrids defined in RFC 10024 https://www.rfc-editor.org/rfc/rfc10024 . agentgateway supports the hybrid X25519MLKEM768 , which combines classical X25519 with ML-KEM-768 FIPS 203 . It protects against harvest-now-decrypt-later attacks: a session recorded today stays safe unless an attacker breaks both X25519 and ML-KEM. Here is what to do, with a test after each step that proves it worked. AgentgatewayPolicy . You don’t need to change your certificates for any of this. You need agentgateway v1.8.1 built with the aws-lc-rs crypto backend. The official release binaries are. Check yours: ./agentgateway --version Look for "crypto backend": "aws-lc-rs" in the output. The optional SymCrypt backend has no ML-KEM, so the hybrid isn’t available there 3130 https://github.com/agentgateway/agentgateway/issues/3130 . To run the tests you need OpenSSL 3.5 or newer, because earlier versions can’t offer X25519MLKEM768 . Create a throwaway CA and a certificate for localhost : mkdir -p certs && cd certs openssl req -x509 -newkey ec -pkeyopt ec paramgen curve:prime256v1 -nodes \ -keyout ca-key.pem -out ca.pem -days 30 -subj "/CN=agw-pqc-test-ca" openssl req -newkey ec -pkeyopt ec paramgen curve:prime256v1 -nodes \ -keyout key.pem -out leaf.csr -subj "/CN=localhost" openssl x509 -req -in leaf.csr -CA ca.pem -CAkey ca-key.pem -CAcreateserial \ -out cert.pem -days 30 \ -extfile < printf "subjectAltName=DNS:localhost,IP:127.0.0.1\nbasicConstraints=CA:FALSE\nextendedKeyUsage=serverAuth,clientAuth" cd .. There is nothing to turn on. Any HTTPS listener in v1.8.1 offers the hybrid. Save this as config-frontend.yaml : php yaml-language-server: $schema=https://agentgateway.dev/schema/config binds: - port: 8443 listeners: - name: pqc protocol: HTTPS tls: cert: certs/cert.pem key: certs/key.pem routes: - policies: directResponse: status: 200 body: "hello over tls\n" Test it. Start the gateway and connect with a client that offers the hybrid: ./agentgateway -f config-frontend.yaml & openssl s client -connect 127.0.0.1:8443 -servername localhost \ -tls1 3 -groups X25519MLKEM768 -brief -CAfile certs/ca.pem You should see: Protocol version: TLSv1.3 Verification: OK Negotiated TLS1.3 group: X25519MLKEM768 Negotiated TLS1.3 group: X25519MLKEM768 is the proof. OpenSSL 3.5 offers the hybrid first by default, so a plain openssl s client without -groups gets the same result. The admin UI doesn’t show the negotiated group, so use OpenSSL to check. Older clients still connect. They fall back to a classical group: | Client offers | Negotiated | |---|---| | OpenSSL 3.5 defaults | X25519MLKEM768 | | X25519MLKEM768 | X25519MLKEM768 | | X25519 only | X25519 | | secp256r1 only | prime256v1 P-256 | | TLS 1.2 client -tls1 2 | X25519 , ECDHE-ECDSA-AES256-GCM-SHA384 | Run the same command with -groups X25519 and you get Peer Temp Key: X25519, 253 bits instead: Add two lines to the listener’s tls block: tls: cert: certs/cert.pem key: certs/key.pem minTLSVersion: TLS V1 3 keyExchangeGroups: X25519 MLKEM768 Clients that can’t do the hybrid are now refused instead of falling back. The supported group names are X25519 , P-256 , P-384 and X25519 MLKEM768 . Test it. Restart the gateway. The command from Step 1 still connects with X25519MLKEM768 . A classical client is refused: openssl s client -connect 127.0.0.1:8443 -servername localhost \ -tls1 3 -groups X25519 -brief -CAfile certs/ca.pem ssl/tls alert handshake failure ... SSL alert number 40 Check your clients before you turn this on in production. Clients that only offer X25519 or secp256r1 get the same alert, and TLS 1.2 clients can’t connect at all. Browsers, Go, and curl built on OpenSSL 3.5 or newer already offer the hybrid. A safe way to roll it out is to add an enforced listener on a separate port and move clients to it. When agentgateway calls an upstream, the gateway is the TLS client. In v1.8.1 it sends an X25519 key share first. An upstream that prefers the hybrid has to ask for a retry, which costs a round trip, and an upstream that follows the client’s order settles on plain X25519. Make the gateway lead with the hybrid by setting keyExchangeGroups on backendTLS . Save this as config-backend.yaml : binds: - port: 8443 listeners: - name: plain protocol: HTTP routes: - policies: backendTLS: root: certs/ca.pem hostname: localhost keyExchangeGroups: X25519 MLKEM768, X25519 backends: - host: 127.0.0.1:9443 Keep X25519 in the list so classical upstreams still work. The gateway sends both key shares, so an upstream without ML-KEM picks X25519 in the same handshake. PR 4670 https://github.com/agentgateway/agentgateway/pull/4670 makes this the default in releases after v1.8.1. Test it. Run an OpenSSL server as the upstream with -trace , so it prints the handshake, and send a request through the gateway: openssl s server -accept 9443 -cert certs/cert.pem -key certs/key.pem -www -trace ./agentgateway -f config-backend.yaml & curl -s -o /dev/null -w 'HTTP %{http code}\n' http://127.0.0.1:8443/ The key exchange lines from s server -trace should look like this: ClientHello, Length=1465 extension type=key share 51 , length=1258 NamedGroup: X25519MLKEM768 4588 NamedGroup: ecdh x25519 29 ServerHello, Length=1206 extension type=key share 51 , length=1124 NamedGroup: X25519MLKEM768 4588 The proof is one ClientHello, no retry, and X25519MLKEM768 in the ServerHello. The request returns HTTP 200 . keyExchangeGroups works on backendTLS in route policies, per-backend policies and AI provider policies. It can’t be combined with spiffe in the same backend TLS block. On Kubernetes, the same settings go in an AgentgatewayPolicy . Listener settings live under spec.frontend.tls , and minTLSVersion: TLS V1 3 becomes minProtocolVersion: "1.3" . The group names are the same. Require the hybrid on every listener of a Gateway: apiVersion: agentgateway.dev/v1alpha1 kind: AgentgatewayPolicy metadata: name: pqc-frontend namespace: agentgateway-system spec: targetRefs: - group: gateway.networking.k8s.io kind: Gateway name: agentgateway-proxy frontend: tls: minProtocolVersion: "1.3" keyExchangeGroups: "X25519 MLKEM768" Lead with the hybrid on connections to an upstream Service: apiVersion: agentgateway.dev/v1alpha1 kind: AgentgatewayPolicy metadata: name: pqc-backend namespace: agentgateway-system spec: targetRefs: - group: "" kind: Service name: my-upstream sectionName: "8443" backend: tls: caCertificateRefs: - name: my-upstream-ca sni: my-upstream.example.com keyExchangeGroups: "X25519 MLKEM768", "X25519" Test it. Point openssl s client at your Gateway’s address and hostname, and look for the same Negotiated TLS1.3 group: X25519MLKEM768 line as in Step 1: openssl s client -connect