Repository navigation
feat(cli): nirium anchor --sign - attach an agent attestation - #264
Merged
Merged
Conversation
Adds --sign and --key-env <VAR> to `nirium anchor`. Signs nirium-audit-v1:<content_sha256> locally with ed25519 - the secret key (from --key-env or the config store's secretKey) never leaves this process, only the signature and derived public key do. 7 new tests with a fake agent server that verifies the signature for real (ed25519 over the same statement the real node checks), so a genuinely bad signature gets a real 400 and nothing is cataloged as anchored; the happy path round-trips through `nirium verify`, which reports SIGNATURE: VALID against the same key. Full suite 83/83. Closes #134 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
3 tasks done
Eras256
approved these changes
Nov 7, 2026
Eras256
left a comment
Collaborator
There was a problem hiding this comment.
Approving — ed25519 attestation over nirium-audit-v1:<content_sha256>, key never leaves the machine or gets printed, tests use a throwaway Keypair.random(). No CI yet because this is stacked on #263's branch — expected, it'll run once #263 merges and this retargets to main. Will re-check CI after that before final merge.
3 tasks done
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
Stacked on #263 (#133). Adds
--sign/--key-env <VAR>tonirium anchor:nirium-audit-v1:<content_sha256>locally with ed25519 - only the resulting signature and the derived public key (G...) leave this process, never the secret itself.--key-env <VAR>if given, otherwise the config store'ssecretKey. Either missing path fails locally with a clear message, before any network call.Keypair.fromSecretthrowing).400and nothing is anchored.Test plan
test/anchor-sign.test.js(7 cases) against a fake agent server that actually verifies the signature (same ed25519-over-statement check the real node does), not a stub that always accepts - so the "bad signature -> 400, nothing anchored" case is real, not simulated. Covers: happy-path round trip throughnirium verify(reportsSIGNATURE: VALIDagainst the same key) for both--hashand--recordmode, a rejected signature, a malformed secret key, an unset--key-envvariable, no key configured at all, and that omitting--signleaves the request body unchanged (noagentfield).npm test- 83/83.node --check bin/nirium.jsclean.Closes #134