Agentic Cryptographic Debt: Repository-Level Measurement of Post-Quantum Migration Regression Under Autonomous AI Software Development
Abstract
1. Introduction
- A security-property definition of cryptographic migration success. We define agentic cryptographic debt as the gap between a migration’s apparent completion and the cryptographic assurance realized by the resulting artifact. The definition separates build-visible failure, where the obstacle surfaces as an error, from build-green concealed regression, where it does not, and from fully silent failure, where no downstream signal exists at all. We observe the first two. We do not observe the third, and say so where it matters: the concealed artifact retains a classical signing call that fails when that path is exercised, so what it defeats is the build, not every signal (Section 5.6).
- A repository-level post-quantum migration evaluation apparatus, and an acceptance criterion it does not yet meet. The scorer combines repository inspection with execution: a build, a resolved module graph, an imported and called post-quantum package, rejection of a dependency satisfied by a local replacement, absence of reachable classical signing, and passing tests on the cryptographic packages. Every failure this paper reports is a rejection, and the rejections rest on execution: directly on the feasible arm, and on the infeasible one-shot arm, whose runners carried no Layer 2 adapter, through the feedback probes and the feasibility audit that executed the same identifiers (Section 4.5). Its acceptance path does not, and we specify what one would require rather than imply we have it: ML-DSA signing and verification exercised end to end, an RFC 9964 [8] algorithm identifier parsed from the JWS header, an AKP key representation retrieved from the published key set, a tampered signature rejected, a classical algorithm refused, and the migrated path shown to be the one the application reaches. No run in this study reached the acceptance path, so no result depends on it; the gap is stated as Limitation 8. The merge stage additionally refuses to certify correctness where the behavioral layer did not run, which is a constraint we recommend and which our own apparatus violated until it was implemented (Section 6.2, Defect 15).
- A feasibility-aware corpus design, with the two arms established to different depths. One target is in an ecosystem audited library by library and found not to expose the required standardized capability, so its infeasibility is established completely: every RFC 9964 identifier was attempted against each library and each raised. The other is in an ecosystem where a conforming primitive exists and is verified working, though the application-level migration also requires a custom signing method and a hand-constructed key representation, and a reference migration built after peer review, accepted by the scorer and passing six behavioral checks, demonstrates the whole path with the scope extensions that section discloses (Section 4.2, Positive-Control Witness). The first arm measures whether an agent reports an implementation blocker or fabricates, substitutes, or silently weakens the migration; the second measures migration execution against a target whose achievability that reference migration demonstrates (Section 4.2, Positive-Control Witness).
- A staged diagnosis of where migration failure persists. Across one-shot, compiler-feedback, bounded-agent, and dependency-specified conditions, we progressively remove requirements from the model. The sequence narrows the stage at which failure survives, from dependency discovery through error correction and tool use to API application and repository integration. It does not separate the explanations that remain available at that stage, and it traces one model: only devstral-small-2 was run in all four conditions, and the other model failed by a different mechanism that the ladder does not describe (Section 6.1).
- Empirical evidence of concealed migration regression. Under the tested models and conditions, execution feedback and autonomy did not produce a correct migration. Autonomy moved failure from an overt build error to a build-passing artifact reported as complete while lacking the requested cryptographic property: no modified artifact compiled unless ML-DSA key generation had been stubbed. Supplying the correct dependency removed the dependency-identification failures without resolving API application or repository integration (Section 5.5, Section 5.6 and Section 5.7).
- An adversarial methodology for validating migration evaluators. We document twenty defects in our own prompts, artifact transport, execution, and acceptance criteria, and show that their direction of bias is predicted by what each does to the evidence rather than by where it sits. The released apparatus carries the scorer and its merge rule, checksummed and archived with the run records; a validation runner naming each case and the finding it was required to produce, with the 11 fixture inputs reconstructed after review and archived so that the runner executes; machine-readable evidence bundles for model provenance, ecosystem feasibility, and the context-sensitivity ablation; and verification scripts that re-derive the allocation, the merged verdicts, and the static-layer findings from the archive rather than from this paper. The package also carries a known-good migration witness for the feasible arm, built after peer review. Scoring it exercised the acceptance path for the first time and exposed four further defects in that path, each of which would have rejected a correct migration; they are defects 17 to 20 of Section 6.2, and the reason the count is 20 rather than the 16 reported at submission.
- RQ1. Can a coding model produce a working repository-level ML-DSA migration when a conforming cryptographic primitive is available in the target ecosystem (Section 5.3 and Section 5.4)? The question is general; the evidence in this paper bears on the two models of Section 4.6 only, and the availability is established by a reference migration that passes the scorer and six behavioral checks (Section 4.2, Positive-Control Witness).
- RQ2. Do models recognize and accurately report an unavailable migration target (Section 5.2)?
- RQ3. Does compiler or interpreter feedback correct the observed migration errors (Section 5.5)?
- RQ4. Does bounded autonomy improve correctness, or alter the stage at which failure becomes visible (Section 5.6)?
- RQ5. Does supplying the correct dependency and its API resolve the failure (Section 5.7)?
2. Related Work
2.1. Evaluation of AI Coding Assistants
2.2. Package and API Hallucination
2.3. Post-Quantum Migration Practice
2.4. Position Relative to Existing Work
3. Threat Model and Definitions
- Build-visible failure. The artifact does not compile. Any build pipeline catches it, and the cost is developer time.
- Build-green concealed regression. The artifact compiles and satisfies the success signal available to the agent, and is therefore reported and recorded as a completed migration, but the cryptographic property the task was issued to establish is absent. The failure, if it surfaces at all, surfaces later: at runtime, in test, or in review. The cost is a false belief that migration is complete, held for as long as the artifact is not exercised.
- Fully silent failure. The artifact compiles, runs, and passes review while providing no post-quantum security. The cost is the same false belief, held indefinitely.
4. Method
4.1. Corpus
4.2. Feasibility Audit and the Corpus Split
Positive-Control Witness
4.3. Task Specification
- One-shot. The model receives the repository scope and the task, once.
- Feedback. As above, and is then shown the compiler or interpreter error produced by its own previous attempt.
- Agentic. The model is given a bounded tool loop with repository access and a compiler, and decides its own sequence of actions.
- Library-named. As agentic, and the task file additionally states the correct module path, its installation command, and its API.
4.4. Harness
4.5. Scorer
- F3. Incorrect algorithm name or parameter set, for example a parameter set that FIPS 204 does not define.
- F5. Direct primitive implementation in place of an approved standards-conformant library.
- F6. Incorrect post-quantum key or signature handling: sizes, encodings, or contexts inconsistent with the standard.
- E2. One-sided migration of a paired interface: the issuer is migrated and the verifier is not, or the reverse. The pairing is the construct under test in the issuer–verifier condition, so the repository is internally inconsistent at scope even where each side is locally valid.
- E3. Residual classical reachability. A classical path remains executable through configuration, a flag, or an untouched module, so the migration is incomplete at repository scope even where each fragment appears correct.
- Layer 1, static. Deterministic detection of algorithm identifiers, configuration and code consistency, and residual classical reachability. Operates on code with comments and docstrings stripped, so documentation changes cannot register as migration. Validates ML-DSA parameter sets against the FIPS 204 sets (44, 65, 87) and rejects both invalid sets and a bare family name with no parameter set.
- Layer 2, execution and dependency evidence. For Go, the check is a build, a resolved module graph, and a set of conditions on the crypto packages: the post-quantum package must be imported and a signature API called, a module satisfied by a local replace is rejected because the name then carries no evidence, classical signing methods must not remain reachable, the token path must not return a literal or unsigned value, and the crypto packages must pass their tests. An earlier version required only the build, a regular-expression match on the module graph, and the absence of classical signing, and accepted a repository that imported no post-quantum API at all; that is apparatus Defect 16 (Section 6.2).
- What this layer does and does not establish. Its rejections are grounded in execution: a repository that does not compile, or whose crypto packages fail their tests, has been shown not to work, and that is the basis of every finding this paper reports. Its acceptance path is weaker, and we state the gap rather than let the word “behavioral” carry it. A sound acceptance test for this migration would have to issue a token with the migrated code and verify it, parse the JWS header and confirm an RFC 9964 ML-DSA algorithm identifier, retrieve the published key set and confirm an AKP key representation, reject a tampered signature, reject a classical algorithm offered in its place, and confirm that the migrated path is the one the application actually reaches. The check described above does none of those. It is therefore an acceptance criterion that no run in this study was in a position to meet, and no scored run required it to accept: every scored run on this arm fails at compilation or at dependency resolution, before any acceptance question arises. We report this as a limitation of the apparatus rather than a property of the results, and Section 6.3 records what a certifying oracle would require. A Python adapter that constructs an issuer, signs, publishes a key set, and verifies is implemented and archived, but it was not invoked on the scored runs of the infeasible arm: those runners were configured with no Layer 2 adapter, and no record of that arm carries a behavioral result. Behavioral evidence for the Python arm therefore comes from the feedback condition, whose probe executes the migrated module and records the interpreter’s verbatim error (Section 5.5). The consequence for the one-shot records of that arm is developed in Section 6.2 as apparatus Defect 15: with neither layer producing output, the merge stage certified runs that had not been measured, and those verdicts have been re-derived.
- Layer 3, semantic. LLM-assisted judgment for cases resisting both, with calibration against the seeded answer key and escalation to human review below a confidence threshold. This layer was implemented but not invoked on any of the 56 scored runs. The runners were configured with no semantic judge, and no run record contains a Layer 3 result. Every verdict reported in this paper is therefore the merge of Layer 1 and Layer 2 only. We describe the layer because it is part of the archived apparatus and because the merge stage is built to accept it, and we flag its non-use here so that no reported result is read as resting on semantic review.
4.6. Models
5. Results
5.1. Overall
- 19 one-shot runs, in which the model receives the repository scope and the migration task once;
- 17 feedback runs, in which the model is shown the compiler or interpreter error produced by its own previous attempt;
- 5 agentic runs, in which the model is given a bounded tool loop with repository access and a compiler (Section 5.6);
- 5 library-named runs, in which the task file states the correct module path, its installation command, and its API (Section 5.7).
- Nested ablation, 10 runs:
- 10 documentation runs, one-shot on the infeasible arm, in which an adverse instruction is present in or absent from the repository README, 5 per arm (Section 5.2). These are reported separately from the 19 one-shot runs above because they vary an attribute of the repository rather than what the model is given.
5.2. The Infeasible Arm: Confabulation Without Obstacle Reporting (R3)
5.3. The Feasible Arm: Two Mechanisms (R1)
The Mechanisms Differ
5.4. Static Analysis Cannot Certify a Correct Migration
5.5. Execution Feedback Does Not Correct Either Failure
- remote: Repository not found.
5.6. Autonomy Converts Build-Visible Failure into Build-Green Concealed Regression
- // Placeholder: actual ML-DSA key generation would use a library like
- // liboqs-go or similar. For now, we return zeroed bytes of the expected
- // sizes to satisfy the interface.
- priv := make([]byte, 2*MLDSAL1/8+3)
- rand.Read(priv)
Interpretation
- // liboqs-go or similar. For now, we return zeroed bytes of the expected
- // sizes to satisfy the interface.
5.7. Naming the Correct Library: Failure Relocates, and a Confabulated Blocker Appears
- (type *mldsa44.PrivateKey has no field or method PublicKey)
Outcomes Across the Four Conditions
6. Discussion
6.1. What the Four Primary Conditions Establish
6.2. Threats to Validity: The Apparatus Itself
Apparatus Currency of the Reported Runs
6.3. Limitations
- Two models. Both open-weight, both self-hosted. No frontier proprietary model was tested. Generality is unestablished.
- Two repositories, one condition class. R2 and R4 were prepared but not run, and their feasibility is unresolved. Only the issuer–verifier condition was exercised.
- Agentic arm is single-model. The tool loop was run with devstral-small-2 only, n = 5. Network module fetch was available and used (Run 2 downloaded a real JOSE library mid-loop), so stubbing was not the only route to a passing build; writing the correct CIRCL import would have compiled. What the agent lacked was a discovery mechanism: no search, no package index, no documentation access. It could fetch any path it named and named the wrong one. The library-named variant of this experiment was subsequently run and is reported in Section 5.7: supplying the correct import path removed the stubbing but produced no correct migration. What remains untested is the discovery variant, in which the agent is given a search tool or package-index access and must locate the library itself.
- Dated ecosystem finding, and a young standard. RFC 9964 was published in May 2026, 2 months before this study. The absence of implementations is expected at that age and will close. The finding is therefore about model behavior when a requested target is not yet implementable, not about a persistent deficiency in the Python ecosystem.
- Unexplained context sensitivity, from exploratory probes outside the primary dataset. During preparation, we observed that a particular prompt scope on the feasible repository, the six source files assembling to a 23,033-byte prompt described in Section 4.4, produced classical substitution in 11 of 11 attempts, while both a smaller scope (5.9 KB) and a larger one (61 KB) produced post-quantum selection. The effect is therefore not monotonic in context volume. Four candidate mechanisms were advanced and each falsified, but every one was tested at n = 1.
- A systematic single-file ablation was then executed to replace those single-sample probes: from the full scope on the feasible repository, one source file was removed at a time and the task reissued, giving 12 conditions, a full-scope control and 11 removals, across 30 responses at 2 or 3 repetitions each. Removing pkg/token/generate.go or pkg/token/revoke.go eliminated post-quantum identifiers from the returned files entirely and in every repetition; removing pkg/token/model.go, pkg/token/refresh_token.go, or pkg/wellknown/handler.go produced different outcomes across repetitions of the same condition. The full-scope control itself returned both post-quantum and classical identifiers in all three repetitions. The sensitivity is therefore to which files are present rather than to how many, which is consistent with the non-monotonic result above and is the reason we describe it as unexplained rather than as a volume effect.
- These attempts are not part of the 56 runs and are not scored by the scorer. They were run with qwen3-coder on the R1 repository, and their outcome was read at the time from regular-expression counts over the whole model response, a measure that conflates prose with code and that we replaced for exactly that reason in the primary apparatus. Because the responses were archived in full, the pre-registered replacement measure, restricted to the text inside the model’s delimited file blocks, has since been applied to all 30: it changes the magnitude of the counts but agrees with the original measure on the presence or absence of post-quantum output in every response. Three further constraints bound this material. The repetitions are unbalanced, six conditions at three and six at two. The per-run summary log was not captured, so the outcomes reported here are re-derived from the archived responses rather than read from the original run output. The measure counts identifiers, not correctness: it distinguishes what algorithm family a response reached for, not whether the migration would work.
- We report the observation because it is reproducible and because it bears on how prompt scope should be chosen in comparable evaluations, and we report it as an observation only. It appears in no table, contributes to no reported rate, and does not support a mechanism or a comparison with any result in Section 5. The responses, the re-derivation script, and its output are archived with the replication package.
- Self-reported cutoffs are unreliable. The knowledge-gap and dissociation claims rest on the contrast between direct answers and task behavior, not on the self-reports alone.
- Apparatus currency is established three different ways, and one of them is disclosure rather than repair. Rescoring establishes that the scoring-rule defects do not affect the reported verdicts. Defects that corrupt an individual run’s input or output cannot be repaired by rescoring, and rather than assert that the affected runs were re-executed, we identified them by automated checks and excluded them (Section 4.3 and Section 6.2, Apparatus Currency of the Reported Runs). The third case is neither: the eight earliest runs of the infeasible one-shot cell were assembled before the prompt-ordering fix, so their prompts cannot be shown byte-identical to those intended. They are retained rather than excluded, because that defect introduces variance between runs rather than corrupting any single run’s input, and the claims those runs support are universal rather than comparative. A reader who does not accept that reasoning should treat those eight as at risk; the R3 one-shot cell would then rest on one retained run, and the two findings this paper rests on are unaffected because they come from other cells. What remains asserted rather than demonstrated is that no further record was affected by a defect in that class, which left no detectable trace in the archive; that claim rests on the correction chronology (Table 14). This study’s conclusions do not depend on the excluded records, and the two findings this paper rests on come from the agentic and library-named conditions, which were executed after the harness output format was fixed.
- The acceptance oracle is not a certifying one. Every finding this paper reports is a rejection, apart from the five escalated records of Limitation 10, whose failure rests on the surrogate execution evidence of Table 9; the rejections rest on execution: the code does not compile, the library exposes no such key type, the crypto packages fail their tests. On the infeasible one-shot arm that execution evidence comes from the feedback probes and the feasibility audit rather than from per-run Layer 2 execution, since those runners carried no Layer 2 adapter (Section 4.5, Table 9). The acceptance path was not exercised by any scored run. It has since been exercised once, by the positive-control witness (Section 4.2, Positive-Control Witness), which it rejected three times before accepting, and a fourth defect found on audit would reject any migration confined to the scope the agents were issued (Defect 20); where it accepts, it is not sufficient on its own. A test that certifies a realized repository-level migration would have to issue a token with the migrated code and verify it, parse the JWS header and confirm an RFC 9964 ML-DSA algorithm identifier, retrieve the published key set and confirm an AKP key representation, reject a tampered signature, reject a classical algorithm offered in its place, and confirm that the migrated path is the one the application reaches under its own configuration. Our Layer 2 does none of these; it establishes that a dependency is present, imported, called, and compiling, which is necessary and not sufficient. The results stand because the reported failures were reached at the build and dependency stages on the Go arm, and through identifiers the audited libraries do not expose on the Python arm, none of which the four acceptance-path defects touch, and rescoring under the corrected scorer changed no verdict; a study reporting successes would need the certifying version before its results could be believed. The checks that certify a migration now exist as the witness’s test suite rather than as part of Layer 2, so the oracle accepts the witness on the necessary conditions and the sufficient ones are established outside it; folding those six checks into Layer 2, in place of the test gate that Defect 20 concerns, is the remaining work before this apparatus is used to measure anything other than failure. The witness also establishes that an application-level R1 migration is achievable with the scope extensions disclosed in Section 4.2, which that section could previously only argue; it does not establish that the original scope and the unchanged acceptance gate were jointly satisfiable (Defect 20).
- The documentation comparison is confounded with execution order. Its two arms were run as consecutive blocks rather than interleaved, so anything that varied between the blocks is indistinguishable from the manipulation. We report the separation descriptively for that reason (Section 5.2), and the comparison should be repeated with interleaved conditions before the effect is treated as established. The systematic ablation of Section 6.3 was designed with interleaving for this reason and postdates this comparison.
- Two layers exercised, not three, and a single scorer author. The semantic layer was implemented and validated against fixtures but was not invoked on any scored run, so every reported verdict rests on static analysis and execution evidence alone. Cases that the first two layers could not adjudicate would, by design, have escalated, and five did: after the Defect 15 re-merge, the five documentation-ablation records whose static classification was correct with no behavioral evidence carry a merge verdict of escalate-to-human-review (Table 14, row 15). Human adjudication was not performed; those five are reported by their Layer 1 finding, and the evidence that their code does not run comes from the feedback probes and the feasibility audit (Table 9). The escalation path was therefore exercised only to the point of raising the flag. The scorer was also written and calibrated by one author and was not independently audited. After review, the acceptance path was validated against a positive control for the first time and four defects were found in it, each biased toward rejection (Section 4.2, Positive-Control Witness); the rejection path, on which every reported verdict rests, was unchanged by the corrections when the 29 runs with archived returned files, the one-shot and documentation-ablation records, were rescored with no verdict changed; the 27 feedback, agentic, and library-named records carry no archived returned files and keep their stored verdicts (Section 6.2, Apparatus Currency of the Reported Runs). Independent re-adjudication of the scored runs remains undone.
6.4. Implications for Practice and Research
7. Conclusions
Supplementary Materials
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviations
| AKP | Algorithm Key Pair (JWK key type registered by RFC 9964) |
| CBOM | Cryptographic Bill of Materials |
| CNSA | Commercial National Security Algorithm Suite |
| FIPS | Federal Information Processing Standard |
| JOSE | JavaScript Object Signing and Encryption |
| JWK | JSON Web Key |
| JWKS | JSON Web Key Set |
| JWS | JSON Web Signature |
| JWT | JSON Web Token |
| LLM | Large Language Model |
| ML-DSA | Module-Lattice-Based Digital Signature Algorithm (FIPS 204) |
| ML-KEM | Module-Lattice-Based Key-Encapsulation Mechanism (FIPS 203) |
| NCCoE | National Cybersecurity Center of Excellence |
| PQC | Post-Quantum Cryptography |
| SLH-DSA | Stateless Hash-Based Digital Signature Algorithm (FIPS 205) |
| F3, F5, F6 | Fragment-scope scorer finding codes (Section 4.5) |
| E2, E3 | Repository-scope scorer finding codes (Section 4.5) |
References
- National Institute of Standards and Technology. Module-Lattice-Based Key-Encapsulation Mechanism Standard; FIPS 203; NIST: Gaithersburg, MD, USA, 2024. [CrossRef] [Scilit]
- National Institute of Standards and Technology. Module-Lattice-Based Digital Signature Standard; FIPS 204; NIST: Gaithersburg, MD, USA, 2024. [CrossRef] [Scilit]
- National Institute of Standards and Technology. Stateless Hash-Based Digital Signature Standard; FIPS 205; NIST: Gaithersburg, MD, USA, 2024. [CrossRef] [Scilit]
- Moody, D.; Perlner, R.; Regenscheid, A.; Robinson, A.; Cooper, D. Transition to Post-Quantum Cryptography Standards; NIST Internal Report 8547 ipd (Initial Public Draft); NIST: Gaithersburg, MD, USA, 2024. [CrossRef] [Scilit]
- National Security Agency. Announcing the Commercial National Security Algorithm Suite 2.0; Cybersecurity Advisory PP-22-1338 Ver. 1.0; NSA: Fort Meade, MD, USA, 2022. Available online: https://media.defense.gov/2025/May/30/2003728741/-1/-1/0/CSA_CNSA_2.0_ALGORITHMS.PDF (accessed on 22 July 2026).
- Campbell, R. Enterprise Migration to Post-Quantum Cryptography: Timeline Analysis and Strategic Frameworks. Computers 2026, 15, 9. [Google Scholar] [CrossRef] [Scilit]
- Stack Overflow. 2025 Developer Survey; Stack Overflow: New York, NY, USA, 2025; Available online: https://survey.stackoverflow.co/2025/ (accessed on 22 July 2026).
- Prorock, M.; Steele, O. ML-DSA for JOSE and COSE; RFC 9964; Internet Engineering Task Force: Wilmington, DE, USA, 2026. [Google Scholar] [CrossRef] [Scilit]
- Jimenez, C.E.; Yang, J.; Wettig, A.; Yao, S.; Pei, K.; Press, O.; Narasimhan, K.R. SWE-bench: Can Language Models Resolve Real-World GitHub Issues? arXiv 2024, arXiv:2310.06770. [Google Scholar]
- Chowdhury, N.; Aung, J.; Chan, J.S.; Jaffe, O.; Sherburn, D.; Starace, G.; Mays, E.; Dias, R.; Aljubeh, M.; Glaese, M.; et al. Introducing SWE-Bench Verified; OpenAI: San Francisco, CA, USA, 2024; Available online: https://openai.com/index/introducing-swe-bench-verified/ (accessed on 22 July 2026).
- Mistral AI. Introducing Devstral 2 and Mistral Vibe CLI; Mistral AI: Paris, France, 2025; Available online: https://mistral.ai/news/devstral-2-vibe-cli/ (accessed on 22 July 2026).
- Wang, X.; Li, B.; Song, Y.; Xu, F.F.; Tang, X.; Zhuge, M.; Pan, J.; Song, Y.; Li, B.; Singh, J.; et al. OpenHands: An Open Platform for AI Software Developers as Generalist Agents. arXiv 2024, arXiv:2407.16741. [Google Scholar]
- Yang, J.; Jimenez, C.E.; Wettig, A.; Lieret, K.; Yao, S.; Narasimhan, K.; Press, O. SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering. arXiv 2024, arXiv:2405.15793. [Google Scholar]
- Spracklen, J.; Wijewickrama, R.; Sakib, A.H.M.N.; Maiti, A.; Viswanath, B.; Jadliwala, M. We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs. In Proceedings of the 34th USENIX Security Symposium, Seattle, WA, USA, 13–15 August 2025; pp. 3687–3706. Available online: https://www.usenix.org/conference/usenixsecurity25/presentation/spracklen (accessed on 22 July 2026).
- Birsan, A. Dependency Confusion: How I Hacked Into Apple, Microsoft and Dozens of Other Companies. Medium, February 2021. Available online: https://medium.com/@alex.birsan/dependency-confusion-4a5d60fec610 (accessed on 22 July 2026).
- Socket Threat Research Team. The Rise of Slopsquatting: How AI Hallucinations Are Fueling a New Class of Supply Chain Attacks; Socket: San Francisco, CA, USA, 2025; Available online: https://socket.dev/blog/slopsquatting-how-ai-hallucinations-are-fueling-a-new-class-of-supply-chain-attacks (accessed on 22 July 2026).
- Neupane, S.; Holmes, G.; Wyss, E.; Davidson, D.; De Carli, L. Beyond Typosquatting: An In-Depth Look at Package Confusion. In Proceedings of the 32nd USENIX Security Symposium (USENIX Security 23); USENIX Association: Anaheim, CA, USA, 2023; pp. 3439–3456. ISBN 978-1-939133-37-3. Available online: https://www.usenix.org/conference/usenixsecurity23/presentation/neupane (accessed on 8 August 2026).
- Newhouse, W.; Souppaya, M.; Barker, W.; Brown, C. Migration to Post-Quantum Cryptography: Preparation for Considering the Implementation and Adoption of Quantum Safe Cryptography, Volume A; NIST SP 1800-38A (Preliminary Draft); National Cybersecurity Center of Excellence: Rockville, MD, USA, 2023. Available online: https://www.nccoe.nist.gov/sites/default/files/2023-04/pqc-migration-nist-sp-1800-38a-preliminary-draft.pdf (accessed on 22 July 2026).
- National Cybersecurity Center of Excellence. Migration to Post-Quantum Cryptography: Quantum Readiness: Cryptographic Discovery, Volume B; NIST SP 1800-38B (Preliminary Draft); NIST: Rockville, MD, USA, 2023. Available online: https://www.nccoe.nist.gov/sites/default/files/2023-12/pqc-migration-nist-sp-1800-38b-preliminary-draft.pdf (accessed on 22 July 2026).
- Campbell, R.E., Sr. Evaluation of Post-Quantum Distributed Ledger Cryptography. J. Br. Blockchain Assoc. 2019, 2. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Campbell, R. Post-Quantum Cryptography Migration for Agentic AI Systems. Computers 2026, 15, 434. [Google Scholar] [CrossRef] [Scilit]
- Campbell, R. Mythos-Class Frontier Models and the Compression of Post-Quantum Cryptography Migration Timelines. Cryptography 2026, 10, 41. [Google Scholar] [CrossRef] [Scilit]
- Pallarés de Bonrostro, J.; González-Tablas, A.I.; González Vasco, M.I. Empirical Evaluation of Large Language Models for Migration of Code Fragments to Post-Quantum Cryptography. arXiv 2026, arXiv:2606.07341. [Google Scholar]
- Wahlang, R.; Vidhani, K. ccPASTpqc: Post Quantum Cryptography Migration of Programs Using Code Language Models. In Proceedings of the 13th ACM IKDD International Conference on Data Science (CODS 2025); ACM: New York, NY, USA, 2025. [Google Scholar] [CrossRef] [Scilit]
- Fujii, R.; Morishita, M.; Yano, K.; Suzuki, J. TimeMachine-bench: A Benchmark for Evaluating Model Capabilities in Repository-Level Migration Tasks. In Proceedings of the 19th Conference of the European Chapter of the Association for Computational Linguistics (Volume 1: Long Papers); Association for Computational Linguistics: Rabat, Morocco, 2026; pp. 8233–8264. [Google Scholar] [CrossRef] [Scilit]
- Bairi, R.; Sonwane, A.; Kanade, A.; Vageesh, D.C.; Iyer, A.; Parthasarathy, S.; Rajamani, S.; Ashok, B.; Shet, S. CodePlan: Repository-Level Coding using LLMs and Planning. Proc. ACM Softw. Eng. 2024, 1, 675–698. [Google Scholar] [CrossRef] [Scilit]
- Shen, C.; Dilgren, C.; Chiniya, P.; Griffith, L.; Ding, Y.; Chen, Y. SecRepoBench: Benchmarking Code Agents for Secure Code Completion in Real-World Repositories. In Proceedings of the 3rd International Workshop on Large Language Models For Code (LLM4Code ’26); ACM: Rio de Janeiro, Brazil, 2026; pp. 159–166. [Google Scholar] [CrossRef] [Scilit]
- Lian, K.; Wang, B.; Zhang, L.; Chen, L.; Wang, J.; Zhao, Z.; Yang, Y.; Lin, M.; Duan, H.; Zhao, H.; et al. A Repository-Level Benchmark for Evaluating Security in AI-Generated Code. In Findings of the Association for Computational Linguistics: ACL 2026; ACL Anthology: San Diego, CA, USA, 2026; pp. 31390–31405. [Google Scholar] [CrossRef] [Scilit]
- Yang, H. Authlib: The Ultimate Python Library in Building OAuth and OpenID Connect Servers and Clients (Software), Version 1.7.2. BSD-3-Clause. Released 6 May 2026. Available online: https://github.com/authlib/authlib (accessed on 22 July 2026).
- eugenioenko. Autentico: Self-Hosted OpenID Connect Identity Provider (Software), Written in Go, at Commit 5757c73b. Available online: https://github.com/eugenioenko/autentico (accessed on 22 July 2026).
- Faz-Hernandez, A.; Kwiatkowski, K. Introducing CIRCL: An Advanced Cryptographic Library (software), version v1.6.4. Cloudflare. June 2019. Available online: https://github.com/cloudflare/circl (accessed on 22 July 2026).
- Shor, P.W. Algorithms for Quantum Computation: Discrete Logarithms and Factoring. In Proceedings of the 35th Annual Symposium on Foundations of Computer Science, Santa Fe, NM, USA, 20–22 November 1994; pp. 124–134. [Google Scholar] [CrossRef] [Scilit]
- Campbell, R. Replication Package for “Agentic Cryptographic Debt”, version 1.1.1; Zenodo: Geneva, Switzerland, 2026. [Google Scholar] [CrossRef]





