Summary
Add support for storing and retrieving secrets from HashiCorp Vault instead of local files (~/.claude/.credentials.json, keychain, etc.).
Motivation
Current State
OpenClaw currently stores credentials in:
- Local JSON files (
~/.claude/.credentials.json, ~/.qwen/oauth_creds.json)
- System keychain (macOS/Linux)
- Environment variables
Problems with Current Approach
- ❌ Secrets scattered across multiple locations
- ❌ No centralized secret rotation
- ❌ Limited audit logging
- ❌ Difficult to manage in multi-user/team environments
- ❌ No encryption at rest (files are just JSON)
Benefits of Vault Integration
- ✅ Centralized secret management - Single source of truth
- ✅ Better security - Vault's encryption and access policies
- ✅ Secret rotation - Automated credential rotation
- ✅ Audit logging - Track who accessed which secrets
- ✅ Team support - Multiple users can share secrets safely
- ✅ Already available - Many users already run Vault in their infrastructure
Proposed Implementation
Architecture
┌─────────────┐
│ OpenClaw │
│ Gateway │
└──────┬──────┘
│ 1. Request credentials
↓
┌─────────────────────────┐
│ Credential Provider │
│ (with Vault support) │
└──────┬─────────┬────────┘
│ │
│ └─→ Fallback to local files
↓
┌──────────────┐
│ HashiCorp │
│ Vault │
│ (HTTP API) │
└──────────────┘
Technical Details
-
New Module: src/infra/vault-client.ts
- VaultClient class for HTTP API communication
- Support for KV v2 secrets engine
- Read/write/list/delete operations
-
Configuration (via env vars or moltbot.json):
{
"credentials": {
"provider": "vault", // or "local" (default)
"vault": {
"addr": "http://localhost:8200",
"token": "<vault-token>",
"namespace": "openclaw"
}
}
}
-
Environment Variables:
VAULT_ADDR - Vault server address
VAULT_TOKEN - Authentication token
VAULT_NAMESPACE - Optional namespace
-
Secret Structure in Vault:
openclaw/credentials/anthropic → OAuth tokens
openclaw/credentials/telegram → Bot token
openclaw/credentials/discord → Bot token
openclaw/config/encryption → Master keys
-
Backward Compatibility:
- Default to local file storage if Vault not configured
- Migration tool:
openclaw vault migrate to move secrets to Vault
- Support both providers simultaneously (Vault → fallback to local)
Related Issues
Current Status
We will implement this as an extension first (extensions/vault-integration) to:
- Validate the approach
- Get community feedback
- Avoid blocking on core approval
- Allow faster iteration
Once proven stable, we can discuss merging into core or keeping as an optional extension.
Implementation Checklist
Questions for Maintainers
- Architecture: Do you prefer this as a core feature or extension?
- Scope: Should we also support other secret managers (AWS Secrets Manager, Azure Key Vault)?
- Dependencies: OK to add
node-fetch or use built-in fetch?
- Breaking changes: Any concerns with the proposed credential provider interface?
Looking forward to your feedback! 🔐
Note: This will be implemented initially as an extension in extensions/vault-integration for faster iteration and validation. We can discuss core integration after proving the concept.
Summary
Add support for storing and retrieving secrets from HashiCorp Vault instead of local files (
~/.claude/.credentials.json, keychain, etc.).Motivation
Current State
OpenClaw currently stores credentials in:
~/.claude/.credentials.json,~/.qwen/oauth_creds.json)Problems with Current Approach
Benefits of Vault Integration
Proposed Implementation
Architecture
Technical Details
New Module:
src/infra/vault-client.tsConfiguration (via env vars or
moltbot.json):{ "credentials": { "provider": "vault", // or "local" (default) "vault": { "addr": "http://localhost:8200", "token": "<vault-token>", "namespace": "openclaw" } } }Environment Variables:
VAULT_ADDR- Vault server addressVAULT_TOKEN- Authentication tokenVAULT_NAMESPACE- Optional namespaceSecret Structure in Vault:
Backward Compatibility:
openclaw vault migrateto move secrets to VaultRelated Issues
Current Status
We will implement this as an extension first (
extensions/vault-integration) to:Once proven stable, we can discuss merging into core or keeping as an optional extension.
Implementation Checklist
extensions/vault-integrationpackageQuestions for Maintainers
node-fetchor use built-infetch?Looking forward to your feedback! 🔐
Note: This will be implemented initially as an extension in
extensions/vault-integrationfor faster iteration and validation. We can discuss core integration after proving the concept.