token-safety-checker

Scan openclaw.json for plaintext secrets (tokens, API keys, passwords) and migrate them to environment variables using SecretRef. Use when the user asks to "check token safety", "privatize secrets", "move tokens to env vars", "audit openclaw config for secrets", or after any openclaw.json edit that may have introduced plaintext credentials. Also use when setting up a new OpenClaw instance for the first time.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "token-safety-checker" with this command: npx skills add maoisdamao/token-safety-checker

Token Safety Checker

Scan openclaw.json for plaintext secrets and migrate them to environment variables via SecretRef. All operations run locally. Secret values are never passed as CLI arguments, never logged, and never appear in agent context.

Script

Single entry point: scripts/safeclaw.py

python3 safeclaw.py scan    [--config PATH]
python3 safeclaw.py migrate [--findings JSON] [--config PATH] [--profile PATH] [--dry-run] [--restore]

How secrets are protected

RiskMitigation
Secret values in scan outputscan returns paths + lengths only — never values
Secret values in CLI argsmigrate reads values from disk internally — never via --values arg
Secret values in dry-run outputMasked as export VAR="***"
Secret values in agent contextfindings JSON only contains path, env_var, length — safe to pass through SKILL
Secret values in logsNo logging of values at any point

Workflow

1. Scan

python3 <skill_dir>/scripts/safeclaw.py scan [--config ~/.openclaw/openclaw.json]

Output (safe to use in agent context — no secret values):

{
  "findings": [
    { "path": "channels.discord.token", "env_var": "OPENCLAW_DISCORD_TOKEN", "length": 72 }
  ],
  "shell": { "name": "zsh", "profile": "~/.zshrc", "source_cmd": "source ~/.zshrc" }
}

Exit 0 = clean → report and stop. Exit 1 = findings → continue. Exit 2 = config not found.

2. Show findings to user and confirm

Present the findings table (path | env_var | length). Allow renaming env vars. Do not proceed without explicit confirmation.

3. Dry-run

python3 <skill_dir>/scripts/safeclaw.py migrate \
  --findings '<findings JSON from step 1>' \
  --dry-run

Show output to user. The script re-reads config from disk to verify findings are still current. Confirm before proceeding.

4. Migrate

python3 <skill_dir>/scripts/safeclaw.py migrate \
  --findings '<findings JSON from step 1>'

The script:

  1. Re-scans config from disk to confirm findings are still plaintext
  2. Backs up openclaw.jsonopenclaw.json.bak
  3. Reads secret values internally from disk (not from CLI args)
  4. Appends env exports to shell profile (skips duplicates, masks values in output)
  5. Replaces plaintext values with SecretRef in openclaw.json

5. Source profile + restart gateway

⚠️ Check how the gateway is managed:

Shell-launched (most local setups):

source <profile>
openclaw gateway restart

systemd: Add vars to EnvironmentFile= in the unit — sourcing a shell profile won't work.

Docker: Pass via -e or environment: in compose.

6. Verify

python3 <skill_dir>/scripts/safeclaw.py scan   # exit 0 = clean
openclaw gateway status

7. Rollback

python3 <skill_dir>/scripts/safeclaw.py migrate --restore

SecretRef format

{ "source": "env",  "provider": "default", "id": "MY_ENV_VAR" }
{ "source": "file", "provider": "default", "id": "/path/to/secret.txt" }
{ "source": "exec", "provider": "default", "id": "command --prints --secret" }

env is recommended for most setups. For higher-security environments, prefer file or exec.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Gigo Lobster Resume

🦞 GIGO · gigo-lobster-resume: 续跑入口:v2 stable 当前会清理旧 checkpoint 并从头重跑;保留此 slug 作为旧 checkpoint 兼容入口。 Triggers: 继续试吃 / 恢复评测 / resume tasting / continue lobster...

Registry SourceRecently Updated
General

YiHui CONTEXT MODE

context-mode is an MCP server that saves 98% of your context window by sandboxing tool outputs. It routes large file reads, shell outputs, and web fetches th...

Registry SourceRecently Updated
General

xinyi-drink

Use when users ask about 新一好喝/新一咖啡 drinks, stores, menu, activities, Skill用户大礼包, today drink recommendations, afternoon tea, feeling sleepy, or personalized...

Registry SourceRecently Updated
General

vedic-destiny

吠陀命盘分析中文入口。用于完整命盘研判、命主盘 Rashi chart 与九分盘 Navamsha chart 联读、既往事件回看、出生时间稳定度判断、事业主题、婚姻主题、时空盘专题,以及基于 Jagannatha Hora PDF、星盘截图或文本命盘数据的系统拆盘。当用户提到完整星盘、事业方向、婚姻问题、关系窗...

Registry SourceRecently Updated