Install
openclaw skills install @daniel-refahi-ikara/dr-agent-secretsManage persistent local OpenClaw secrets safely.
openclaw skills install @daniel-refahi-ikara/dr-agent-secretsUse when setting up, adding, inspecting, validating, or troubleshooting persistent local secrets or environment variables for Daniel-owned OpenClaw/Codex agents across sessions.
This skill stores procedures only. It must never store secret values.
openclaw-gateway.service if a restart could interrupt live work.Use this when the secret belongs to an OpenClaw config field that supports secret references.
Examples:
Workflow:
openclaw secrets configure or openclaw secrets apply, when available.openclaw secrets audit --check
memory embeddings use secret id OPENAI_API_KEY.Do not copy secret values into memory notes.
Use this when a gateway service or tools spawned by the gateway need environment variables across sessions.
Preferred layout:
~/.config/openclaw/env.d/
10-ikara-platform.env
20-azure-devops.env
30-m365-mail.env
Keep the systemd override stable and additive:
install -d -m 700 "$HOME/.config/openclaw"
install -d -m 700 "$HOME/.config/openclaw/env.d"
install -d -m 700 "$HOME/.config/systemd/user/openclaw-gateway.service.d"
cat > "$HOME/.config/systemd/user/openclaw-gateway.service.d/override.conf" <<'EOF'
[Service]
EnvironmentFile=-%h/.config/openclaw/env.d/*.env
EOF
chmod 700 "$HOME/.config/openclaw" "$HOME/.config/openclaw/env.d"
systemctl --user daemon-reload
The leading - makes missing files non-fatal. If the host/systemd version does not support glob expansion for EnvironmentFile, use multiple explicit EnvironmentFile=-%h/.config/openclaw/env.d/<name>.env lines instead.
Create one file per project/system instead of replacing a global file.
umask 077
cat > "$HOME/.config/openclaw/env.d/10-example.env" <<'EOF'
EXAMPLE_API_URL=replace-with-url
EXAMPLE_USERNAME=replace-with-username
EXAMPLE_PASSWORD=replace-with-secret
EOF
chmod 600 "$HOME/.config/openclaw/env.d/10-example.env"
Rules:
10-ikara-platform.env over one giant file.After changing only env file contents:
systemctl --user restart openclaw-gateway.service
After changing systemd override files:
systemctl --user daemon-reload
systemctl --user restart openclaw-gateway.service
Ask Daniel before restarting if the gateway is doing live work or if interruption risk is unclear.
Check permissions:
ls -ld "$HOME/.config/openclaw" "$HOME/.config/openclaw/env.d"
ls -l "$HOME/.config/openclaw/env.d"
Check that systemd sees the env files without printing secret values:
systemctl --user show openclaw-gateway.service -p EnvironmentFiles
Avoid printing full Environment because it may reveal values.
Prefer presence checks from inside the service context or a controlled diagnostic that prints only key names/status. Example shape:
systemctl --user show openclaw-gateway.service -p EnvironmentFiles
# Then verify feature behavior directly, such as memory status, provider auth, git access, or API health.
For OpenClaw memory/provider secrets, verify with the relevant command, for example:
openclaw memory status --index --deep
If a diagnostic must mention a value, show only a suffix/prefix approved by Daniel or a hash, never the full secret.
Ensure secret files are excluded from git.
Recommended .gitignore entries:
.config/openclaw/env.d/*.env
.config/openclaw/*.env
*.env
gateway.systemd.env
gateway.systemd.env.*
.env
Before committing:
git status --short
git diff --cached --name-only
If a secret-bearing file is staged, stop and unstage it. Do not rely on later cleanup.
Backup procedures may record:
Backup procedures must not record:
If a secret works in the shell but not in the gateway:
systemctl --user daemon-reload is needed.~/.openclaw/.env or ~/.openclaw/gateway.systemd.env only when investigating a known conflict.When done, report:
Never report secret values.