---
name: pq-migrate
description: Plan and implement a migration to post-quantum cryptography. Use when asked to enable hybrid ML-KEM key exchange (X25519MLKEM768) on TLS, post-quantum key exchange on SSH, to move JWTs, updaters, certificates, VPNs, databases, Kubernetes meshes, secrets or backups off RSA and elliptic curves, or to work through a post-quantum readiness checklist.
---

# Post-quantum migration

Make the changes that move a system off RSA and elliptic-curve cryptography, in an order that removes the most risk first.

## Order of work

1. **Inventory.** If there is no current inventory, build one first with the `pq-inventory` skill.
2. **Transit key exchange.** Enable hybrid key exchange (`X25519MLKEM768` on TLS 1.3, `mlkem768x25519-sha256` on SSH) on every connection: edge, origin, internal services, databases, VPNs. Traffic recorded today can be decrypted later, so this goes first.
3. **Data encrypted to public keys.** Re-wrap backups, secrets and fields that were encrypted to RSA or elliptic-curve keys, then rotate secrets that crossed classical channels.
4. **Tokens, signatures and certificates.** These cannot be attacked retroactively but take longest to replace: internal JWTs to HMAC, dual signatures on updaters, short-lived certificates, an SSH certificate authority.
5. **Baseline and regression gates.** Confirm the symmetric baseline and add a CI check so nothing falls back.

`references/priorities.md` ranks the work P0 to P3. `references/checklist.md` is the full list, with an owner, a command and the relevant guide for every item.

## Rules

- **Use hybrid schemes, not post-quantum alone.** Keep the classical groups in the list as a fallback so clients that cannot do hybrid still connect, unless the user asks to enforce.
- **Check versions before changing configuration.** Hybrid groups need TLS 1.3 and a library that has them (OpenSSL 3.5+, Go 1.24+, and so on). The version each system needs is in its file under `references/systems/`. Read the lockfile or the base image; do not assume.
- **Copy configuration from the references.** Each file in `references/systems/` has a sample, a line-by-line explanation and the caveats. Use its exact identifiers. Do not invent policy names, group names or version numbers.
- **Enabled is not negotiated.** A setting protects only the connections that negotiate it. Add logging of the negotiated group where the reference shows how, and verify afterwards with the `pq-verify` skill.
- **Leave symmetric cryptography alone.** AES-256 data at rest does not need re-encryption unless its key was wrapped under RSA or elliptic curves.
- **Enforcement can lock people out.** Removing classical SSH key exchange or TLS groups refuses clients that lack the new ones. Confirm what clients negotiate first, and say plainly when a change is an enforcement step.
- **Stay within the request.** Make the change you were asked for, list the related items you noticed, and let the user decide on those.

## Procedure for one change

1. Find the item in `references/checklist.md` and open the system file it links to.
2. Check the prerequisites that file names against the actual versions in the repository.
3. Apply the smallest configuration change that meets it, in the syntax of the system in use.
4. State how to verify it, using the item's command or `pq-verify`.
5. Report what changed, what was left classical and why, and which checklist items remain.

## References

- `references/priorities.md`: what to migrate first, ranked.
- `references/checklist.md`: every change, in phases.
- `references/systems/`: one file per system (proxies, cloud load balancers, SSH, runtimes, cloud SDKs, databases, secrets, Kubernetes, VPNs, signing, JWTs, PKI).
- `references/deadlines.md`: dates set by governments and vendors, for planning.
