Skip to content

feat(cli): nirium anchor --sign (re-land, #264 merged to the wrong branch) - #268

Merged
Eras256 merged 1 commit into
mainfrom
issue-134-anchor-sign-reland
Nov 7, 2026
Merged

Eras256 merged 1 commit into
mainfrom
issue-134-anchor-sign-reland

Conversation

@M0nsxx

@M0nsxx M0nsxx commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Re-lands #264's content directly against main. The original PR merged into issue-133-anchor (its stacked base) instead of main - by the time #263 merged to main, #264's commit hadn't landed there yet, so --sign/--key-env never actually shipped. GitHub still shows #264 as "merged," which is accurate but misleading here: merged into the wrong target.

Same spec as before:

nirium config set secretKey
nirium anchor --hash <64-hex> --sign
# or:
NIRIUM_KEY=S... nirium anchor --hash <64-hex> --sign --key-env NIRIUM_KEY
  • Signs 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 source: --key-env <VAR> if given, otherwise the config store's secretKey. Either missing path fails locally with a clear message, before any network call.
  • A malformed secret key is rejected locally too (Keypair.fromSecret throwing).
  • If the node rejects the attestation, the response is 400 and nothing is anchored.

Test plan

Closes #134

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>

@Eras256 Eras256 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving - re-lands #264's content directly against main this time (the original merged into the now-gone issue-133-anchor branch instead). Same spec: ed25519 attestation over nirium-audit-v1:<content_sha256>, key never leaves the machine or gets printed, throwaway Keypair.random() in tests. 106/106 tests pass locally, CI 3/4 green and the last one still running. Merging once it finishes.

@Eras256
Eras256 merged commit b094a82 into main Nov 7, 2026
4 checks passed
@M0nsxx M0nsxx mentioned this pull request Nov 7, 2026
Eras256 pushed a commit that referenced this pull request Nov 7, 2026
…k, report (#263, #268, #265, #266) (#269)

Bumps packages/cli 3.0.1 -> 3.1.0 (new public commands, not a patch) and
dates the Unreleased CHANGELOG section. All four changes are already
merged to main.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI: nirium anchor --sign, attach an agent attestation

2 participants