audit-openclaw-security
Run a defensive, permissioned security audit of an OpenClaw deployment and turn the results into a practical remediation plan.
This revision is tuned for OpenClaw 2026.3.8 and uses {baseDir} when referencing bundled scripts from commands.
Guardrails
- 1. Only audit systems the user owns or has explicit permission to assess.
- Never ask for raw secrets. Do not request gateway tokens/passwords, model API keys, session cookies, OAuth creds, or raw credential files.
- Prefer outputs that are designed to be shareable or redacted:
-
openclaw status --all
-
openclaw status --deep
-
openclaw gateway probe --json
-
openclaw security audit --json
-
openclaw security audit --deep --json
- 4. Treat the Gateway, Control UI, browser control, paired nodes, and automation surfaces as operator-level access.
- Default to audit-only. Before any config edits,
--fix operations, firewall changes, or restarts, create a backup first and get explicit user approval. - When the user wants remediation, make the backup step explicit:
-
openclaw backup create --verify
- use
--no-include-workspace if the config is invalid but you still need state + creds
- use
--only-config if the user only wants a minimal safety copy before edits
What “good” looks like
- - Gateway is bound to loopback unless there is a deliberate, defended reason not to.
- Strong Gateway auth is enabled.
- No accidental public exposure (LAN bind, port-forward, permissive reverse proxy, Tailscale Funnel).
- Control UI is either localhost/Serve or explicitly origin-restricted behind a trusted proxy.
- DMs require pairing or strict allowlists.
- Groups require mention gating and are not open if broad tools are enabled.
- INLINECODE10 is isolated appropriately:
-
per-channel-peer for most multi-user setups
-
per-account-channel-peer when the same provider runs multiple accounts
- - Tooling is least privilege:
-
tools.profile: "messaging" or stricter for inbox-facing agents
- deny
group:runtime,
group:fs,
group:automation on untrusted surfaces
-
tools.fs.workspaceOnly: true
-
tools.exec.security: "deny" or at least approval-gated
-
tools.elevated.enabled: false unless there is a narrow, intentional need
- - Plugins and skills are explicitly trusted, minimally writable, and not used as an easy persistence path.
- Secrets, transcripts, and logs have tight permissions and an intentional retention plan.
Use the bundled files progressively
Only open the extra files you need for the task:
- -
references/command-cheatsheet.md — exact command ladders - INLINECODE21 — current high-signal
checkId glossary - INLINECODE23 — secure baseline snippets
- INLINECODE24
- INLINECODE25
- INLINECODE26
- INLINECODE27
- INLINECODE28 — report structure
Step 0 — Establish context quickly
Collect just enough context to choose the audit path:
- - Where is OpenClaw running?
- macOS host / Mac mini
- personal laptop
- Docker host
- EC2 / VPS / other cloud VM
- native install
- Docker / Compose
- source checkout
- - Do we have local shell access?
-
Mode A: chat-only / user runs commands
-
Mode B: agent can run shell commands directly
Mode A — Assisted self-audit (chat-only)
Ask the user to run the following on the OpenClaw host and share the outputs.
Minimum audit set
CODEBLOCK0
Helpful extras
CODEBLOCK1
Safe targeted config reads
Prefer targeted reads over a full config dump:
CODEBLOCK2
DM / group follow-up checks
If the issue is “the bot is online but DMs or groups behave strangely”, check pairing and mention gating:
CODEBLOCK3
Examples of <channel> include discord, slack, signal, telegram, whatsapp, matrix, imessage, and bluebubbles.
If the user must share the config
OpenClaw config is often JSON5-like. Redact it before sharing:
CODEBLOCK4
Host / network snapshots
macOS
CODEBLOCK5
Linux / cloud VM
CODEBLOCK6
Docker / Compose
CODEBLOCK7
Mode B — Automated local audit (shell access)
Run the bundled collector and report renderer:
CODEBLOCK8
Then review openclaw-security-report.md, refine wording where needed, and present the final report to the user.
Notes on the collector
- - It is read-only by default.
- It does not run
openclaw security audit --fix. - It collects shareable CLI diagnostics plus basic host/network context.
- It now captures current high-value signals such as:
-
openclaw status --deep
-
openclaw gateway probe --json
-
openclaw channels status --probe
- targeted safe
config get values
- backup dry-run metadata
How to interpret the audit
Use OpenClaw’s own security audit output as the primary source of truth, then translate it into a clear threat narrative.
Triage order
Prioritise in this order:
- 1. Anything open + tools enabled
Lock down DMs/groups first, then tighten tool policy and sandboxing.
- 2. Public network exposure
LAN bind, Funnel, missing auth, weak reverse-proxy handling.
- 3. Browser / node / Control UI exposure
Treat these as operator access, not “just another feature”.
- 4. Filesystem permissions
State dir, config file, auth profiles, logs, and transcript locations.
- 5. Plugin / skill supply chain
Trust only what is intentionally installed and writable by the right user.
- 6. Model and prompt-injection resilience
Important, but not a substitute for access control.
Findings that are easy to miss in newer OpenClaw builds
Pay extra attention to these newer or high-signal check IDs:
- - INLINECODE44
- INLINECODE45
- INLINECODE46
- INLINECODE47
- INLINECODE48
- INLINECODE49
- INLINECODE50
- INLINECODE51
- INLINECODE52
- INLINECODE53
- INLINECODE54
- INLINECODE55
Use references/openclaw-audit-checks.md and assets/openclaw_checkid_map.json to map each finding to likely config paths and remediation areas.
Core remediation patterns
1) Gateway exposure and auth
- - Prefer
gateway.bind: "loopback". - Require token or password auth for anything beyond strictly local use.
- Do not treat
gateway.remote.* values as protection for local WS access; actual protection comes from gateway.auth.*. - If the user needs a new shared secret,
openclaw doctor --generate-gateway-token is the safe boring path.
2) Reverse proxies and browser-origin policy
If there is a reverse proxy in front of the Gateway:
- - configure INLINECODE62
- keep
gateway.allowRealIpFallback: false unless there is a very specific need - for non-loopback Control UI use, set INLINECODE64
- do not enable Host-header origin fallback unless the user knowingly accepts the downgrade
3) Tailscale Serve vs Funnel
- -
tailscale.mode: "serve" keeps the Gateway tailnet-only. - INLINECODE66 is public and should be treated as urgent/high risk.
- INLINECODE67 can allow tokenless Control UI/WebSocket auth via Tailscale identity headers. That assumes the gateway host itself is trusted.
- If untrusted code can run on the host, or if any reverse proxy sits in front of the gateway, disable
gateway.auth.allowTailscale and require token/password or trusted-proxy auth.
4) DM and group isolation
- - Use
dmPolicy: "pairing" or allowlist for inbox-facing bots. - For shared or support-style inboxes, set
session.dmScope: "per-channel-peer". - For multi-account channel setups, prefer
per-account-channel-peer. - Avoid
groupPolicy: "open" unless the tool surface is extremely limited. - Require mentions in groups and use
agents.list[].groupChat.mentionPatterns where native mentions are unreliable.
5) Tool surface reduction
Start from the conservative baseline in references/openclaw-baseline-config.md.
Good defaults for user-facing agents:
- - INLINECODE76
- deny INLINECODE77
- deny INLINECODE78
- deny INLINECODE79
- INLINECODE80
- INLINECODE81 and INLINECODE82
- INLINECODE83
- INLINECODE84
6) Node / browser / automation trust
- - Paired nodes are remote execution surfaces. Audit them like you would audit operator access.
- Browser control is not “just viewing pages”; it is effectively remote operator capability.
- INLINECODE85 /
cron tools create persistence and should not be reachable from untrusted chat surfaces.
7) Secrets, logs, transcripts, and writable paths
Audit and discuss these paths carefully without asking for raw contents:
- - INLINECODE87
- INLINECODE88
- INLINECODE89
- INLINECODE90
- INLINECODE91
- pairing stores under INLINECODE92
Platform-specific guidance
Load the matching playbook when the environment is clear:
- - macOS host / Mac mini -> INLINECODE93
- personal laptop -> INLINECODE94
- Docker / Compose -> INLINECODE95
- EC2 / VPS -> INLINECODE96
Deliverable format
Use assets/report-template.md or the rendered report from {baseDir}/scripts/render_report.py.
The final deliverable should include:
- - executive summary
- environment overview
- findings table with redacted evidence
- sequenced remediation plan
- verification commands
- residual risk / operational practices
Troubleshooting notes
“openclaw: command not found”
- - Confirm the CLI is installed and on
PATH. - On Windows, prefer WSL2 for shell-driven audit flows.
- Re-run the official install / update path, then retry
openclaw --version.
“Gateway won’t start — configuration invalid”
OpenClaw now fails closed on invalid config keys, invalid values, or invalid types. That is intentional and security-relevant.
Use:
CODEBLOCK9
Even when the config is invalid, diagnostic commands such as openclaw status, openclaw gateway status, openclaw gateway probe, and openclaw health are still useful.
“Runtime: running” but “RPC probe: failed”
Trust the probe details, not just the supervisor status:
- - INLINECODE105
- INLINECODE106
- INLINECODE107
This often means service/config drift, auth mismatch, or a listener that is not actually reachable by the CLI.
“Bot is online but DMs fail”
Check:
CODEBLOCK10
Common root causes:
- - pending pairing approval
- INLINECODE108 too strict for the expected sender
- provider-side permission or token drift
“Groups are silent”
Check:
- - INLINECODE109
- INLINECODE110
- INLINECODE111
- audit findings about open groups combined with runtime/fs/elevated tools
Trigger tests (skill author sanity check)
Should trigger:
- - “Can you audit my OpenClaw setup for security?”
- “My OpenClaw gateway is exposed through Tailscale Serve — is that okay?”
- “Interpret my
openclaw security audit --deep --json findings.” - “I’m running OpenClaw in Docker on a VPS; help me harden it.”
- “Why is my OpenClaw Control UI complaining about origins and trusted proxies?”
- “My bot is online but DMs don’t reply; can you audit pairing and access policy?”
Should not trigger:
- - generic macOS hardening unrelated to OpenClaw
- generic Docker security unrelated to OpenClaw
- general AWS or VPS hardening unrelated to OpenClaw
- unrelated software audits
技能名称: audit-openclaw-security
详细描述:
audit-openclaw-security
对 OpenClaw 部署执行防御性、授权式安全审计,并将结果转化为实用的修复计划。
此版本针对 OpenClaw 2026.3.8 进行了调整,并在引用命令中的捆绑脚本时使用 {baseDir}。
防护栏
- 1. 仅审计用户拥有或明确获得评估权限的系统。
- 绝不要求提供原始机密信息。 不得请求网关令牌/密码、模型 API 密钥、会话 Cookie、OAuth 凭证或原始凭证文件。
- 优先选择设计为可共享或可编辑的输出:
* openclaw status --all
* openclaw status --deep
* openclaw gateway probe --json
* openclaw security audit --json
* openclaw security audit --deep --json
- 4. 将网关、控制界面、浏览器控制、配对节点和自动化界面视为操作员级别的访问权限。
- 默认为仅审计。在进行任何配置编辑、--fix 操作、防火墙更改或重启之前,请先创建备份并获得用户的明确批准。
- 当用户想要修复时,明确备份步骤:
* openclaw backup create --verify
* 如果配置无效但您仍需要状态和凭证,请使用 --no-include-workspace
* 如果用户只想在编辑前获得最小的安全副本,请使用 --only-config
“良好”状态的标准
- * 除非有经过深思熟虑且有防御措施的特定原因,否则网关应绑定到 loopback。
- 已启用强网关身份验证。
- 无意外的公共暴露(LAN 绑定、端口转发、宽松的反向代理、Tailscale Funnel)。
- 控制界面要么是 localhost/Serve,要么在受信任的代理后面明确限制来源。
- 私信需要配对或严格的允许列表。
- 群组需要提及门控,并且如果启用了广泛的工具,则不应开放。
- session.dmScope 已适当隔离:
* 对于大多数多用户设置,使用 per-channel-peer
* 当同一提供商运行多个账户时,使用 per-account-channel-peer
* 对于面向收件箱的代理,使用 tools.profile: messaging 或更严格的设置
* 在不受信任的界面上拒绝 group:runtime、group:fs、group:automation
* tools.fs.workspaceOnly: true
* tools.exec.security: deny 或至少需要批准门控
* tools.elevated.enabled: false,除非有狭窄、明确的需求
- * 插件和技能是明确受信任的、最小可写性的,并且不被用作简单的持久化路径。
- 机密信息、对话记录和日志具有严格的权限和明确的保留计划。
逐步使用捆绑文件
仅打开任务所需的额外文件:
- * references/command-cheatsheet.md — 精确的命令阶梯
- references/openclaw-audit-checks.md — 当前高信号 checkId 词汇表
- references/openclaw-baseline-config.md — 安全基线片段
- references/platform-mac-mini.md
- references/platform-personal-laptop.md
- references/platform-docker.md
- references/platform-aws-ec2.md
- assets/report-template.md — 报告结构
步骤 0 — 快速建立上下文
收集足够的上下文以选择审计路径:
* macOS 主机 / Mac mini
* 个人笔记本电脑
* Docker 主机
* EC2 / VPS / 其他云虚拟机
* 本地安装
* Docker / Compose
* 源码检出
*
模式 A:仅聊天 / 用户运行命令
*
模式 B:代理可以直接运行 shell 命令
模式 A — 辅助自助审计(仅聊天)
要求用户在 OpenClaw 主机上运行以下命令并分享输出。
最小审计集
bash
openclaw --version
openclaw status --all
openclaw status --deep
openclaw gateway status
openclaw gateway probe --json
openclaw channels status --probe
openclaw doctor
openclaw security audit --json
openclaw security audit --deep --json
有用的额外命令
bash
openclaw health --json
openclaw backup create --dry-run --json
openclaw backup create --only-config --dry-run --json
openclaw skills list --eligible --json
openclaw plugins list --json
安全的目标配置读取
优先选择目标读取而非完整的配置转储:
bash
openclaw config get gateway.bind
openclaw config get gateway.auth.mode
openclaw config get gateway.auth.allowTailscale
openclaw config get gateway.controlUi.allowedOrigins
openclaw config get gateway.trustedProxies
openclaw config get gateway.allowRealIpFallback
openclaw config get discovery.mdns.mode
openclaw config get session.dmScope
openclaw config get tools.profile
openclaw config get tools.fs.workspaceOnly
openclaw config get tools.exec.security
openclaw config get tools.elevated.enabled
openclaw config get channels.defaults.dmPolicy
openclaw config get channels.defaults.groupPolicy
openclaw config get logging.redactSensitive
私信 / 群组跟进检查
如果问题是“机器人在线但私信或群组行为异常”,请检查配对和提及门控:
bash
openclaw pairing list
的示例包括 discord、slack、signal、telegram、whatsapp、matrix、imessage 和 bluebubbles。
如果用户必须分享配置
OpenClaw 配置通常是类似 JSON5 的格式。在分享前进行编辑:
bash
python3 {baseDir}/scripts/redactopenclawconfig.py ~/.openclaw/openclaw.json > openclaw.json.redacted
主机 / 网络快照
macOS
bash
whoami
sw_vers
uname -a
lsof -nP -iTCP -sTCP:LISTEN
/usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate
/usr/libexec/ApplicationFirewall/socketfilterfw --getstealthmode
fdesetup status || true
Linux / 云虚拟机
bash
whoami
cat /etc/os-release
uname -a
ss -ltnp
sudo ufw status verbose || true
sudo nft list ruleset || true
sudo iptables -S || true
Docker / Compose
bash
docker ps --format table {{.Names}} {{.Image}} {{.Ports}}
docker compose ps || true
docker port openclaw-gateway 18789 || true
模式 B — 自动化本地审计(Shell 访问)
运行捆绑的收集器和报告渲染器:
bash
bash {baseDir}/scripts/collectopenclawaudit.sh --out ./openclaw-audit
python3 {baseDir}/scripts/render_report.py --input ./openclaw-audit --output ./openclaw-security-report.md
然后审查 openclaw-security-report.md,根据需要优化措辞,并将最终报告呈现给用户。
关于收集器的说明
- * 它默认是只读的。
- 它不运行 openclaw security audit --fix。
- 它收集可共享的 CLI 诊断信息以及基本的主机/网络上下文。
- 它现在捕获当前高价值信号,例如:
* openclaw status --deep
* openclaw gateway probe --json
* openclaw channels status --probe
* 目标安全的 config get 值
* 备份试运行元数据
如何解读审计
使用 OpenClaw 自身的安全审计输出作为主要事实来源,然后将其转化为清晰的威胁叙述。
分类顺序
按此顺序确定优先级:
- 1. 任何开放 + 工具已启用
首先锁定私信/群组,然后收紧工具策略和沙箱。
- 2. 公共网络暴露
LAN 绑定、Funnel、缺少身份验证、反向代理处理薄弱。
- 3. 浏览器 / 节点 / 控制界面暴露
将其视为操作员访问,而非“仅仅是另一个功能