Repository navigation
Conversation
…ability research Most crypto failures are callers misusing correct libraries. These skills give agents the research-backed design rules for building misuse-resistant APIs, and the vitaminc types and recipes for using them, so agent-written code takes the secure path by default.
…l-improver review loop The typestate example let the caller pass the verification check, so |_| true got past it; the caller now passes a key and the library checks. The encrypt and key-wrap recipes made a fresh key per call while being labelled the production path; the cipher is now built once at startup from a data key generated once per tenant and stored wrapped under AAD naming that tenant, not one hard-coded tenant's. The Generatable recipe keeps its random secrets in Protected. SKILL.md no longer lists a KMS as a key source vitaminc can load from, says passthrough fields are unauthenticated, and stops sending password generation to a type whose value cannot be read.
…ader The random-index recipe refused nothing although next_below panics on zero; it now returns None for an empty list. The password recipe refuses lengths under 16 characters. The encrypt recipe told readers to share one cipher with every call, but Aes256Cipher is !Sync; it now says one per thread or task. The PRF key loader takes its bytes already in Protected, the root-key loader says why it must take a plain array and to keep no other copy, and the random recipes drop an unused SeedableRng import. In RUST.md the rung-1 encrypt returns an error rather than being infallible, as rule 9 asks, and states the random-nonce message limit; the const-generics bullet is renamed for what it shows, and the typestate example can construct an Unverified. EVIDENCE.md qualifies the Acar three-times figure and the Blessing link to rule 4, and the research notes now list Len, Grubbs and Ristenpart 2021, which rule 7 cites.
…stops compiling fails CI The skills are Markdown, so nothing compiled their examples, and agents copy them as written. skill-doctests includes each skill file as rustdoc, which makes every Rust block a doctest against the workspace crates; the Test job's plain cargo test picks it up as a workspace member. It is never published or released, like the derive-tests crates.
Contributor
🧬 Mutation testing (cargo-mutants,
|
Contributor
✅ No CRAP threshold violations1288 function(s) analyzed · threshold 30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds two Claude Code skills, plus the research notes behind them and a test-only crate that compiles every Rust block in them. Coding agents produce the same crypto misuse that the usability studies found in human developers: they copy examples, optimise for code that works, and overrate how secure it is. These skills point agents at the secure path.
misuse-resistanceis generic. It covers designing APIs inside vitaminc and in other packages.vitamincis aimed at developers adopting the crates.The
.gitignorechange ignores.claude/settings.local.json.Evidence
vitaminc-encrypt's README usesKey::from([0u8; 32])in its examples.RECIPES.mdandRUST.mdcompiles and runs against the workspace crates, and CI now checks this. The newpackages/skill-doctestscrate includes each skill file as rustdoc, so every Rust block becomes a doctest. The Test job's plaincargo testruns it as a workspace member:derive-testscrates (publish = false, plus arelease = falseentry inrelease-plz.toml).Gaps in vitaminc found while writing these (not fixed here):
Keycan't be built from aProtected<[u8; 32]>.Password::into_*_stringisunimplemented!().0.2.0-pre.1).Review
Both skills went through a skill-improver loop, which reviewed and fixed each one until a review found nothing critical or major. The loop used the plugin-dev skill-reviewer.
|_| truegot past it.SKILL.mdlisted a KMS as a key source, which vitaminc can't load from.next_belowpanics on zero, and the random-index recipe didn't guard against it.Aes256Cipherwith every call, but it is!Sync.encryptinRUST.mdcouldn't fail, and nothing mentioned the random-nonce message limit.EVIDENCE.mdwere overstated, and one was missing from the research notes.Every Rust block still compiles and runs against the workspace (
cargo test --doc: 12 passed). The remaining open findings are style or info, such as third-person descriptions and areferences/layout. Those are plugin conventions that don't apply to project skills.Merge Danger
Door: two-way
It changes no published crate. The only Rust addition is
skill-doctests, a test-only crate that is never released.Blast Radius: agents
The skills load automatically for anyone running Claude Code in this repo. Rules they get wrong would steer agent-written code, so review the rules and recipes as you would code.