OpenScout now uses hybrid post-quantum cryptography across its cloud transcript sealing, phone-to-Mac pairing transport, sealed push notifications, Iroh peer-to-peer mesh bridge, and mesh node identities. Existing paired devices and enrolled nodes continue to connect without re-pairing or rotating classical keys.
Prefer to watch? See the architecture film, or watch the disclosure cut with Form PQ-07 attached at the end.
The timing is practical, not theoretical. Advisories from the NSA, CISA, the UK NCSC, and a joint coalition of major cloud and AI providers have compressed industry migration schedules around one specific risk: adversaries recording encrypted traffic and stored ciphertexts today to decrypt them later. For an agent runtime that carries terminal sessions, code transcripts, and push alerts across relays and devices, stored ciphertexts and recorded handshakes are the first things worth protecting.
What was already quantum-safe, and what was not
We audited every cryptographic primitive across scout and scout-platform before writing code. Two parts of the stack were already in good shape:
- Symmetric encryption and hashing. OpenScout uses
AES-256-GCM,SHA-256,HMAC-SHA256, andHKDF-SHA256everywhere data is encrypted or authenticated. Grover's algorithm reduces symmetric key strength by half, leaving 256-bit keys at a 128-bit quantum security level. - Inherited edge and OS transport. Cloudflare Workers edge routes (
hosted-chat,mesh-front-door,hosted-board) and Apple'sURLSessionandNetwork.frameworkon iOS 26 and macOS 26 already negotiate hybridX25519MLKEM768over TLS 1.3. Updated Tailscale nodes (v1.106.3 and later) also negotiate hybridML-KEM-768WireGuard handshakes (Noise IKhfs).
Every custom protocol we owned above those layers, however, was still classical-only:
| Surface | Before | After |
|---|---|---|
| Hub sealed transcripts | X25519 (Envelope v1) | Hybrid ML-KEM-768 + X25519 (Envelope v2) |
| Iroh P2P mesh sidecar | rustls on ring (classical X25519) | rustls on aws-lc-rs (X25519MLKEM768 preferred) |
| Phone-to-Mac pairing | Noise_XX / Noise_IK (X25519) | Noise_XXhfs / Noise_IKhfs (25519+MLKEM768) |
| Sealed push alerts | Static-static X25519 (Envelope v1) | PQ-seeded hybrid pqPushSecret + X25519 (Envelope v2) |
| Direct mesh HTTPS | minVersion: "TLSv1.2" | minVersion: "TLSv1.3" default |
| Mesh node identity & auth | Ed25519 only | Hybrid Ed25519 + ML-DSA-65 with algorithm agility |
Every platform we already target ships native post-quantum primitives today: Apple CryptoKit on iOS 26 and macOS 26 (MLKEM768, MLDSA65), BouncyCastle 1.86 on Android (MLKEM*), Node 24 with OpenSSL 3.6 (crypto.encapsulate), Rust's aws-lc-rs, and @noble/post-quantum alongside the @noble/* libraries we already use in Bun and browsers.
Sealed cloud transcripts: Envelope v2
Scout Hub lets a remote Claude Code sandbox stream transcript chunks through a Cloudflare Worker inbox to your local runtime. The inbox holds encrypted bytes until your Mac collects and deletes them. Because those ciphertexts sit at rest on a relay, Hub transcripts had the highest harvest-now-decrypt-later exposure in the codebase.
Envelope v1 sealed each chunk with an ephemeral X25519 key exchange. Envelope v2 keeps the same AES-256-GCM framing and adds FIPS 203 ML-KEM-768:
0x02 || ephemeralX25519Public (32) || mlKem768Ciphertext (1088) || nonce (12) || ciphertext || tag (16)
Both shared secrets feed HKDF-SHA256 (ss_mlkem768 || ss_x25519) with the ephemeral X25519 public key, recipient X25519 public key, and SHA-256(mlKem768Ciphertext || recipientMlKem768Public) bound into the info parameter. Breaking either X25519 or ML-KEM-768 alone is not enough to recover the key.
One constraint shaped the implementation: the Hub reporter (.claude/scout/report.mjs) must remain a single dependency-free JavaScript file that runs in vendor sandboxes. On Node 24.7 and newer, report.mjs now detects native crypto.encapsulate and emits Envelope v2 using OpenSSL's built-in ML-KEM-768. On older sandboxes running Node 18 through 22, it falls back cleanly to Envelope v1. On the collector side, loadOrCreateHubIdentity upgrades existing v1 identity.json files in place by attaching an ML-KEM-768 key pair without rotating the X25519 key, and openHubChunk opens both v1 and v2.
Iroh P2P mesh sidecar on aws-lc-rs
openscout-iroh-bridge handles peer-to-peer QUIC forwarding between mesh hosts. In our audit, Cargo.lock showed iroh 0.98.2 and rustls 0.23.40 backed by ring 0.17.14, which has no post-quantum key exchange.
Switching iroh to tls-aws-lc-rs, enabling rustls's prefer-post-quantum feature, and installing rustls::crypto::aws_lc_rs::default_provider() at startup moved the sidecar onto aws-lc-rs 1.19.0. A unit test now verifies that NamedGroup::X25519MLKEM768 is the first preferred key-exchange group in the provider.
Hybrid forward secrecy for phone-to-Mac Noise pairing
Phone-to-Mac pairing runs a Noise Protocol transport across TypeScript (@openscout/runtime, desktop, and web), Swift (ScoutIOSCore), and Kotlin (Android). Previously it supported only classical Noise_XX_25519_AESGCM_SHA256 (first pairing) and Noise_IK_25519_AESGCM_SHA256 (reconnect).
We added the Noise Hybrid Forward Secrecy patterns:
Noise_XXhfs_25519+MLKEM768_AESGCM_SHA256(e, e1/e, ee, ekem1, s, es/s, se)Noise_IKhfs_25519+MLKEM768_AESGCM_SHA256(e, es, e1, s, ss/e, ee, ekem1, se)
Using ephemeral ML-KEM-768 keys (e1 and ekem1) gives every session post-quantum forward secrecy while leaving existing 32-byte X25519 static keys, QR payloads, and trusted-peers.json files unchanged. On iOS and macOS, NoiseProtocol.swift calls Apple CryptoKit's native MLKEM768 directly. On Android, Noise.kt uses BouncyCastle 1.86's MLKEMKeyPairGenerator, MLKEMGenerator, and MLKEMExtractor. On the Mac bridge, SecureTransport inspects the first handshake frame (either the pattern field on JSON frames or the message length on binary frames) to negotiate XXhfs or IKhfs automatically with updated clients while still accepting classical XX and IK from older builds. Callers that want strict enforcement can pass requirePostQuantum: true.
We verified bit-for-bit handshake and encrypted message interoperability across TypeScript (@noble/post-quantum) and Swift (CryptoKit.MLKEM768) for all four patterns.
Push sealing within APNs's 4 KB cap, and TLS 1.3 on the mesh
Rich push alerts had two constraints: APNs caps the entire notification payload at 4 KB (MAX_SEALED_PUSH_CHARS = 2800), and Envelope v1 used static-static X25519, which lacked forward secrecy even classically. Putting a 1,088-byte ML-KEM-768 ciphertext inside every push would eat more than half the payload budget.
Instead, every completed Noise handshake now exports a 32-byte pushSecret derived from the Noise chaining key and handshake hash (HKDF-SHA256(ck, "openscout.push.v2", h, 32)). For XXhfs and IKhfs sessions, that secret already incorporates the ephemeral ML-KEM-768 shared secret. Push Envelope v2 combines pqPushSecret || X25519(mac, phone) with a fresh 16-byte per-notification salt:
0x02 || macPublicKey (32) || pushSalt (16) || nonce (12) || ciphertext || tag (16)
That adds 16 bytes instead of 1,088, stays well inside APNs's limit, gives every notification a distinct derived key, and opens directly in Apple's NotificationService.swift via AES.GCM.SealedBox(combined:).
On direct LAN and mesh HTTPS links, mesh-bind-controller.ts and mesh-pinned-https-client.ts now default to minVersion: "TLSv1.3" instead of TLSv1.2, preventing classical TLS 1.2 downgrade while keeping OPENSCOUT_MESH_TLS_ALLOW_TLS12=1 available as an explicit escape hatch.
Algorithm agility for mesh identity and signatures
Signatures cannot be broken retroactively by recording traffic today, so key exchange came first. Still, hardcoding Ed25519 into every node card and peer header would make a future signature transition painful.
NodeIdentity now generates a FIPS 204 ML-DSA-65 key pair alongside Ed25519 (and ensureNodeIdentityPqSigning upgrades existing node-identity.json files in place without changing keyId or fingerprints). Hybrid signed node cards sign pqSignature first and include it inside the canonical JSON covered by the classical Ed25519 signature. That ordering matters: older P1 verifiers strip only signature and hash the rest of the card, so they accept hybrid cards with zero changes, while PQ-aware verifiers enforce both Ed25519 and ML-DSA-65 and fail closed if either is missing or tampered with. Peer request authentication gains matching hybrid headers (x-openscout-signature-alg: ed25519+ml-dsa-65 and x-openscout-signature-pq) plus optional requirePostQuantum enforcement.
What stays classical for now
We want the boundary to stay clear:
- Classical fallbacks stay enabled by default during rollout. Hub
report.mjsfalls back tov1on Node versions withoutcrypto.encapsulate.SecureTransportstill accepts classicalXXandIKunlessrequirePostQuantum: trueis set. - Third-party identity tokens. Google OIDC, Apple Sign-In, and APNs authentication use
RS256andES256as required by Google and Apple. - Android JVM test execution. The Kotlin
Noise.ktandNoiseInteropTest.ktupdates target BouncyCastle 1.86's FIPS 203 API and will run in Android CI; local verification covered TypeScript, Node 24, Rust, and Swift CryptoKit.
The result is not a bolted-on crypto layer. Every piece uses the standardized NIST primitives already built into the runtimes OpenScout runs on, with hybrid combiners that stay at least as strong as classical X25519 and Ed25519 while closing the harvest-now-decrypt-later window today.
