---
name: pq-inventory
description: Build a cryptographic bill of materials (CBOM) for a repository or infrastructure codebase to assess post-quantum readiness. Use when asked to audit, inventory or find uses of RSA, ECDSA, ECDH, Ed25519, X25519, TLS configuration, SSH keys, JWT signing, certificates, code signing, or public-key encryption ahead of a post-quantum migration.
---

# Post-quantum cryptographic inventory

Produce a complete list of where a codebase depends on RSA or elliptic-curve cryptography, and say how each use is exposed. Every later migration step depends on this list being complete, so prefer reading real files over guessing from names.

## What counts

In scope: anything that uses RSA, finite-field Diffie-Hellman, or elliptic curves (ECDH, ECDSA, EdDSA, X25519, Ed25519), at any key size.

Not a finding: symmetric cryptography and hashes (AES-256, ChaCha20, SHA-256 or stronger, HMAC). Record them only when a symmetric key is itself wrapped or exchanged using RSA or elliptic curves.

## Exposure classes

Label every finding with one of these. The class decides its priority.

- **Harvest now, decrypt later**: key exchange on a network connection (TLS, SSH, VPN), or data encrypted to a public key and stored (backups, PGP, age, SOPS, sealed-secrets, JWE `ECDH-ES`, RSA key wrapping). Anything recorded or copied today can be decrypted later. Highest priority.
- **Live forgery**: signatures and certificates (JWTs, code signing, updater manifests, X.509, SSH host and user keys, webhook signatures). They cannot be attacked retroactively, but they take longest to replace.
- **Safe**: symmetric or hash-only.

## Procedure

1. Pick the prompts that match the repository from `references/prompts.md`. There is one for application repositories, one for infrastructure as code, and focused ones for tokens and updaters, certificates and keys, and public-key-encrypted data. Follow each prompt's steps yourself; they are written as instructions to a coding agent.
2. Inspect real sources: lockfiles and manifests for library versions, Dockerfiles and base images for the OpenSSL version, TLS and SSH configuration, IaC for load balancer policies and KMS key specs, and code for sign, verify, encrypt and wrap calls.
3. For each finding record: file and line, component, the current primitive, the exposure class, and the exact fix. Take the fix from `references/checklist.md`, which also names the guide page that covers it.
4. List what you could not see from the repository: managed services, vendors, and anything configured in a console. These go in a vendor register, not in the findings table.

## Output

A Markdown table with the columns `File:Line | Component | Current primitive | Exposure | Fix`, sorted by exposure class, followed by the vendor register and a short list of open questions.

Do not change code as part of an inventory. Hand the result to the `pq-migrate` skill, or to the person who asked.

## References

- `references/prompts.md`: the audit prompts.
- `references/checklist.md`: the migration checklist, for naming fixes.
- `references/compromise.md`: how each primitive fails, for explaining exposure.
