HardeningIronheights

Hardening an OpenClaw install: a practical checklist

OpenClaw gets useful when the agent can talk to chat channels, run tools, and load community skills. That same surface is what attackers abuse. Hardening an OpenClaw install is not one magic switch. It is a short set of decisions about who can reach the gateway, who can message the agent, which tools can run on the host, where secrets live, and which skill directories are trusted. This guide is tool-agnostic first. Ironheights is one layer for scanning skills and config; it does not replace network isolation, secret management, or a human review of setup text. For what static scanning still misses, read What Ironheights cannot catch and the product limitations.

Public research keeps reinforcing why configuration matters as much as skill content. VirusTotal described skill markdown that is harmless on its own until the workflow it asks for runs. Snyk's ToxicSkills study confirmed 76 malicious payloads by hand across 3,984 skills. Koi's ClawHavoc report found 341 malicious skills in one ClawHub audit. Hardening reduces the blast radius when one of those skills, or a mis-set gateway, lands on your machine.

What you are hardening

Think of four layers. A weak layer anywhere can undo careful work elsewhere.

LayerGoalFailure mode if ignored
ReachabilityOnly you (or your VPN) can talk to the gatewayStrangers hit an open bind on the LAN or internet
Chat policyOnly allowed people and rooms can drive the agentOpen DM or group policy turns the agent into a public tool
Tool and sandboxHost exec and elevated tools stay constrainedA bad instruction gets a shell on the host with your privileges
Skills and secretsSkill roots are known; secrets are not in plaintext configExtra skill dirs and pasted tokens expand the attack surface

Ironheights config rules map to several of these checks. Examples include IH-CFG-001 (non-loopback bind), IH-CFG-002 (missing or placeholder gateway auth), IH-CFG-003 and IH-CFG-004 (open DM or group policy), IH-CFG-005 (plaintext secrets), IH-CFG-007 (dangerous tool permissions), IH-CFG-008 (extra skill directories), and IH-CFG-009 (sandbox off while tools can act). Treat rule hits as review signals, not as proof the install is safe.

Step 1: Bind the gateway to loopback unless you have a real reason

Default to gateway.bind on loopback. Exposing the gateway on LAN, Tailscale funnel, or all interfaces is a deliberate trade: remote convenience versus a wider attack surface. If you must bind beyond loopback, require real auth and prefer a private overlay you control.

Checklist:

  1. Confirm the bind address is loopback for local-only use.
  2. If the bind is not loopback, require a non-placeholder auth token or password, never none or trusted-proxy without a reviewed proxy path.
  3. Restrict firewall rules so only expected clients can reach the port.
  4. Re-check after every config edit; a "temporary" LAN bind is easy to leave in place.

A scanner that reads OpenClaw config can flag non-loopback binds and missing auth. It cannot tell whether your firewall is correct or whether a teammate published the token in chat.

Step 2: Close open DM and group policies

An agent with tools is only as safe as who can talk to it. Open DM policy means anyone who finds the bot can send instructions. Open group policy means every member of a room can. Pair that with host exec and you have a remote control surface dressed as a helpful bot.

Practical defaults for small teams:

SettingSafer defaultWhen to loosen
DM policyAllowlist or pairing, not openPublic support bots with no host tools
Group policyAllowlisted rooms and rolesLarge rooms with read-only skills only
Channel bridgesDisable unused Slack, Discord, Telegram, WhatsApp bridgesOnly enable channels you actively operate

Document who can invite the bot to new rooms. A new group join is a change-management event, not a convenience click.

Step 3: Keep secrets out of the config file

Plaintext API keys, tokens, and passwords in the OpenClaw config file are a common footgun. Prefer environment variable references or secret objects your runtime supports. On POSIX, tighten file permissions so the config is not group- or world-readable.

Also shrink what the agent can reach:

  • Do not mount production kubeconfigs, cloud CLIs with broad roles, or wallet files into the agent workspace.
  • Prefer short-lived tokens scoped to one task over long-lived personal access tokens.
  • Rotate anything that ever appeared in chat, logs, or a skill setup paste.

Credential-path findings such as IH-CRED-001 help when a skill text references ~/.ssh, browser profiles, or auth stores. They do not stop an agent from reading a path you deliberately mounted. For leak paths that never need a malicious skill, see Where your agent leaks credentials.

Step 4: Prefer a sandbox when tools can act

If the agent can run shell commands, write files, or call elevated tools, run it in a sandbox or disposable container whenever the workload allows. Sandbox disabled plus host exec is the combination many public incidents assume. Ironheights rule IH-CFG-009 flags sandbox off while tools can still act; use that as a reminder to revisit the trade-off, not as a claim that enabling sandbox removes all residual risk.

When you need host access for a specific job:

  1. Use a dedicated machine or VM with throwaway credentials.
  2. Keep network egress allowlisted where you can.
  3. Turn elevated tools off by default; enable them only for named tasks.
  4. Tear down the environment after the task instead of leaving a privileged agent idle.

