feat: automatic git auth and signing for sprout agents#528
Merged
Conversation
94e2d7c to
08f8c80
Compare
Integrate git-credential-nostr and git-sign-nostr into sprout-dev-mcp as multicall personalities. Agents using sprout-dev-mcp get automatic NIP-98 git auth and NIP-GS commit signing when NOSTR_PRIVATE_KEY is set — zero persistent config mutation. ## How it works sprout-dev-mcp is already a multicall binary (rg, tree, sprout CLI via argv[0] dispatch). This adds git-credential-nostr and git-sign-nostr as two more personalities, with a shim directory that puts them on PATH. At startup, the dev-mcp: 1. Reads NOSTR_PRIVATE_KEY, then removes it from the process env 2. Writes the key to a 0600 file (created with O_CREAT|O_EXCL + mode) 3. Derives the public key for user.signingkey 4. Zeroizes the in-memory key string 5. Builds ephemeral GIT_CONFIG_* env vars for shell children Shell children get automatic nostr credential auth + commit signing via the ephemeral git config. The credential helper is additive — it silently declines non-Sprout remotes (no Nostr WWW-Authenticate challenge = exit 0, no credential), so git falls through to system helpers for GitHub/GitLab. ## Changes - git-credential-nostr: extract lib.rs with `pub fn run() -> i32` - git-sign-nostr: extract lib.rs with `pub fn run() -> i32` - sprout-dev-mcp: multicall dispatch (sync, before tokio/tracing), shim symlinks, keyfile, ephemeral git config, secret scoping - sprout-agent: widen PASSTHROUGH_ENV (SSH_AUTH_SOCK, GIT_ASKPASS, GIT_SSH_COMMAND, SPROUT_PRIVATE_KEY, SPROUT_RELAY_URL, etc.) - scripts/build-agent-release.sh: tar packaging with cross-compile support - Remove unused anyhow dep from git-credential-nostr Standalone binaries for both git helpers continue to work unchanged.
08f8c80 to
a7963ad
Compare
Ensures the agent + dev-mcp (with git-credential-nostr and git-sign-nostr multicall integration) build successfully for linux-musl targets on every PR. Also adds git-sign-nostr to the cross-compile list (previously only git-credential-nostr was included).
This was referenced May 28, 2026
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
Integrate
git-credential-nostrandgit-sign-nostrintosprout-dev-mcpas multicall personalities. Agents using sprout-dev-mcp get automatic NIP-98 git auth and NIP-GS commit signing whenNOSTR_PRIVATE_KEYis set — zero persistent config mutation.How it works
At startup, the dev-mcp:
NOSTR_PRIVATE_KEY, thenremove_var()unconditionallycreate_new+mode(0o600))user.signingkeyGIT_CONFIG_*env vars for shell childrenShell children get automatic nostr credential auth + commit signing. The credential helper is additive — it silently declines non-Sprout remotes (no Nostr
WWW-Authenticatechallenge = exit 0, no credential), so git falls through to system helpers for GitHub/GitLab/etc.What agents can do
git pushto Sprout relays — automatic NIP-98 authgit commit— automatic NIP-GS signinggit clone git@github.com:...— SSH works (SSH_AUTH_SOCK passed through)git pushto GitHub/GitLab — system credential helpers still worksprout channels list— relay CLI works (SPROUT_PRIVATE_KEY inherited)Security model
NOSTR_PRIVATE_KEYremoved from process env after keyfile writenostr.keyfilegit configSPROUT_PRIVATE_KEYintentionally inherited (sprout CLI needs it)Changes
lib.rswithpub fn run() -> i32, remove unusedanyhowdeplib.rswithpub fn run() -> i32PASSTHROUGH_ENV(SSH_AUTH_SOCK, GIT_ASKPASS, GIT_SSH_COMMAND, SPROUT_PRIVATE_KEY, SPROUT_RELAY_URL)Standalone binaries for both git helpers continue to work unchanged (lib + bin pattern).
Release artifact
Testing
cancel_kills_inflight_tool_via_mcp_notificationunrelated