The calm version of this week
No one has published a break of RSA or elliptic curves. That is still true at the end of a loud week. But two different things happened, and they are easy to mix up.
The first is a paper. On November 30, Anthropic published a paper, written with the help of its models, that describes a quantum algorithm for the lattice problem behind ML-KEM and ML-DSA, the new NIST post-quantum standards. It runs in quasi-polynomial time, which is a real result about the math. It is also wildly impractical. The Cryptography Incident Review Group looked at it and wrote that even 2^1000 quantum operations "would be far below its cost for the smallest parameter sets". Their advice was to keep migrating.
On December 2, the NSA told the owners of national security systems to "immediately accelerate the transition to post-quantum cryptography." The same day, ONCD, NSA and CISA put out a joint statement that is much calmer. Their assessment is that recent advances "do not present an immediate and widespread threat" to the cryptography in use, but that industry and government should "expeditiously upgrade." Amazon, Apple, Google, Microsoft, Cloudflare and others signed a statement backing the move to the NIST standards "as soon as possible." Cloudflare's CEO called them "post-AI" standards, and Cloudflare moved its own fully post-quantum target from 2029 to 2027. Rob Joyce, who used to run cybersecurity at the National Security Council, summed it up: "There is no break of RSA." And: "This is a strategic call to arms. It is not a tactical emergency."
The second is what those agencies were talking about. On December 5, Anthropic and OpenAI said their models, in testing, found weaknesses in some of the cryptography that protects the internet. They haven't said which, they say it isn't an immediate threat to the public, and they say it is unrelated to the lattice papers. As a precaution, Chrome and Edge will stop trusting P-256 certificate authority keys on March 15, 2027, and Windows drops P-256 roots on February 23, 2027.
The dates were already set before this week. Executive Order 14412, from June, requires federal high-value and high-impact systems to use post-quantum key establishment by the end of 2030 and post-quantum signatures by the end of 2031. Reports on the NSA's release say new national security system acquisitions have to meet CNSA 2.0 from January 1, 2027. And only 54% of the top million sites support post-quantum key exchange, 22% if you leave out Cloudflare.
The NSA's memo for national security systems, "Immediate Actions to Push Toward Post-Quantum," lists six steps, as reported by Ars Technica. The first one is not exciting. Find the systems that use the algorithms that need replacing. Make an inventory.
There is some irony in that. AI models are now finding weaknesses in the math. The most useful response for most teams this week is boring, deterministic software that lists where RSA and elliptic curves are used, the same way every time. We think that split is right in general: AI for discovery, programs for the work you repeat.
Tokens or a program
You can hand this job to an agent. Agent skills for it already exist, and they work by reading your code into a model. Every run pays tokens for that reading.
But an inventory is mostly lookup: find the calls, follow the imports, write down the algorithm and the key size. That part doesn't need a model. It needs a program that does it the same way every time. So this post is a small example of what deterministic static analysis can do, next to spending tokens on the same reading.
Writing the inventory as a workflow
We wanted the inventory as a program. So we wrote a workflow for the same job: one file, workflow.ts, that runs on the Codemod 2.0 engine (codemod@2.0.0), using the published pattern and library lists as a starting point. It is read-only. It has no network step, no AI step and no shell step.
An agent skill tells a model things like "check whether this call reaches a crypto library." In the workflow, that sentence becomes code.
The snippets below are trimmed from workflow.ts. The Codemod 2.0 API calls in them are step, forEachFile and files from the workflow runtime, and the node methods kind(), field(), text(), ancestors(), definition() and references(). Every other name, like analyzeJsFile, followIntoModule, statementSource, isRelativeModule or at, is a helper function defined in workflow.ts itself.
Each step has a title that says what it does, so the run reads like a checklist (workflow.ts, lines 96-99, reformatted):
const javascriptAndTypescript = await step(
"Check which JavaScript and TypeScript calls really reach a crypto library",
forEachFile(
{
include: [
"**/*.ts",
"**/*.mts",
"**/*.cts",
"**/*.tsx",
"**/*.js",
"**/*.cjs",
"**/*.mjs",
"**/*.jsx",
],
exclude: neverOpen,
semanticAnalysis: "workspace",
},
(file) => analyzeJsFile(file.path, file.text, jsLanguageOf(file.path), files),
),
);Inside that step, every call whose callee is imported, required, a Web Crypto global, or named like a crypto operation is followed with definition(). When the definition lands on an import, the workflow either stops at a package it knows, or follows the import into the repository's own module (lines 956-966, reformatted). Here node is where definition() landed, and at and find are small local helpers:
const at = (what: string): Hop => ({ file: declFile, line: lineOf(node), what });
const chain = [node, ...node.ancestors().slice(0, 5)];
const find = (k: string) => chain.find((n) => n.kind() === k);
const spec = find("import_specifier");
if (spec) {
const imported = spec.field("name")?.text() ?? spec.text();
const source = statementSource(spec) ?? "";
const hop = at(
`import { ${imported}${spec.field("alias") ? ` as ${spec.field("alias").text()}` : ""} } from "${source}"`,
);
if (isRelativeModule(source))
return followIntoModule(spec.field("name") ?? spec, hop, declFile, file, cx, depth);
return { t: "module", module: source, path: [imported], hops: [hop] };
}The same chase goes through aliases, import * as, default imports, require and its destructuring, dynamic import(), promisify, re-exports through barrel files, class fields, and objects a crypto call returned. Algorithm names are followed the same way, into constants defined in other files. references() adds one level of reach: where the enclosing function is used.
The verdict rules are short, and they are the same on every run. This part is plain TypeScript, and reviewFor is a helper that looks up the review file (lines 3233-3236, reformatted):
const fixes = {
algorithm: u.algorithmFixed && u.family !== "unknown",
key_bits: u.bitsFixed && u.bits !== null,
};
const codeDetermined = fixes.algorithm && fixes.key_bits && !u.kms;
const review = reviewFor(u);
const verdict = codeDetermined && review?.severity ? "confirmed" : "needs_validation";A finding is confirmed only when the code fixes both the algorithm and the key size, and a person has rated its severity in a review file. A scan does not rate severity. Everything else that reaches a crypto library is needs_validation, with the reason written down. A call named sign() that turns out to be the repository's own non-crypto code is rejected.
The workflow is published to the Codemod registry as @codemod/pqc-audit. Run it from inside the repository you want to scan:
cd your-repo
npx codemod@next @codemod/pqc-auditA run prints its steps as it goes. Here it is on the small sample service from the repository's test fixtures:
▸ List every file, and name the key and secret files without opening them
✓ List every file, and name the key and secret files without opening them (0.0s)
▸ Find every line that might use public-key crypto
✓ Find every line that might use public-key crypto (0.0s)
▸ Find crypto libraries declared in dependency manifests
✓ Find crypto libraries declared in dependency manifests (0.0s)
▸ Check which JavaScript and TypeScript calls really reach a crypto library
✓ Check which JavaScript and TypeScript calls really reach a crypto library (0.0s)
▸ Check which Python calls really reach a crypto library
✓ Check which Python calls really reach a crypto library (0.0s)
▸ Mark Rust, Go, Java and config lines that look like crypto (text match, not verified)
✓ Mark Rust, Go, Java and config lines that look like crypto (text match, not verified) (0.0s)
▸ Read the optional review file that rates confirmed findings
✓ Read the optional review file that rates confirmed findings (0.0s)
▸ Update the report files already in pqc-report/
✓ Update the report files already in pqc-report/ (0.0s)
▸ Write the report files that are not in pqc-report/ yet
✓ Write the report files that are not in pqc-report/ yet (0.0s)
6 need validation, 0 confirmed, 0 rejected · ECDH 4, RSA 2 · 6 text matches · open pqc-report/report.html
DoneWhat we measured
We checked the workflow against hand-made answer keys: lists of known public-key uses in real repositories, labeled by people who never saw the workflow. We also ran it on three "negative" repositories that are full of words like sign and encrypt but use no public-key crypto. The full report is in the repository.
Cheaper. The workflow uses 0 model tokens. There is no model in the loop.
Faster. On our largest target, our own private application repository with 5,053 files, one run took 36.6 seconds and peaked at 349 MiB of memory. The other targets took between 0.3 and 5.1 seconds.
Reliable.
- 0 false findings on all three negative repositories, at every stage.
- Two runs per target, byte-identical output on 11 of 11 targets at the frozen stage.
Private. No network step, no AI step, no shell step. It never changes existing files; the report goes in pqc-report/. Key and secret files are named in the output but never opened. Quoted code in the evidence is redacted. We scanned all 22 release outputs for 4,145 key-like strings taken from the targets' own files, plus PEM and JWT shapes. There were 0 hits.
Try it
cd your-repo
npx codemod@next @codemod/pqc-auditOpen pqc-report/report.html. It never changes your existing files; it adds its report under pqc-report/ (REPORT.md, findings.json, cbom.json, report.html), which is safe to commit. If your working tree has uncommitted changes, commit or stash first.
On the sample service, pqc-report/REPORT.md has rows like these:
| Findings: confirmed | 0 |
| Findings: needs validation | 6 |
| of which the code fixes algorithm and key size | 4 |
| needs_validation | src/auth/tokens.js:11 | jsonwebtoken sign | jwt-sign | RSA | RS256 | - | alg | - |
| needs_validation | src/exports/envelope.js:8 | node:crypto createECDH | key-agreement | ECDH | ECDH P-256 | 256 | alg+size | - |Each finding comes with the chain of hops that resolved it, for example (shortened) require("crypto") → const sender = crypto.createECDH('prime256v1') → sender.computeSecret(), and the reason it is not confirmed yet.
To move a finding to confirmed, add a review file, .pqc-review.json, with a severity for that file and line. That is the place where a person, or an agent, writes down the judgment the scan does not make.
The output also feeds whatever agent you use next. Every run also writes, under pqc-report/factory/, its findings and a coverage ledger in the schema of Factory's migrate-post-quantum skill. That output passes the skill's own validators on every target we ran, so any agent can start from that file instead of reading the whole repository again.
The workflow, the fixtures and the full report are at github.com/devagrawal09/pqc-audit. The starting pattern and library lists, the findings schema, its validators and the sample service come from Factory's migrate-post-quantum under its MIT license, with full attribution in the repository.
If there is an agent skill you run over and over and wish behaved the same way every time, send it to us. We would like to know which one you want turned into a workflow next.
Cost at scale
An AI pass pays tokens to read the code, on every run. So its cost grows with the size of the codebase times the number of runs. And two runs can give different answers, so a diff between them doesn't tell you much.
The workflow pays CPU time instead, and 0 tokens. On our largest target, 5,053 files, a run took 36.6 seconds. Run it again and you get the same output, so a diff shows exactly what changed.
Now picture 1,000 repos, every PR, for a year.
| AI pass | Workflow | |
|---|---|---|
| You pay per run in | tokens to read the code | CPU seconds, 0 tokens |
| Cost grows with | repo size × runs, in tokens | repo size × runs, in CPU time |
| Same answer each run | not guaranteed | yes, so you can diff it |
A rough estimate from our own number: if every repo were as big as our largest one, each 1,000 PRs would cost about 10 CPU-hours of scanning (1,000 × 36.6 s), and no tokens. So the workflow is the one you want running on every PR. Save the tokens for the decisions and fixes that need judgment.
This is a small example of the approach. The same deterministic engine runs migrations and other audits too.
