Add external secret helper support for key management#36
Merged
Conversation
Update workspace version and all inter-crate dependency versions from 0.5.0 to 0.6.0. Add clear installation instructions (crates.io, from source, verify) to all CLI tool READMEs and `cargo add` sections to library crate READMEs. Reorganize root README Getting Started with explicit install paths and add tap-mcp to CLI tools listing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a git-like secret helper pattern that allows TAP agents to retrieve private keys from external secret stores (HashiCorp Vault, AWS KMS, 1Password). - Add get_private_key(did) to AgentKeyManager and KeyManager trait - Add secret_helper module with SecretHelperConfig and discover_agent_dids - Add from_secret_helper() factory on TapAgent - Add --secret-helper / TAP_SECRET_HELPER flag to tap-cli, tap-http, tap-mcp - Simplify WASM export_private_key() to use new get_private_key() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Drop file handles and call sync_all() before executing scripts to prevent "Text file busy" errors on macOS. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use write-then-rename pattern for test scripts to avoid "Text file busy" (ETXTBSY) errors on Linux when exec races with the kernel releasing a write file descriptor. https://claude.ai/code/session_01ATXjF1caKB3UmNvxLQajgs
pelle
pushed a commit
that referenced
this pull request
Feb 23, 2026
Add [Unreleased] section to root CHANGELOG.md and tap-ts/CHANGELOG.md covering PRs #34-#36: security audit fixes (14 findings including critical SQL injection), Flattened JWS and X25519 JWE for Veramo interoperability, and external secret helper for key management. https://claude.ai/code/session_01U5pusfFsLrcwHqZjFhfb8L
pelle
added a commit
that referenced
this pull request
Feb 23, 2026
Add [Unreleased] section to root CHANGELOG.md and tap-ts/CHANGELOG.md covering PRs #34-#36: security audit fixes (14 findings including critical SQL injection), Flattened JWS and X25519 JWE for Veramo interoperability, and external secret helper for key management. https://claude.ai/code/session_01U5pusfFsLrcwHqZjFhfb8L Co-authored-by: Claude <noreply@anthropic.com>
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 support for external secret helpers to TAP agents, enabling integration with external key management systems (HashiCorp Vault, AWS KMS, 1Password, etc.) as an alternative to storing keys in
keys.json.Key Changes
New
secret_helpermodule (tap-agent/src/secret_helper.rs):SecretHelperConfigparses and invokes helper commands with a DID argumentSecretHelperOutputhandles JSON responses with support for hex and base64 encodingdiscover_agent_dids()scans the TAP directory to find existing agent DIDsExtended
KeyManagertrait (tap-agent/src/key_manager.rs):get_private_key()method to retrieve raw private key bytes and key typeextract_private_key_from_secret()utility function to decode JWK "d" parametersDefaultKeyManagerandAgentKeyManagerEnhanced
AgentKeyManager(tap-agent/src/agent_key_manager.rs):get_private_key()method that checks generated_keys first, then falls back to secretsNew
TapAgent::from_secret_helper()method (tap-agent/src/agent.rs):from_private_key()for agent constructionCLI integration across all entry points:
tap-http/src/main.rs: Added--secret-helperflag andTAP_SECRET_HELPERenv vartap-cli/src/main.rs: Added--secret-helperflag with env var supporttap-mcp/src/main.rs: Added--secret-helperflag with env var supportWASM compatibility (
tap-wasm/src/wasm_agent.rs):get_private_key()method instead ofget_generated_key()Dependencies:
hex = "0.4"totap-agent/Cargo.tomlfor hex encoding/decodingenvfeature to clap intap-cliandtap-mcpfor environment variable supportImplementation Details
<command> [args...] <did>{"private_key": "...", "key_type": "Ed25519", "encoding": "hex"}_→:)https://claude.ai/code/session_01ATXjF1caKB3UmNvxLQajgs