dont-hack-me
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.
How to run
Say any of:
- - "run a security check"
- "check my security settings"
- "audit my clawdbot config"
- "am I secure?"
Checklist — step by step
When this skill is triggered, follow these steps exactly:
Step 0 — Read the config
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)
Step 1 — Gateway Bind
- - Path: INLINECODE4
- Expected:
"loopback" or "localhost" or "127.0.0.1" or INLINECODE8 - PASS if the value is one of the above or the key is absent (default is
"loopback") - FAIL if the value is
"0.0.0.0", "::", or any non-loopback address - Severity: CRITICAL — a non-loopback bind exposes your agent to the network
Step 2 — Gateway Auth Mode
- - Path: INLINECODE12
- Expected:
"token" or INLINECODE14 - PASS if the value is
"token" or "password", or the key is absent (default is "token") - FAIL if the value is
"off" or INLINECODE19 - Severity: CRITICAL — without auth anyone who can reach the gateway can control your agent
Step 3 — Token Strength
- - Path: INLINECODE20
- Expected: 32 or more characters
- PASS if the token is >= 32 characters
- WARN if the token is 16–31 characters
- FAIL if the token is < 16 characters or empty
- SKIP if auth mode is
"password" (passwords are user-chosen, don't judge length) - Severity: HIGH — short tokens are vulnerable to brute-force
Step 4 — DM Policy (per channel)
- - Path:
channels.<name>.dmPolicy for each channel - Expected:
"pairing" — or if "open", there must be a non-empty allowFrom array - PASS if
dmPolicy is "pairing", or if allowFrom has at least one entry - FAIL if
dmPolicy is "open" and allowFrom is missing or empty - SKIP if no channels are configured
- Severity: HIGH — an open DM policy lets anyone send commands to your agent
Step 5 — Group Policy (per channel)
- - Path:
channels.<name>.groupPolicy for each channel - Expected: INLINECODE33
- PASS if
groupPolicy is "allowlist" or absent (default is "allowlist") - FAIL if
groupPolicy is "open" or INLINECODE39 - SKIP if no channels are configured
- Severity: HIGH — non-allowlist group policy lets any group trigger your agent
Step 6 — File Permissions
- - Check: file mode of INLINECODE40
- Expected:
600 or 400 (owner read/write only) - PASS if permissions are
600 or INLINECODE44 - WARN if permissions are
644 or 640 (group/other can read) - FAIL if permissions are
777, 755, 666, or anything world-writable - Severity: MEDIUM — loose permissions let other users on the system read your tokens
Step 7 — Plaintext Secrets Scan
- - Check: scan all string values in the JSON for keys named
password, secret, apiKey, api_key, privateKey, private_key (case-insensitive) that contain a non-empty string value - PASS if no such keys are found
- WARN if such keys exist — remind the user to consider using environment variables or a secrets manager
- Note:
token fields used for gateway auth are expected and should NOT be flagged - Severity: MEDIUM — plaintext secrets in config files can be leaked through backups, logs, or version control
Output format
After completing all checks, output a report in this exact format:
CODEBLOCK1
Where:
- -
<ICON> is one of: ✅ (PASS), ⚠️ (WARN), ❌ (FAIL), ⏭️ (SKIP) - INLINECODE58 is one of:
PASS, WARN, FAIL, INLINECODE62 - INLINECODE63 is a short explanation (e.g., "loopback", "token mode", "48 chars", "permissions 600")
Auto-fix flow
If any item is FAIL or WARN, do the following:
- 1. Show the report first (as above).
- List each fixable item with a short description of what will be changed.
- Ask the user: "Want me to fix these? (yes / no / pick)"
-
yes — fix all FAIL and WARN items automatically.
-
no — stop, do nothing.
-
pick — let the user choose which items to fix.
- 4. Apply the fixes (see Fix recipes below).
- After applying, re-read the config and re-run the full check to confirm everything is PASS.
- If the config was changed, remind the user: "Run
clawdbot gateway restart to apply the new settings."
Fix recipes
Use these exact fixes for each item. Edit ~/.clawdbot/clawdbot.json using the edit/write tool.
#1 Gateway Bind — FAIL
Set
gateway.bind to
"loopback":
CODEBLOCK2
#2 Gateway Auth — FAIL
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).
#3 Token Strength — FAIL / WARN
Replace the existing token with a new strong one:
openssl rand -hex 24
Write the output into
gateway.auth.token.
#4 DM Policy — FAIL
Set
dmPolicy to
"pairing" for each affected channel:
CODEBLOCK6
#5 Group Policy — FAIL
Set
groupPolicy to
"allowlist" for each affected channel:
CODEBLOCK7
#6 File Permissions — FAIL / WARN
Run:
CODEBLOCK8
#7 Secrets Scan — WARN
This one cannot be auto-fixed safely. Instead, list each flagged key and
remind the user:
- - Move the value to an environment variable
- Or use a secrets manager
- Reference it in the config as
"$ENV_VAR_NAME" if the platform supports it
Important rules for auto-fix
- - Always back up first. Before writing any changes, copy the original:
cp ~/.clawdbot/clawdbot.json ~/.clawdbot/clawdbot.json.bak
- - Merge, don't overwrite. Read the full JSON, modify only the specific
keys, write back the complete JSON. Never lose existing settings.
- - Preserve formatting. Write the JSON with 2-space indentation.
- One write operation. Collect all JSON fixes, apply them in a single
write to avoid partial states.
- - Token replacement requires restart. If the gateway token was changed,
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."
What this skill does NOT check
- - Sandbox configuration (not needed for most setups)
- Network isolation / Docker (macOS native setups don't use it)
- MCP tool permissions (too complex for a basic audit)
- Whether your OS firewall is configured
- Whether your agent code has vulnerabilities
For a more comprehensive audit, see community tools like clawdbot-security-check.
Reference
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 服務,不限平台。
别黑我
Clawdbot / Moltbot 的安全自检技能。
读取 ~/.clawdbot/clawdbot.json 并检查涵盖最常见配置错误的 7 个项目。输出简单的通过/失败/警告报告。
如何运行
说出以下任意指令:
- - 运行安全检查
- 检查我的安全设置
- 审计我的 clawdbot 配置
- 我安全吗?
检查清单 — 逐步操作
当此技能被触发时,请严格按以下步骤操作:
步骤 0 — 读取配置
使用 read 工具打开 ~/.clawdbot/clawdbot.json。
解析 JSON 内容。如果文件不存在或无法读取,则报告错误并停止。
同时运行 shell 命令获取文件权限:
stat -f %Lp ~/.clawdbot/clawdbot.json
(在 Linux 上:stat -c %a ~/.clawdbot/clawdbot.json)
步骤 1 — 网关绑定
- - 路径: gateway.bind
- 期望值: loopback 或 localhost 或 127.0.0.1 或 ::1
- 通过 如果值为上述之一或该键不存在(默认值为 loopback)
- 失败 如果值为 0.0.0.0、:: 或任何非回环地址
- 严重性: 严重 — 非回环绑定会将你的代理暴露在网络中
步骤 2 — 网关认证模式
- - 路径: gateway.auth.mode
- 期望值: token 或 password
- 通过 如果值为 token 或 password,或该键不存在(默认值为 token)
- 失败 如果值为 off 或 none
- 严重性: 严重 — 没有认证,任何能访问网关的人都可以控制你的代理
步骤 3 — 令牌强度
- - 路径: gateway.auth.token
- 期望值: 32 个或更多字符
- 通过 如果令牌长度 >= 32 个字符
- 警告 如果令牌长度为 16–31 个字符
- 失败 如果令牌长度 < 16 个字符或为空
- 跳过 如果认证模式为 password(密码由用户选择,不评判长度)
- 严重性: 高 — 短令牌容易受到暴力破解攻击
步骤 4 — 私信策略(每个频道)
- - 路径: 每个频道的 channels..dmPolicy
- 期望值: pairing — 或者如果是 open,则必须有一个非空的 allowFrom 数组
- 通过 如果 dmPolicy 为 pairing,或者 allowFrom 至少有一个条目
- 失败 如果 dmPolicy 为 open 且 allowFrom 缺失或为空
- 跳过 如果没有配置任何频道
- 严重性: 高 — 开放的私信策略允许任何人向你的代理发送命令
步骤 5 — 群组策略(每个频道)
- - 路径: 每个频道的 channels..groupPolicy
- 期望值: allowlist
- 通过 如果 groupPolicy 为 allowlist 或不存在(默认值为 allowlist)
- 失败 如果 groupPolicy 为 open 或 any
- 跳过 如果没有配置任何频道
- 严重性: 高 — 非白名单群组策略允许任何群组触发你的代理
步骤 6 — 文件权限
- - 检查: ~/.clawdbot/clawdbot.json 的文件模式
- 期望值: 600 或 400(仅所有者读写)
- 通过 如果权限为 600 或 400
- 警告 如果权限为 644 或 640(组/其他可读)
- 失败 如果权限为 777、755、666 或任何全局可写
- 严重性: 中 — 宽松的权限允许系统上的其他用户读取你的令牌
步骤 7 — 明文密钥扫描
- - 检查: 扫描 JSON 中所有字符串值,查找键名为 password、secret、apiKey、apikey、privateKey、privatekey(不区分大小写)且包含非空字符串值的条目
- 通过 如果没有找到此类键
- 警告 如果存在此类键 — 提醒用户考虑使用环境变量或密钥管理器
- 注意: 用于网关认证的 token 字段是预期的,不应被标记
- 严重性: 中 — 配置文件中的明文密钥可能通过备份、日志或版本控制泄露
输出格式
完成所有检查后,按以下精确格式输出报告:
🔒 安全检查报告
- 1. 网关绑定 <图标> <状态> — <详情>
- 网关认证 <图标> <状态> — <详情>
- 令牌强度 <图标> <状态> — <详情>
- 私信策略 <图标> <状态> — <详情>
- 群组策略 <图标> <状态> — <详情>
- 文件权限 <图标> <状态> — <详情>
- 密钥扫描 <图标> <状态> — <详情>
评分:X/7 通过,Y 警告,Z 失败
其中:
- - <图标> 为:✅(通过)、⚠️(警告)、❌(失败)、⏭️(跳过)
- <状态> 为:PASS、WARN、FAIL、SKIP
- <详情> 为简短说明(例如:回环、令牌模式、48 字符、权限 600)
自动修复流程
如果任何项目为失败或警告,请执行以下操作:
- 1. 首先显示报告(如上所示)。
- 列出每个可修复项目及其将要更改的简短描述。
- 询问用户:要我修复这些问题吗?(是 / 否 / 选择)
-
是 — 自动修复所有失败和警告项目。
-
否 — 停止,不做任何操作。
-
选择 — 让用户选择要修复的项目。
- 4. 应用修复(见下面的修复配方)。
- 应用后,重新读取配置并重新运行完整检查以确认所有项目均为通过。
- 如果配置已更改,提醒用户:运行 clawdbot gateway restart 以应用新设置。
修复配方
对每个项目使用以下精确修复。使用编辑/写入工具编辑 ~/.clawdbot/clawdbot.json。
#1 网关绑定 — 失败
将 gateway.bind 设置为 loopback:
json
{ gateway: { bind: loopback } }
#2 网关认证 — 失败
将 gateway.auth.mode 设置为 token。如果尚不存在令牌,则同时生成一个:
json
{ gateway: { auth: { mode: token, token: <生成的> } } }
使用以下命令生成令牌:
bash
openssl rand -hex 24
这将生成一个 48 字符的十六进制字符串(192 位熵)。
#3 令牌强度 — 失败 / 警告
用新的强令牌替换现有令牌:
bash
openssl rand -hex 24
将输出写入 gateway.auth.token。
#4 私信策略 — 失败
将每个受影响频道的 dmPolicy 设置为 pairing:
json
{ channels: { <名称>: { dmPolicy: pairing } } }
#5 群组策略 — 失败
将每个受影响频道的 groupPolicy 设置为 allowlist:
json
{ channels: { <名称>: { groupPolicy: allowlist } } }
#6 文件权限 — 失败 / 警告
运行:
bash
chmod 600 ~/.clawdbot/clawdbot.json
#7 密钥扫描 — 警告
此项目无法安全地自动修复。相反,列出每个被标记的键并提醒用户:
- - 将值移至环境变量
- 或使用密钥管理器
- 如果平台支持,在配置中引用为