Sandboxing limits blast radius. It does not remove prompt-injection risk inside the sandbox, and it does not inspect remote content the agent fetches later. That is why limitations matter next to config hardening.

Step 5: Control which directories load skills

Skills should load from known roots. Extra skill directories and broad symlink targets widen the set of files the agent may treat as trusted instructions. Pin versions when you install from a registry. Avoid "install whatever is in this shared folder" workflows on machines that also hold production secrets.

Before each new skill:

  1. Read SKILL.md yourself, especially setup and prerequisite sections.
  2. Run npx ironheights scan ./path/to/skill (or use the browser scanner).
  3. Reject remote pipes, fake prerequisites, and unexplained archive dependencies. The teardown on curl pipe to shell and the fake prerequisite anatomy cover the common shapes.
  4. Record name, version, scan verdict, and who approved the install.

For a short human pass, use the 10-minute vetting checklist. For post-incident steps if something already ran, use What to do after installing a malicious OpenClaw skill.

Step 6: Add a review gate, not only a scanner

Hardening fails when the team treats a green scan as permission to skip reading. Static scanning catches many known patterns and config mistakes. It does not catch novel obfuscation, logic hidden in remote content fetched after install, or social-engineering text a human follows anyway. Pair the scanner with:

  • A written allowlist of approved skills and versions
  • A second person for skills that request host exec or secrets
  • Baseline checks so silent file changes are visible (agent file baselines)
  • Occasional re-scans after updates, not only at first install

Compare approaches fairly. Marketplace uploads and VirusTotal checks on ClawHub reduce obvious malware at publish time and are worth using. Local pre-install scanning catches issues in the copy you actually run and can re-check after drift. Neither replaces the other. Cisco skill-scanner and similar tools may fit better when your pipeline already centers on that ecosystem; Ironheights is built around OpenClaw skill and config workflows. See the site benchmark for measured detection on the published set, and the tracker for publicly reported malicious skills.

A one-sitting hardening pass

If you have thirty minutes this week, work top to bottom:

MinutesActionDone when
0–5Confirm gateway bind and authLoopback or authenticated non-loopback only
5–10Review DM and group policiesNo open policies on agents with host tools
10–15Move secrets out of plaintext config; fix file modeNo literal tokens; restrictive permissions
15–20Check sandbox and exec securitySandbox on, or host exec deliberately justified
20–25List skill load paths and installed skillsNo surprise extraDirs; inventory written down
25–30Scan each installed skill foldernpx ironheights scan ./path/to/skill run; findings triaged

Re-run the pass after major OpenClaw upgrades, after adding a chat bridge, and after any incident involving a skill.

Where Ironheights fits — and where it stops

Ironheights can scan skill folders and surface OpenClaw config issues that match published rules. Soft CTA: start from ironheights.dev, try the scanner, and read the rule pages linked above. Official packages are on npm and GitHub releases only.

It cannot promise that a hardened install stays safe. Runtime-only behaviour, content fetched after review, and human pastes of hostile setup text sit outside static analysis. Use the scanner as one control next to bind policy, chat allowlists, secret hygiene, sandboxing, and a real review habit.

FAQ

Does hardening mean I never need to scan skills?

No. Hardening reduces blast radius when something goes wrong. Scanning and human review still matter for each new skill and each update. A locked-down gateway with a hostile skill that you run yourself can still steal anything the agent can reach.

Is loopback bind enough on a shared laptop?

It blocks remote network clients from reaching the gateway, which is necessary but not sufficient. Other local users and processes may still talk to a loopback service. Use OS user separation, file permissions, and avoid shared accounts when agents hold sensitive tokens.

Should I disable all community skills?

Only if your threat model requires it. Many teams keep a small allowlist of reviewed skills instead. The risk is unreviewed installs and open chat policies, not the idea of skills by itself. Start narrow, document approvals, and expand deliberately.

What does a config finding from Ironheights mean?

It means the file matched a published rule such as a non-loopback bind, open DM policy, plaintext secret, or sandbox disabled while tools can act. Confirm the finding in the file, decide whether the setting is intentional, and fix or document the exception. A finding is not proof of compromise.

Can I rely on ClawHub moderation alone?

ClawHub moderation and VirusTotal uploads reduce obvious bad packages at publish time. Public reports still describe skills where the dangerous step lived outside the uploaded files or arrived later. Keep local scanning, config hardening, and a human checklist.

Sources

Scan the next skill before your agent reads it

Ironheights is a free, open-source, local-first scanner and integrity monitor for OpenClaw skills. The CLI has no telemetry, and a scan makes no network calls. It reports what its rules match; it cannot prove a skill is safe.

Get Ironheights

Useful? A star on ClawHub or GitHub helps other OpenClaw, Claude and Grok Bot users find it.