Install
openclaw skills install openclaw-credential-vaultEncrypted credential management for OpenClaw — keeps API keys, tokens, and passwords out of the AI agent's context window. AES-256-GCM encryption, subprocess-scoped injection, automatic output scrubbing.
openclaw skills install openclaw-credential-vaultEncrypted credential management for OpenClaw. Keeps API keys, tokens, and passwords out of the AI agent's context window — where they could be exfiltrated, leaked into transcripts, or exposed through tool output.
The vault stores all data under ~/.openclaw/vault/:
~/.openclaw/vault/*.enc — Individual encrypted credential files (AES-256-GCM, one per tool). File permissions are set to owner-only (600).~/.openclaw/vault/tools.yaml — Injection rules mapping tools to credentials (which command patterns trigger which credential injection, which URL patterns get auth headers).~/.openclaw/vault/.vault-meta.json — Vault metadata (initialization timestamp, version).~/.openclaw/vault/audit.log — Credential access audit log.No environment variables are required. The vault derives its encryption key from the system and does not store keys in env vars or config files.
Install the plugin via npm:
npm install -g openclaw-credential-vault
Then restart the gateway to load the plugin. The plugin registers four OpenClaw hooks:
before_exec — Injects credentials into subprocess environment for matching commandsafter_exec — Scrubs credential patt[VAULT:gmail-app]utbefore_send — Scrubs credentials from outbound messagessession_transcript — Scrubs credentials from session transcriptsTo review the hook implementations before installing, see src/hooks/ in the GitHub repository.
# Initialize the vault
openclaw vault init
# Add a credential (interactive — picks the right injection type)
openclaw vault add github --key "ghp_your_token_here"
# Verify it works end-to-end (injection + scrubbing)
openclaw vault test github
# Add more
openclaw vault add stripe --key "sk_live_..."
openclaw vault add npm --key "npm_..."
That's it. Your agent can now use gh, call Stripe APIs, and publish npm packages without ever seeing the credentials.
When the agent runs a tool like gh pr list:
gh against tools.yaml injection rules~/.openclaw/vault/github.enc using the derived keyGITHUB_TOKEN into the subprocess environment onlygh runs with the credential, returns resultsFor API calls, the before_exec hook injects Authorization headers into matching URL patterns (configured in tools.yaml).
vault init — Initialize vault and create ~/.openclaw/vault/ directoryvault add <tool> --key <cred> — Add a credential (interactive usage selection: API, CLI)vault list — Show all stored credentials and statusvault show <tool> — Show credential details and injection configvault test <tool> — Verify injection and scrubbing work end-to-endvault rotate <tool> --key <new> — Rotate a credential (re-encrypts in place)vault rotate --check — Show credentials overdue for rotationvault remove <tool> — Remove credential file and injection rules# API header injection
openclaw vault add stripe --key "sk_live_..." --use api --url "api.stripe.com/*" --yes
# CLI env injection
openclaw vault add github --key "ghp_..." --use cli --command gh --env GITHUB_TOKEN --yes
before_exec hook, not in the agent's context~/.openclaw/vault/*.encafter_exec, before_send, session_transcript, plus pattern-based fallback) catch credential leaks~/.openclaw/vault/audit.log