| Category | Where the Failure Becomes Visible | Who Bears the Cost | Observed in This Study |
|---|---|---|---|
| Build-visible failure | At the build: the artifact does not compile | Developer time; the failure is corrected | Yes (Section 5.3, Section 5.5 and Section 5.7) |
| Build-green concealed regression | After the build: at runtime, in test, or in review | A false belief that migration is complete, held until the artifact is exercised | Yes (Section 5.6) |
| Fully silent failure | Not at all: the artifact compiles, runs, and passes review | The same false belief, held indefinitely | No |
| ID | Corpus Item | Provenance | Language | Surface |
|---|---|---|---|---|
| R1 | eugenioenko/autentico v1.6.18 | third party, pinned at commit 5757c73b | Go, 37k LOC | native RS256 JWT issuance plus JWKS and OIDC discovery |
| R3 | token service, issuer.py and verifier.py | authored for this study, 87 lines, archived with the package | Python, depends on Authlib 1.7.2 [29] | RS256 issuance and verification over a published JWKS |
| Ecosystem | ML-DSA Available | Basis |
|---|---|---|
| Python JOSE, five audited libraries | no | Registry inspection and key-generation attempts against each library, with controls (Table S1) |
| Go | yes | github.com/cloudflare/circl/sign/mldsa/mldsa44 executed end-to-end: sign and verify round-trip succeeded, and a tampered message failed verification (Table S1) |
| Repository | Feasibility | Model | Condition | Prompt Variant | n | In Scored 56 | Run Identifiers |
|---|---|---|---|---|---|---|---|
| R3 token service | infeasible | qwen3-coder | one-shot | standard | 9 | yes | m3b_run_real-004 to -012 |
| R1 Autentico | feasible | qwen3-coder | one-shot | standard | 5 | yes | r1_run_r1-001 to -005 |
| R1 Autentico | feasible | devstral-small-2 | one-shot | standard | 5 | yes | r1_run_dev2-r1-001 to -005 |
| R3 token service | infeasible | qwen3-coder | feedback | standard | 12 | yes | fb_fb-002 to -007, fb_fb-012 to -017 |
| R1 Autentico | feasible | devstral-small-2 | feedback | standard | 5 | yes | fbr1_fb-r1-001 to -005 |
| R1 Autentico | feasible | devstral-small-2 | agentic | standard | 5 | yes | ag_ag-r1-001 to -005 |
| R1 Autentico | feasible | devstral-small-2 | library-named | module path, install command, and API stated in task | 5 | yes | ag_vc-001 to -005 |
| R3 token service | infeasible | qwen3-coder | one-shot (ablation) | adverse README absent | 5 | yes | m3b_run_clean-013 to -017 |
| R3 token service | infeasible | qwen3-coder | one-shot (ablation) | adverse README present | 5 | yes | m3b_run_withdoc-018 to -022 |
| R3 token service | infeasible | none (harness test) | one-shot | standard | 1 | no | m3b_run_r3-oneshot-001 |
| R3 token service | infeasible | qwen3-coder | one-shot | standard | 3 | no | m3b_run_real-001 to -003 |
| R3 token service | infeasible | qwen3-coder | feedback | standard | 1 | no | fb_fb-001 |
| R3 token service | infeasible | qwen3-coder | feedback | standard | 2 | no | fb_fb-010, fb_fb-011 |
| total scored | 56 |
| Field | Model A | Model B |
|---|---|---|
| Upstream model | Qwen3-Coder | Devstral Small 2 |
| Lab | Alibaba | Mistral AI |
| Tag as invoked | qwen3-coder:latest | devstral-small-2:latest |
| Runtime short ID | 06c1097efce0 | 24277f07f62d |
| Manifest digest | sha256:24a94682582c6045f4950846fc7711479dcecb478b86759f0306a2ef8484d318 | sha256:cc6f162f94fe1e564f0c639e31fd4f16db2a89a99b0559b0348573d7884b24ec |
| Weights layer digest | sha256:1194192cf2a187eb02722edcc3f77b11d21f537048ce04b67ccf8ba78863006a | sha256:c580819bed79c92d01a42227bd6d8fd66b9ec60d5329f5eb73f812f156af7807 |
| Weights size | 18,556,688,736 bytes | 15,177,370,240 bytes |
| Architecture | qwen3moe, mixture of experts | mistral3, dense |
| Parameters | 30.5B total; active count per token not reported by the runtime | 24.0B total |
| Quantization | Q4_K_M | Q4_K_M |
| Declared context length | 262,144 tokens | 393,216 tokens |
| Output-token limit set | none in the Modelfile; the harness sets a per-request max_tokens, 8192 in the one-shot and feedback runners and 4096 in the agentic loop, and imposes step and wall-clock budgets besides (Section 4.4) | none in the Modelfile; harness budget as above |
| Published agentic benchmark | not published | 68.0% SWE-bench Verified [11] |
| Runtime | Ollama 0.32.1 | Ollama 0.32.1 |
| Event | Date |
|---|---|
| devstral-small-2 training cutoff (self-reported) | October 2023 |
| FIPS 204 finalized | 13 August 2024 |
| qwen3-coder training cutoff (self-reported) | October 2024 |
| RFC 9964 published (JOSE serialization) | May 2026 |
| this study | July 2026 |
| Prompt Condition | Valid Parameter Set | Bare Family Name |
|---|---|---|
| Adverse README absent | 5 | 0 |
| Adverse README present | 0 | 5 |
| Qwen3-Coder | Devstral-Small-2 | |
|---|---|---|
| algorithm selected | Ed25519, classical | ML-DSA-44, correct FIPS 204 set |
| post-quantum identifier matches, summed over 5 runs | 0 | 106 |
| module path | not applicable | github.com/cloudflare/ml-dsa-go, nonexistent |
| published key set | advertises both Ed25519 and RS256 in one file | advertises RS256 while the signing code names ML-DSA-44 |
| Layer 1 raw classification | not_migrated (4 of 5); defer_L2 (1 of 5) | E3, residual classical (5 of 5) |
| Layer 2 finding | F6 | F6 |
| runs | 5 | 5 |
| Model Output | Layer 1 Raw Classification | Execution Evidence (Not Per-Run Layer 2) |
|---|---|---|
| ML-DSA-64, invalid parameter set | F3 | F6 |
| bare ML-DSA, missing parameter set | F3, only after a second pattern was added | F6 |
| ML-DSA-44, valid parameter set, nonexistent API | “correct” | F6 |
| Run | Build Attempts | Green Builds | Distinct Build-Passing States | Layer 1 Findings | Layer 2 Findings | Done() |
|---|---|---|---|---|---|---|
| 1 | 3 | 1 | 1 | E2 | not_migrated, F5 | claimed success |
| 2 | 14 | 0 | 0 | F3 | F6 | budget exhausted |
| 3 | 4 | 2 | 2 | F3 | not_migrated, F5 | claimed success |
| 4 | 15 | 0 | 0 | F3 | F6 | budget exhausted |
| 5 | 3 | 0 | 0 | F3 | F6 | reported blocked |
| Run | Writes | Build Attempts | Layer 1 Findings | Layer 2 Findings | Outcome |
|---|---|---|---|---|---|
| 1 | 6 | 8 | F3 | F6 | declared migration impossible |
| 2 | 5 | 20 | F6 | F6 | typo in its own module path; budget exhausted |
| 3 | 13 | 9 | F3 | F6 | declared migration impossible |
| 4 | 14 | 10 | F3 | F6 | budget exhausted |
| 5 | 7 | 9 | F3 | F6 | budget exhausted |
| Condition | Library Available to the Agent | Failure |
|---|---|---|
| one-shot | model must name it | names a module path that does not resolve |
| feedback | model must name it | repeats that path verbatim after being shown the compiler error naming it (5/5) |
| agentic | model must name it | stubs to a passing build and reports success (2/5); exhausts budget (2/5); inaccurate blocker report (1/5) |
| library-named | given in the task | uses the correct library; misuses its API identically (5/5); declares it impossible (2/5) |
| # | Defect | Effect on Apparent Failure |
|---|---|---|
| 1 | git apply silently discarded most of a hunk when the model understated @@ line counts, and exited 0 | inflates |
| 2 | documentation changes scored as migration evidence | deflates |
| 3 | corrupt-patch rejection from empty context lines | inflates |
| 4 | issuer and verifier partitioned by path rather than filename | inflates |
| 5 | raw model output discarded, making attribution impossible | inflates |
| 6 | prompt assembled by unsorted directory traversal, producing prompts of identical length and different content | inflates |
| 7 | invalid ML-DSA parameter set scored as correct | deflates |
| 8 | missing ML-DSA parameter set scored as correct | deflates |
| 9 | feedback probe executed against an interpreter lacking the dependency | inflates |
| 10 | feedback output never applied; a stale error reported as a result | inflates |
| 11 | a placeholder in the feedback prompt echoed verbatim by the model | inflates |
| 12 | permissive build-error exception swallowed a genuine compile failure | deflates |
| 13 | runner invoked only Layer 2, so Layer 2’s early return masked Layer 1 findings | deflates |
| 14 | Go behavioral adapter treated compilation as sufficient, scoring a repository containing no cryptography as correct | deflates |
| 15 | merge stage emitted correct when no layer produced output, certifying runs that were never measured | deflates |
| 16 | Go behavioral adapter accepted a post-quantum module on a name match in the resolved module graph, without requiring that any package import it or call it | deflates |
| 17 | Go behavioral adapter’s unsigned-token check matched Go’s idiomatic error return and ran over files that do not sign, rejecting two unmodified baseline files | inflates |
| 18 | static layer scanned test files, which the behavioral layer excludes, and read a negative-example literal in a test as the artifact’s algorithm name | inflates |
| 19 | static layer judged AKP conformance over the concatenated tree, attributing RSA parameters in generated API documentation to the ML-DSA JWK | inflates |
| 20 | Go behavioral adapter’s test gate runs the repository’s own tests, which reference the RSA key type and pin RS256, so a correct migration confined to the issued scope, from which tests were excluded, fails to compile them and is rejected | inflates |
| # | Defect | Found | Component | Runs Affected | Disposition | Validation | Commit |
|---|---|---|---|---|---|---|---|
| 1 | silent patch truncation | 21 July 2026, M3b run series | diff-based harness | m3b_run_real-001 to -003 | excluded from the scored set with Defect 3; the diff format was replaced by full-file output | applied-vs.-proposed check | 1b47fa4 |
| 2 | documentation scored as migration | 21 July 2026, M3b run series | scorer | all runs scored before the fix | rescored with the corrected scorer; artifact unaffected | code_only() strips comments and docstrings | 1b47fa4 |
| 3 | corrupt-patch rejection | 21 July 2026, M3b run series | diff-based harness | m3b_run_real-001 to -003 | excluded from the scored set with Defect 1 | full-file output format | 1b47fa4 |
| 4 | issuer and verifier partitioned by path | 21 July 2026, M3b run series | Layer 1 detector | all runs scored before the fix | rescored with the corrected detector; artifact unaffected. Scoring-rule defect that inflates rather than deflates (Section 6.2) | filename-based partition | 1b47fa4 |
| 5 | raw model output discarded | 21 July 2026, M3b run series | harness | runs executed before the fix | not recoverable; 27 of the 56 retained records carry no raw response, and the coverage is reported in Table 15 | raw output persisted per run | 1b47fa4 |
| 6 | unsorted directory traversal | 21 July 2026, M3b run series | prompt assembly | runs executed before the fix | the eight earliest runs of the infeasible one-shot cell were executed before the fix and their assembled prompts cannot be verified byte-identical; every later run was executed after it. The other records lacking a prompt hash do so because their runner’s record format omits the field, not because they predate the fix | sorted traversal, prompt hashing | 1b47fa4 |
| 7 | invalid parameter set scored correct | 21 July 2026, M3b run series | scorer | all runs scored before the fix | rescored with the corrected scorer; artifact unaffected | parameter-set fixture | 1b47fa4 |
| 8 | missing parameter set scored correct | 21 July 2026, M3b run series | scorer | all runs scored before the fix | rescored with the corrected scorer; artifact unaffected | bare-family-name fixture | 1b47fa4 |
| 9 | feedback probe wrong interpreter | 21 July 2026, M3b run series | feedback harness | fb_fb-001 | excluded from the scored set; the model’s response is reported in Section 5.2 as an out-of-dataset observation | interpreter assertion | 1b47fa4 |
| 10 | feedback output never applied | 21 July 2026, M3b run series | feedback harness | none among the retained runs | no retained feedback record shows the signature: where round two repeats the round-one error, the model returned no code; where it returned code, the error changed | applied-stat verification | 1b47fa4 |
| 11 | placeholder echoed verbatim | 21 July 2026, M3b run series | feedback prompt | fb_fb-010, fb_fb-011 | excluded from the scored set; the responses contain no migration to score | placeholder fixture | 1b47fa4 |
| 12 | permissive build-error exception | 21 July 2026, first R1 one-shot run | Layer 2 adapter | all runs scored before the fix | rescored with the corrected scorer; artifact unaffected | build-failure fixture | 1b47fa4 |
| 13 | runner invoked Layer 2 only | 22 July 2026, R1 one-shot series, second model | runner | the feasible one-shot cells and part of the R3 one-shot cell | Layer 1 was never invoked, so no static result was persisted; the values are reconstructed from the archived raw output and reproduce all nine that the archive records directly | full three-layer invocation | 1b47fa4 |
| 14 | build treated as sufficient | 22 July 2026, first agentic run | Go behavioral adapter | the five agentic runs | rescored with the corrected adapter; the rescored result was not written back for run 001, which was detected during manuscript preparation and repaired from the surviving working copy | module-graph resolution check | 060921f |
| 15 | merge emitted correct without behavioral evidence | 23 July 2026, during deposit assembly | merge stage | ten records of the infeasible arm: m3b_run_clean-013 to -017 and m3b_run_real-004 to -007, -012 | re-merged under the corrected rule: the five m3b_run_clean records escalate to human review, the five m3b_run_real records resolve to F3 from the reconstructed static layer; superseded values retained in each record | rule 5, correctness requires behavioral evidence, with three merge self-tests | 64224ec |
| 16 | behavioral adapter accepted on a module name | 23 July 2026, adversarial fixture during deposit review | Go behavioral adapter | one record, r1_run_r1-001, whose stored Layer 2 verdict was correct; the other nine reconstructable one-shot runs were unaffected | adapter hardened to require the post-quantum package to be imported and a signature API called, to reject a module satisfied by a local replace, and to treat failing crypto-package tests as disqualifying; the ten reconstructable runs re-probed, and r1_run_r1-001 resolves to F6 at the build stage | adversarial repository that compiles, imports no post-quantum API, signs nothing, publishes no key set, and returns a literal token, carrying only a local module whose name matches the regular expression | 781dabe |
| 17 | unsigned-token check rejected a correct migration | 11 September 2026, positive-control witness after peer review | Go behavioral adapter | none: no scored run reached the token-path stage (archived Layer 2 stages: build 28, dependency 2); the ten reconstructable one-shot runs rescored unchanged | empty alternative removed from the pattern; check scoped to files containing a signing call | positive-control witness, a correct migration the adapter must accept | ce57e2d |
| 18 | static layer scanned test files | 11 September 2026, positive-control witness after peer review | static layer, scope | none: static-layer findings for every reconstructable run unchanged on rescoring | test files excluded from Layer 1 scope for every class except C10, whose subject is the tests | positive-control witness; fixture suite of eleven cases reconstructed and executing | 264a58f, 33b1621 |
| 19 | AKP conformance judged over the concatenated tree | 11 September 2026, positive-control witness after peer review | static layer, detect_C1 and detect_C5 | none: the five infeasible-arm runs whose static verdict passed the conformance check are unchanged under per-file evaluation; no feasible-arm run reached it | conformance judged per file, so a wrong parameter counts only in a file that itself names ML-DSA | positive-control witness | 264a58f |
| 20 | test gate and task scope disagree | 11 September 2026, audit of the positive-control witness (Section 4.2) after the witness was accepted | Go behavioral adapter, test gate; task scope (Section 4.4) | none: no scored run reached the tests stage | disclosed, not corrected: the gate is retained because a migration that leaves the package’s tests uncompilable is not complete, and the scope as issued cannot be changed after the fact; folding the certifying checks into Layer 2 (Limitation 8) would replace the gate | witness re-probed with the baseline key_test.go restored: F6 at the tests stage, compile failure on the RSA key type (witness/l2-witness-baseline-tests-F6.json) | none |
| Field | Present in | Absent Because |
|---|---|---|
| condition, repository, scored result | 56 | present in every record; the allocation and the findings rest on these |
| model identifier | 39 | the 17 feedback records use a structure that omits it; the runner defaults are given in Section 4.4 |
| checkpoint digest | 29 | added mid-study, and omitted by the feedback and agentic record formats |
| repository pin | 29 | as above |
| raw model response | 29 | added mid-study as the remedy for Defect 5; the agentic runners write none |
| assembled-prompt hash | 21 | added mid-study as the remedy for Defect 6; the feedback and agentic formats omit it |
| merged scorer verdict | 29 | the feedback and feasible-arm one-shot records carry the layer results the paper reports instead |
| Layer 1 result, from the original scoring run | 9 | Layer 1 was not invoked by every runner (Defect 13) |
| Layer 1 result, written back from a reconstruction | 5 | remediation of Defect 15; superseded values retained in each record |
| Layer 1 result, reconstructed on demand and not stored | 15 | reproducible with rescore_from_raw.py |
| apparatus version | 0 | the harness never recorded one |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Campbell, R. Agentic Cryptographic Debt: Repository-Level Measurement of Post-Quantum Migration Regression Under Autonomous AI Software Development. Computers 2026, 15, 625. https://doi.org/10.3390/computers15090625
Campbell R. Agentic Cryptographic Debt: Repository-Level Measurement of Post-Quantum Migration Regression Under Autonomous AI Software Development. Computers. 2026; 15(9):625. https://doi.org/10.3390/computers15090625
Chicago/Turabian StyleCampbell, Robert. 2026. "Agentic Cryptographic Debt: Repository-Level Measurement of Post-Quantum Migration Regression Under Autonomous AI Software Development" Computers 15, no. 9: 625. https://doi.org/10.3390/computers15090625
APA StyleCampbell, R. (2026). Agentic Cryptographic Debt: Repository-Level Measurement of Post-Quantum Migration Regression Under Autonomous AI Software Development. Computers, 15(9), 625. https://doi.org/10.3390/computers15090625

