cd /root/APIKeys cat > README.md << 'EOF'
Encrypted key vault and credential manager for OpenClaw AI agent deployments.
Stores API keys in a Fernet-encrypted vault, injects them at boot time into OpenClaw's runtime config, and provides a CLI for day-to-day key management — no plaintext secrets in config files or environment variables.
- AES-256 encrypted vault — keys stored in
/etc/openclaw/vault.enc - Flask API — machine token auth, CSRF protection, httponly cookies
- TOTP + admin password — two-factor admin access
- Boot injection — pulls keys from vault and writes runtime config before OpenClaw starts
- Migration tool — imports from
auth-profiles.jsonandopenclaw.json clawvaultCLI — interactive menu for adding, rotating, deleting, and exporting keys- Audit log — every key access recorded
- Automatic backups — encrypted backup on every write
- Systemd service — vault starts on boot, chained to OpenClaw
- Python 3.11+
- Debian/Ubuntu VPS (tested on Debian 12)
- OpenClaw installed at
~/.openclaw/
git clone https://github.com/Millerderek/openclaw-vault
cd openclaw-vault
python3 -m venv venv
venv/bin/pip install -r requirements.txt
venv/bin/python3 setup.pySetup will generate encryption keys, configure TOTP, and write /etc/openclaw/vault.env.
venv/bin/python3 migrate_to_vault.py --dry-run
venv/bin/python3 migrate_to_vault.pyScans auth-profiles.json and openclaw.json. Rewrites openclaw.json as a __VAULT:KEY__ template. auth-profiles.json is left intact.
venv/bin/python3 openclaw_boot_inject.py --dry-run
venv/bin/python3 openclaw_boot_inject.py --write
OPENCLAW_CONFIG_PATH=~/.openclaw/openclaw.runtime.json openclaw gateway startcp openclaw-vault.service /etc/systemd/system/
systemctl enable --now openclaw-vaultchmod +x clawvault
ln -sf $(pwd)/clawvault /usr/local/bin/clawvault
clawvaultInteractive menu: list, add, rotate, delete, show, export.
/etc/openclaw/vault.envcontains the master key —chmod 600, root onlyvault.enc,*.env, and*.logexcluded from git- Machine tokens IP-restricted to
127.0.0.1 - Vault UI binds to
localhost:7777— use SSH tunnel for browser access
| File | Purpose |
|---|---|
vault_core.py |
Encryption, token management, audit logging |
vault_server.py |
Flask REST API + admin UI backend |
setup.py |
First-run setup wizard |
migrate_to_vault.py |
Import credentials from OpenClaw config files |
openclaw_boot_inject.py |
Boot-time secret injection |
clawvault |
Interactive CLI |
openclaw-agent.service |
Systemd unit |
ui/index.html |
Single-page admin UI |
| EOF |
git add README.md git commit -m "Add README" git push