Hardware-gated secret management for AI agents.
Your AI can read your config files. This stops that from being a problem.
Already using openclaw-secure? Here's how to upgrade:
# 1. Update the package
npm install -g openclaw-secure@latest
# 2. Done! Migration happens automatically on next start.| v1.x | v2.x |
|---|---|
| Hardcoded secret paths | Auto-discovers all secrets |
Manual DEFAULT_SECRET_MAP |
Scans your entire config |
| Fixed keychain names | Dynamic names from paths |
Your existing secrets are automatically migrated on first start:
π Secure gateway start (keychain, auto-discovery)...
β Migrated 2 legacy key(s)
β Restoring keys from keychain...
To migrate manually (optional):
openclaw-secure migrate
openclaw-secure check # verify everything movedNo action needed. Your existing LaunchAgent calls openclaw-secure start, which now auto-migrates and auto-discovers.
# 1. Install
npm install -g openclaw-secure
# 2. Store your secrets (auto-discovers everything)
openclaw-secure store
# 3. Start the gateway securely
openclaw-secure startYour config file now has [STORED_IN_KEYCHAIN] placeholders. Secrets exist only in memory while the gateway runs.
openclaw-secure install # patches LaunchAgent
# Now every reboot is secure| Command | What it does |
|---|---|
discover |
Preview secrets found in your config |
store |
Move secrets to backend, replace with placeholders |
start |
Restore β start gateway β scrub (for boot) |
check |
Verify all secrets exist in backend |
restore |
Write real values back to config |
migrate |
Move v1.x keychain names to v2.x |
install |
Patch LaunchAgent for secure boot |
uninstall |
Restore original LaunchAgent |
--backend <name> # keychain, 1password, bitwarden, aws, gcloud, azure, pass, doppler, vault
--exclude <path> # Skip paths (e.g., "channels.dev.*")
--also <path> # Add custom paths
--no-auto # Use legacy hardcoded paths| Level | Backend | Why |
|---|---|---|
| π’ Easy | keychain |
Zero setup, macOS only |
| π‘ Better | aws, gcloud, azure |
Audit logs |
| π΄ Best | 1password |
Biometric = hardware gate |
Your AI agent can run shell commands and read files. Your API keys are in ~/.openclaw/openclaw.json:
channels.telegram.botToken: "7234891:AAF..." β agent can cat this
gateway.auth.token: "sk-proj-..." β prompt injection = game over
Prompt injection attacks trick your AI into exfiltrating secrets. One malicious webpage can instruct the agent to read and send your keys.
OpenClaw Secure moves secrets to hardware-protected storage. Config files only have placeholders.
macOS Keychain (default)
No setup. Just works on macOS.
openclaw-secure store1Password (recommended)
brew install --cask 1password-cli
op signin
openclaw-secure store --backend 1password --vault PrivateEnable biometric unlock for Touch ID on every secret read.
Bitwarden
npm install -g @bitwarden/cli
bw login && bw unlock
export BW_SESSION="..."
openclaw-secure store --backend bitwardenAWS Secrets Manager
aws configure
openclaw-secure store --backend aws --region us-east-1Google Cloud
gcloud auth login
openclaw-secure store --backend gcloud --project my-projectAzure Key Vault
az login
openclaw-secure store --backend azure --vault-name my-vaultpass
pass init <gpg-id>
openclaw-secure store --backend passDoppler
doppler login
openclaw-secure store --backend doppler --doppler-project myapp --doppler-config prdHashiCorp Vault
vault login
openclaw-secure store --backend vault --addr http://127.0.0.1:8200Save defaults to ~/.openclaw-secure.json:
{
"backend": "1password",
"vault": "Private"
}import { discoverSecrets, autoStoreKeys, createBackend } from 'openclaw-secure';
const backend = createBackend('1password', { vault: 'Private' });
const results = await autoStoreKeys('~/.openclaw/openclaw.json', backend);Protects against:
- β Config file reads (placeholders only)
- β Prompt injection exfiltration
- β Accidental git commits
- β Shoulder surfing
Does NOT protect against:
- β Memory inspection (secrets in RAM while running)
- β Root access
- β Backend compromise
Config changes while running will crash the gateway.
OpenClaw hot-reloads openclaw.json when it detects changes. After openclaw-secure start, the config contains [STORED_IN_KEYCHAIN] placeholders. If OpenClaw reloads, it tries to use these placeholders as actual API keys β and fails.
This is inherent to wrapping OpenClaw externally. Secrets must stay off disk to prevent prompt injection.
# 1. Restore your secrets
openclaw-secure restoreNow OpenClaw works normally. Use /model to switch models, change settings, whatever you need.
# 2. When you're done, lock it back down
openclaw-secure startThat's it. Restore β make changes β start.
Bottom line: With 1Password biometric, even a fully compromised agent session cannot extract secrets without your fingerprint.
π¦ Part of the OpenClaw ecosystem
Secure your crustacean.
MIT Β© Michael Waltman