Install
openclaw skills install openclaw-key-managementClawHub Security found sensitive or high-impact capabilities. Review the scan results before using.
Secure credential storage system for OpenClaw that encrypts and protects API keys, tokens, and sensitive credentials from memory file compromise.
openclaw skills install openclaw-key-managementA comprehensive security key management system that protects your AI assistant's credentials even if memory files are compromised.
MEMORY.md or daily log files.secrets/vault.json.enc{SECRET:api_key_name} in memory filesconfig/key_management.json# 1. Clone or copy this skill to your skills directory
cp -r openclaw-key-management-skill ~/.openclaw/your-workspace/skills/
# 2. Initialize the key vault
cd ~/.openclaw/your-workspace
./skills/openclaw-key-management/scripts/key_manager.sh init
# 3. Configure security mode (optional)
# Edit skills/openclaw-key-management/config/key_management.json
# Set "master_key_mode" to "system_key" (default) or "passphrase"
# 4. Migrate existing credentials (if any)
./skills/openclaw-key-management/scripts/key_manager.sh migrate
# Add a new credential
./skills/openclaw-key-management/scripts/key_manager.sh add my_api_key
# Add with metadata
./skills/openclaw-key-management/scripts/key_manager.sh add instreet_api_key
# Get credential value (automatically decrypted)
./skills/openclaw-key-management/scripts/key_manager.sh get my_api_key
# List all stored credentials
./skills/openclaw-key-management/scripts/key_manager.sh list
In your OpenClaw workflows, reference credentials using the secure placeholder format:
### External Service
- **API Key**: {SECRET:my_api_key}
The system automatically intercepts these references and provides the decrypted value at runtime.
workspace/
├── .secrets/ # Encrypted secrets directory
│ ├── master.key # Encrypted master key
│ ├── vault.json.enc # Main encrypted credential vault
│ ├── backup/ # Versioned encrypted backups
│ └── temp/ # Ephemeral runtime files
├── skills/openclaw-key-management/
│ ├── scripts/key_vault.js # Node.js encryption module
│ ├── scripts/key_manager.sh # CLI management tool
│ └── config/key_management.json # Configuration template
└── MEMORY.md # Safe references only: {SECRET:name}
| Threat | Impact | Mitigation |
|---|---|---|
| Memory file compromise | High | Credentials never stored in plaintext |
| Runtime memory dump | Medium | Short credential lifespan + secure zeroing |
| Master key theft | Critical | Optional passphrase protection |
| Backup exposure | Medium | Backups encrypted with same strong crypto |
| Malicious skill/plugin | High | Credential access requires explicit permission |
config/key_management.json{
"version": "1.0",
"master_key_mode": "system_key", // "system_key" or "passphrase"
"encryption": {
"algorithm": "aes-256-gcm",
"pbkdf2_iterations": 100000,
"salt_length": 16,
"iv_length": 12
},
"runtime": {
"credential_timeout_seconds": 30,
"enable_memory_locking": true,
"auto_cleanup_on_exit": true
},
"backup": {
"enabled": true,
"max_backups": 10,
"backup_interval_hours": 24
}
}
./scripts/key_manager.sh migrateMEMORY.md now contains {SECRET:name} referencesIf automatic migration fails, manually:
./scripts/key_manager.sh add credential_name{SECRET:credential_name}.secrets/ directory without encryptionconst SecureKeyVault = require('./skills/openclaw-key-management/scripts/key_vault.js');
const vault = new SecureKeyVault('/path/to/workspace');
await vault.initialize();
await vault.setSecret('api_key', 'your-secret-value');
const secret = await vault.getSecret('api_key');
init - Initialize key vaultadd NAME - Add new secretget NAME - Get secret valuelist - List all secretsbackup - Create backupmigrate - Migrate existing credentialsinit command first.secrets/ directory.secrets/backup/This skill follows OpenClaw AgentSkills specification. Contributions welcome:
MIT License - Free to use, modify, and distribute.
Remember: Security is a process, not a product. This skill provides strong protection, but always follow security best practices in your overall OpenClaw deployment.