Skills openclaw-hardening
Audit and harden an OpenClaw installation for common security misconfigurations. Covers non-loopback binding, exposed gateway listeners, root or Administrator execution, missing authentication, overly permissive tool policies, open DM access, plaintext API keys, and insecure file permissions. Use this skill whenever the user asks to secure OpenClaw, review a first-time setup, check whether a config is safe, audit local exposure, fix risky defaults before installing more skills, or asks "is my openclaw setup safe", "openclaw config audit", or "harden openclaw". Proactively offer to run this audit whenever the user mentions setting up or reconfiguring OpenClaw.
git clone https://github.com/openclaw/skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/billyhetech/openclaw-hardening-v1" ~/.claude/skills/openclaw-skills-openclaw-hardening && rm -rf "$T"
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/billyhetech/openclaw-hardening-v1" ~/.openclaw/skills/openclaw-skills-openclaw-hardening && rm -rf "$T"
skills/billyhetech/openclaw-hardening-v1/SKILL.mdOpenClaw Hardening
Audit the local OpenClaw setup without making assumptions about the host OS.
Guiding Principles
Before suggesting or applying any change, explain the risk in plain terms — users can only make informed decisions when they understand what they're accepting. Changes to files, permissions, users, or startup commands require explicit user confirmation, because an agent that acts without consent removes the user's ability to course-correct.
Use only local inspection. External network scans are out of scope for a local hardening audit and can create a false sense of security by checking reachability rather than configuration intent.
When config, process state, or permissions cannot be verified, report
Unable to verify rather than assuming the best case. A silent false OK is worse than an honest unknown.
Remind the user to restart OpenClaw after any accepted config change, since OpenClaw reads config at startup and changes don't take effect until then.
Audit Workflow
1. Detect the operating environment
Identify the platform before choosing commands.
- On Linux or macOS, prefer native shell tools such as
,id
,ps
,ss
,netstat
, andstat
.ls - On Windows, prefer PowerShell equivalents such as
,whoami
,Get-Process
,Get-NetTCPConnection
, andGet-Acl
.Select-String
If a command is unavailable, switch to an equivalent rather than failing the whole audit.
2. Inspect configuration sources in precedence order
Inspect the most specific local source you can verify:
- Running process arguments, if an OpenClaw process is already running
- Environment variables already set in the current session
- Local config files
Check common config locations:
./openclaw.json~/.openclaw/config.json%USERPROFILE%\.openclaw\config.json
Prefer the value actually in effect. If multiple sources disagree, report the highest-precedence value and note the lower-precedence values as context.
3. Audit bind address
Determine the effective bind or host value for the gateway.
- Treat
,127.0.0.1
,localhost
, and::1
as secure local-only bindings.loopback - Treat
,0.0.0.0
, or a concrete LAN/public IP as exposed unless the user explicitly wants remote access.:: - If no bind value is set, report
if you have high confidence in the current OpenClaw version's defaults, orSecure by default
otherwise.Unable to verify version-specific default
If the bind address is exposed, explain that any listener on a non-loopback interface may be reachable by other devices on the network. Offer to change it to a loopback value after user confirmation.
4. Audit gateway port exposure
Determine the effective gateway port.
- Treat
as the current default when no override is configured.18789 - Do not assume older web-app ports such as
,3000
, or3001
unless the local config or running process actually uses them.8080
Inspect active listeners for the effective port and pair the result with the bind audit:
- Local-only listener on loopback → secure
- Listener on
,0.0.0.0
, or a non-loopback address → exposed:: - No active listener and no running process → configuration only, not runtime-verified
5. Audit authentication mode
Check
gateway.auth.mode in the effective config.
- Flag as
if the field is absent or set to anything other thanDANGER
— missing auth means any local process can connect to the gateway."token" - If
is set, inspect the token value without printing it back to the user:"token"- Flag short tokens (< 20 characters), all-lowercase dictionary words, or values that look like placeholders (
,changeme
,secret
) astoken123
.WARN - Recommend storing the token via a
(env or file source) rather than inline JSON, so the credential isn't embedded in the config file itself.SecretRef
- Flag short tokens (< 20 characters), all-lowercase dictionary words, or values that look like placeholders (
6. Audit execution privileges
Check whether OpenClaw or the current shell is running with elevated privileges.
- On Linux or macOS, flag
orroot
asuid=0
for routine use.DANGER - On Windows, flag an elevated Administrator session as
for routine use.DANGER
Installed skills inherit the agent's privileges. Recommend a normal dedicated user account for daily operation, and provide platform-specific remediation steps only after user confirmation.
7. Audit tool execution policy
Inspect the
tools section of the effective config.
- Check
— flag astools.deny
if dangerous tool groups (WARN
,group:automation
,group:runtime
) are not restricted for the user's stated use case.group:fs - Check
— flag astools.exec.security
if not set toWARN
or"deny"
."ask" - Check
— flag astools.fs.workspaceOnly
if false or absent for production setups where the agent should not roam the full filesystem.WARN - Check
— if Docker is available on the host, flag asagents.defaults.sandbox.mode
if sandbox mode is not enabled. Skills run in a sandbox cannot escape to the host even if compromised.WARN
Explain that tool policy is the primary blast-radius control: a skill that exfiltrates data or deletes files can only cause harm if the tool policy allows it.
8. Audit DM and channel access policy
Inspect channel-level access settings, particularly for publicly reachable channels (WhatsApp, Telegram, Discord).
- Check
— flag asdmPolicy
if set toWARN
, since any user on the platform can then send commands to the agent."open" - Check
for group channels — flag asrequireMention
if false, since the agent will respond to every group message rather than only explicit @-mentions.WARN - Recommend
with time-limited codes (1-hour expiry) for public-facing agents."dmPolicy": "pairing"
If the gateway is local-only with no external channel configured, mark this check
OK (local only).
9. Audit secret handling
Inspect for credential hygiene issues without printing full secret values back to the user.
Check for:
- API keys or tokens stored directly in
or other plain config filesopenclaw.json - Secret files with overly broad read permissions
- Accidental credential exposure in local git history, if the config directory is a git repository
Platform-appropriate permission checks:
- On Linux or macOS, flag group/world-readable files such as
(recommended:~/.openclaw/config.json
) or a directory accessible beyond the owner (recommended:600
).700 - On Windows, inspect ACLs and flag secret files readable by broad principals such as
orEveryone
.Users
If secrets appear in tracked history or plain config, recommend rotation and migration to environment variables or a
SecretRef pointing to a local secrets file.
10. Suggest the built-in audit command
If the
openclaw CLI is on PATH, tell the user that OpenClaw ships with a built-in security audit that covers 50+ risk categories — more than this skill checks manually:
openclaw security audit # standard audit openclaw security audit --deep # extended checks including historical config openclaw security audit --fix # auto-remediate safe/low-risk issues openclaw doctor --fix # repair config schema issues
Recommend running
openclaw security audit as a follow-up step after any manual hardening.
11. Produce a concise report card
Output a short report after the audit using plain ASCII-safe formatting:
OpenClaw Security Report Card ----------------------------- [OK|WARN|DANGER|UNKNOWN] Bind Address -> [detail] [OK|WARN|DANGER|UNKNOWN] Gateway Port -> [detail] [OK|WARN|DANGER|UNKNOWN] Auth Mode -> [detail] [OK|WARN|DANGER|UNKNOWN] Execution User -> [detail] [OK|WARN|DANGER|UNKNOWN] Tool Policy -> [detail] [OK|WARN|DANGER|UNKNOWN] DM Access Policy -> [detail] [OK|WARN|DANGER|UNKNOWN] Secret Hygiene -> [detail] Score: X/7 Next Step: [single highest-value action]
Score conservatively:
= 1 pointOK
,WARN
, orDANGER
= 0 pointsUNKNOWN
Decision Guidance
- Prefer
overWARN
when exposure depends on user intent — for example, deliberate LAN access or a development machine where sandboxing isn't needed.DANGER - Prefer
over guessing when the process is not running and config is absent.UNKNOWN - If the user asks for fixes, apply the smallest safe change first.
- If the setup is already well-configured across all checks, say so clearly and avoid inventing extra work.
Incident Response
If the user suspects a skill has already compromised the installation:
- Stop the Gateway process immediately.
- Rotate
and all provider API keys (OpenAI, Anthropic, etc.).gateway.auth.token - Review session logs at
and channel transcripts./tmp/openclaw/openclaw-YYYY-MM-DD.log - Run
to identify residual issues.openclaw security audit --deep - Inspect
andSOUL.md
in the agent directory for unexpected modifications — ClawHavoc attacks are known to persist by poisoning these files to alter future agent behavior.MEMORY.md