An agent skill for finding where an engineering system relies on quantum-vulnerable public-key cryptography, and for migrating it to post-quantum standards.
It is a tool to audit and to remediate. It does two jobs:
- Audit. Inventory every use of RSA, ECDSA, ECDH, EdDSA, X25519, finite-field Diffie-Hellman and DSA across codebases, infrastructure, vendors and open source dependencies, mapped over five areas of the organization: product, build and release, cloud infrastructure, corporate systems and vendors. Classify each use, say what else depends on its key, rank it, and produce a cryptographic inventory (CBOM), a readable report and a proposed remediation plan. The audit is read-only.
- Remediate. For each work item that is a code or configuration change, open a pull request and stay with it: get CI green, fix failures, answer review comments and resolve conflicts until it is merged or closed. Then re-audit what changed.
The skill is built to work on its own. It finds what it needs in repositories, configuration, read-only cloud and identity queries, DNS, certificate transparency logs and public vendor documentation before it asks anyone, and it asks a person only when it cannot proceed or when an action is irreversible or reaches outside the organization. It asks one question at the start (run with defaults, or a short interview first) and one after the report (which work items to remediate).
Some things always stay with a person: merging a pull request, which is the approval of that change; rotating, deleting or disabling keys and certificates; changing production; and sending anything to a vendor. The skill turns each of those into a task with an owner.
The default audit follows a fixed work list: one lead agent and six helpers per codebase, about 35 minutes, one record per distinct fact, three severity bands. A slower, more thorough mode is there when you ask for it. What was measured says how well this works and where it does not.
The skill follows the Agent Skills format and is agent-neutral. It works in a single agent session, and it is designed to be fanned out: a lead gives six helpers one area each, and for a larger system an orchestrator gives each repository to its own lead and merges their results.
NIST published its first post-quantum standards in August 2024 (FIPS 203, 204 and 205) and has set out the transition away from quantum-vulnerable algorithms in NIST IR 8547. In December 2026, ONCD, NSA and CISA issued a joint statement saying that frontier AI models have produced discoveries that affect the security of some cryptography in use, that this is not assessed to be an immediate and widespread threat, and that infrastructure should be upgraded expeditiously. Major technology companies published a joint statement supporting an accelerated move to the NIST standards.
The government statement does not name the affected algorithms, and this skill does not guess. It inventories all classical public-key cryptography, which is what the post-quantum standards replace, and lets you choose how to weigh signatures against key exchange (see threat profiles).
An audit writes these files to a directory outside the audited repositories:
| File | What it is |
|---|---|
findings.json |
One record per distinct fact about a public-key use: algorithm, key size, function, every place it holds, whether it was verified live, in code only or only stated, what else depends on the key (blast radius), exposure, who controls it, severity, migration target and steps. Validated against findings-schema.json |
cbom.json |
The confirmed records as a CycloneDX 1.6 cryptographic bill of materials |
coverage-ledger.json |
What was audited, what was not, and why |
REPORT.md |
Posture, ranked findings, vendors, coverage and limits |
REMEDIATION-PLAN.md |
Work items with steps, verification and rollback, how each is delivered (a pull request or a task for a person), and the one decision about which to remediate |
strategy.md |
Only after the interview: the scope, data lifetimes, compliance drivers, access, vendors and delivery choices the run follows |
VENDOR-STATUS.md, questionnaires/ |
What each vendor's evidence shows, and a questionnaire ready for a person to send |
NEEDS-VALIDATION.md |
Facts the audit could not establish, each with the exact check that settles it and who can run it |
MEMO.md, SLACK-SUMMARY.md |
Optional, on request: a plain-English memo for engineers who are not cryptography experts, and a summary that can be read in half a minute. Both are derived from the validated records |
examples/sample-output is a complete set for the small made-up service in examples/sample-target.
With the Skills CLI:
npx skills add https://github.com/Factory-AI/migrate-post-quantum --skill migrate-post-quantumOr copy the directory skills/migrate-post-quantum into your agent's skills directory, for example .factory/skills/ for Factory Droid or .claude/skills/ for Claude Code.
The helper scripts need Node.js 18 or later and have no dependencies. The agent needs to be able to read files and run commands; delegating to sub-agents is used when available and is not required.
Ask a question (guidance mode, no files written):
Is our use of
joseinservices/authaffected by the post-quantum migration? What would we move to?
Run an audit:
Use the migrate-post-quantum skill to audit this repository, the infrastructure in
infra/, our vendors and our dependencies. Write the output to~/migrate-post-quantum/acme/run-1.
The agent starts with one question:
Do you want me to run this out of the box, or should I interview you briefly to build a more precise strategy for your organization?
- Out of the box: no further questions. The agent maps the five areas, states the scope and the access it found, and carries on through the work list with the defaults: everything it can reach, the
acceleratedthreat profile, live observation on. - Interview: a few short questions about scope, long-lived confidential data, compliance drivers, access, the vendors that matter, how remediation should be delivered, your risk tolerance and how deep to go. The answers go into
strategy.md, and the run follows it.
Thorough mode is opt-in. Say "thorough", "deep" or "exhaustive" and the agent runs the phased audit instead: a unit for each repository, system area and vendor group, a coverage critic, and independent verifiers. It reads more and costs more, and it can also record symmetric and hash uses that need review.
Live observation is on by default. Where the agent already has read-only access, or the information is public, it looks at what is actually running: read-only cloud, identity and SaaS queries, DNS, certificate transparency, and one TLS or SSH handshake per endpoint your organization owns or uses, including your vendors' public endpoints. It never scans address ranges, creates load, attempts to sign in, or reads secrets or private keys. Say "no live observation" to turn it off. The run records what was observed and with which access.
After the report the agent asks once which work items to remediate:
All code-fixable items, only the ones you name, or none for now?
You can answer that in the interview instead, and then the run does not stop. For each chosen item the agent opens a pull request, ready for review, and stays with it until it is merged or closed. It never merges, never pushes to a protected branch and never weakens CI to get it green. Key generation and rotation, production changes and vendor contact become tasks with a named owner.
The work list is already a fan-out: the lead starts six helpers at once, one each for keys and signing, protocols and features, transport and settings, pinned dependencies, the release and install chain, and shipped extras and documentation, and takes the runtime checks itself. For a system with several repositories, an orchestrating agent maps the scope, gives each repository to its own lead, gives each other area (cloud infrastructure, corporate systems, vendors) one helper, and merges and ranks what comes back.
In thorough mode the orchestrator instead assigns one agent per unit: each repository or service, each system area, each corporate system area, each vendor group and each dependency ecosystem. Each writes a unit-result.json; the orchestrator merges them with merge-findings.cjs and sends records to fresh verifier agents. ORCHESTRATION.md has both procedures. The same files and formats are used when one agent does everything in order.
| Step | What happens |
|---|---|
| Opening question | Out of the box, or a short interview that writes strategy.md |
| Scope | Map the five areas and state the scope and the access found |
| Work list | Per codebase: six helpers read fixed areas and write short notes; the lead runs the product locally and observes live systems read-only |
| Merge, rate, rank | One record per distinct fact, listing every place. Three bands, with high kept small. Ranked by fixed rules |
| Gap pass | Every module accounted for, the top entries re-opened at the cited line, every "not present" backed by a search |
| Reporting | A short report, remediation plan, vendor status, questionnaires, CBOM. Every finding is labelled verified live, code only or stated. Optional memo and chat summary |
| The one decision | Asked once, or answered in the interview: which work items to remediate |
| Remediation | For each chosen item: test the unchanged system first, and if it already meets the requirement, change nothing. Otherwise one pull request, changing only what the requirement names, kept until CI is green and it is merged or closed. Everything else becomes a task for a person |
| Re-audit | What changed is audited again and the records updated |
Thorough mode replaces the work list, merge and gap pass with discovery of every unit, an inventory by one agent per unit, a coverage critic and independent verification.
What the skill treats as at risk, how it ranks findings, and which standards it migrates to are in ALGORITHMS.md, with the primary source for every claim.
skills/migrate-post-quantum/
SKILL.md entry point: modes, safety rules, workflow
WORKLIST.md the default audit: areas, helpers, merge, bands, rank, gap pass, fix rules
DISCOVERY.md INVENTORY.md VALIDATION-AND-REPORTING.md REMEDIATION.md ORCHESTRATION.md
ALGORITHMS.md classification, severity bands, migration targets, sources
CODEBASES.md INFRASTRUCTURE.md IDENTITY-AND-SIGNING.md DEPENDENCIES.md VENDORS.md CORPORATE-SYSTEMS.md
templates/ unit brief, strategy, vendor questionnaire, report, remediation plan, memo, chat summary
findings-schema.json crypto-patterns.json
scan-crypto.cjs validate-findings.cjs validate-coverage-ledger.cjs
merge-findings.cjs apply-verification.cjs apply-threat-profile.cjs export-cbom.cjs pqm-lib.cjs
*.test.cjs
examples/
sample-target/ a small made-up service to audit
sample-output/ the audit output for it
The inventory is a map of where an organization's cryptography is weakest. The skill writes it outside the audited repositories and tells the agent not to paste it into public issues or pull requests. Keep it where you keep other security findings.
The skill never reads private keys or secret values. It records that a key exists, its algorithm and where it is. The scanner does not open files that usually hold secrets, redacts key blocks, long tokens and values assigned to secret-looking names, and can omit excerpts altogether. Redaction is best effort, so its output is confidential too. The validators reject output that contains a private key.
An audit reads text written by other people: the audited code, dependencies, vendor pages and search results. The skill tells the agent to treat all of it as evidence and never as instructions, and to read a package it fetched for inspection without installing or running it. That lowers the risk of a planted instruction; it does not remove it, so run the skill with no more access than the audit needs.
The work list was developed by running agents against reference lists of known public-key uses in open source codebases, and keeping what improved the result.
| With the work list | A plain agent, no skill | |
|---|---|---|
| Reference items found | about 82 to 90% | about 67 to 75% |
| Wrong findings | none | none |
| Time per audit | about 22 to 26 minutes | about 18 to 22 minutes |
On a codebase held back until the wording was fixed, five runs with the work list found 90.0% of the reference items against 74.6% for five runs of a plain agent, and 80.5% against 50.9% of the items marked hard to find.
Thorough mode is an opt-in alternative to the work list. It has not been measured in its current form, so nothing here says how it compares.
What the numbers do not show:
- Ranking is not dependably better. Agreement between the agents' ranking and the reference ranking was 0.45 on the held-back codebase, with the work list and without it. Treat the order inside a band as a starting point for your own judgement.
- The fix rules did not stop one kind of over-reach. Every fix that was checked passed its check, with and without the work list, so the measurement cannot tell the two apart. But in one fix task the requirement was already met, and all five runs with the work list still added an extension that was not needed. The rules now say it plainly: if the requirement is already met, deliver no change and propose extras separately. That sentence was added afterwards and has not been measured.
- The sample is small. Four open source codebases, two to five runs per condition, and for each codebase one grader, who also built its reference list. The differences above are large for a sample of this size, but they are not a benchmark, and results on your system may differ.
- Only codebases were measured. The parts of the skill that cover cloud infrastructure, corporate systems and vendors, live observation, the key size field, the stopgap rule and the optional "smaller keys first" ranking have not been measured.
- One safety rule is newer than the measurements. The rule that what the agent reads is evidence and not instructions, and the sentence on what to do if a secret value reaches the agent, were added after the measurements and have not been measured.
- On the default path the lead re-checks the top of the list itself in the gap pass. In thorough mode in a single session the agent re-checks its own records. Both are weaker than independent verification. The report says which was done.
- It is an aid to a migration, not a certification. Passing the validators shows the output is well formed and consistent, not that every classification is right.
- Source and configuration show intent. What actually runs can differ. The skill looks at running systems, read-only, wherever it has access or the information is public, but it cannot observe what it cannot reach. Reports label every finding as verified live, code only or stated, and do not claim anything about a live system that was not observed live.
- A green CI run shows a change passes the checks a repository has. It does not show the migration is complete, and the skill never merges: a person reviews and merges each pull request.
- Corporate systems are mostly visible through documents and admin consoles, not repositories. Without a connector or a read-only role, their records are "stated" or need validation.
- Vendor answers are claims unless observed.
- The scanner is a first pass that points at places to read. It misses algorithms chosen by library defaults, generated configuration and anything not in the tree.
- Standards and product support are changing quickly. The skill cites its sources with dates and tells the agent to check the installed version and current documentation instead of relying on what the skill says.
npm testruns the script tests and checks that the sample output is valid. See CONTRIBUTING.md.
The structure of this skill (workflow, coverage ledger, independent verification, zero-dependency validators, domain companion files) is derived from Cloudflare's security-audit-skill, which is MIT licensed. The five-area map, blast radius, the live, code and stated labels, and the memo and chat summary are adapted from Factory's internal security-priorities skill. See NOTICE.md.
This project is released under the MIT License.
Report a security problem in this skill or its scripts to security@factory.com. See SECURITY.md.