Security self-check skill for Clawdbot / Moltbot.
Reads ~/.clawdbot/clawdbot.json and checks 7 items that cover the most
common misconfigurations. Outputs a simple PASS / FAIL / WARN report.
Say any of:
When this skill is triggered, follow these steps exactly:
Use the read tool to open ~/.clawdbot/clawdbot.json.
Parse the JSON content. If the file does not exist or is unreadable,
report an error and stop.
Also run a shell command to get the file permissions:
stat -f '%Lp' ~/.clawdbot/clawdbot.json
(On Linux: stat -c '%a' ~/.clawdbot/clawdbot.json)
gateway.bind"loopback" or "localhost" or "127.0.0.1" or "::1""loopback")"0.0.0.0", "::", or any non-loopback addressgateway.auth.mode"token" or "password""token" or "password", or the key is absent (default is "token")"off" or "none"gateway.auth.token"password" (passwords are user-chosen, don't judge length)channels..dmPolicy for each channel"pairing" — or if "open", there must be a non-empty allowFrom arraydmPolicy is "pairing", or if allowFrom has at least one entrydmPolicy is "open" and allowFrom is missing or emptychannels..groupPolicy for each channel"allowlist"groupPolicy is "allowlist" or absent (default is "allowlist")groupPolicy is "open" or "any"~/.clawdbot/clawdbot.json600 or 400 (owner read/write only)600 or 400644 or 640 (group/other can read)777, 755, 666, or anything world-writablepassword, secret, apiKey, api_key, privateKey, private_key (case-insensitive) that contain a non-empty string valuetoken fields used for gateway auth are expected and should NOT be flaggedAfter completing all checks, output a report in this exact format:
🔒 Security Check Report
1. Gateway Bind <ICON> <STATUS> — <detail>
2. Gateway Auth <ICON> <STATUS> — <detail>
3. Token Strength <ICON> <STATUS> — <detail>
4. DM Policy <ICON> <STATUS> — <detail>
5. Group Policy <ICON> <STATUS> — <detail>
6. File Permissions <ICON> <STATUS> — <detail>
7. Secrets Scan <ICON> <STATUS> — <detail>
Score: X/7 PASS, Y WARN, Z FAIL
Where:
is one of: ✅ (PASS), ⚠️ (WARN), ❌ (FAIL), ⏭️ (SKIP) is one of: PASS, WARN, FAIL, SKIP is a short explanation (e.g., "loopback", "token mode", "48 chars", "permissions 600")If any item is FAIL or WARN, do the following:
clawdbot gateway restart to apply the new settings."Use these exact fixes for each item. Edit ~/.clawdbot/clawdbot.json using the edit/write tool.
Set gateway.bind to "loopback":
{ "gateway": { "bind": "loopback" } }
Set gateway.auth.mode to "token". If no token exists yet, also generate one:
{ "gateway": { "auth": { "mode": "token", "token": "<GENERATED>" } } }
Generate the token with:
openssl rand -hex 24
That produces a 48-character hex string (192-bit entropy).
Replace the existing token with a new strong one:
openssl rand -hex 24
Write the output into gateway.auth.token.
Set dmPolicy to "pairing" for each affected channel:
{ "channels": { "<name>": { "dmPolicy": "pairing" } } }
Set groupPolicy to "allowlist" for each affected channel:
{ "channels": { "<name>": { "groupPolicy": "allowlist" } } }
Run:
chmod 600 ~/.clawdbot/clawdbot.json
This one cannot be auto-fixed safely. Instead, list each flagged key and
remind the user:
"$ENV_VAR_NAME" if the platform supports it```bash
cp ~/.clawdbot/clawdbot.json ~/.clawdbot/clawdbot.json.bak
```
keys, write back the complete JSON. Never lose existing settings.
write to avoid partial states.
the user must update any paired clients with the new token.
Warn: "Your gateway token was changed. Any paired devices will need the
new token to reconnect."
For a more comprehensive audit, see community tools like clawdbot-security-check.
Based on the community-compiled "Top 10 Clawdbot/Moltbot Security Vulnerabilities" list.
Covers 7 of the 10 items that apply to typical macOS-native deployments.
小安 Ann Agent — Taiwan 台灣
Building skills and local MCP services for all AI agents, everywhere.
為所有 AI Agent 打造技能與在地 MCP 服務,不限平台。
共 1 个版本