TOPIC / SECURITY

OpenClaw security anti-patterns: mistakes & fixes

Avoid SOUL.md bloat, missing gateway auth, public exposure, trusting all skills, no cost limits, and skipping security audits.

Use it when

  • Know the big picture is fine but keep hitting config and ops pitfalls
  • Want common anti-patterns grouped by theme, not a long list
  • Want security actions as routine before and after launch

Common security anti-patterns

These patterns look "almost fine" but often cause real security or cost issues.

Anti-pattern 1: SOUL.md too long

Issue: Every call repeats a huge system prompt. Rules get diluted and costs climb.

Fix: Keep core principles short. Move workflows and tool rules into separate files. Reserve SOUL.md for rules that must always apply.

Anti-pattern 2: No auth on the gateway

Issue: Any client can call your OpenClaw gateway.

Fix:

openclaw config set gateway.auth.mode token
openclaw config set gateway.auth.token your-secure-token-here
openclaw config list | grep gateway.auth

Anti-pattern 3: Public exposure

Issue: Dashboard or gateway bound to 0.0.0.0 without a reverse proxy.

Fix:

openclaw config set gateway.host 127.0.0.1
openclaw config set dashboard.enabled false

Use a reverse proxy (Nginx/Caddy) with HTTPS for external access.

Anti-pattern 4: Trusting all third-party skills

Issue: Installing skills without checking source, maintainer, or permissions.

Fix: Prefer ClawHub skills with the verified badge. Review permissions and code before installing.

Anti-pattern 5: No cost limits

Issue: No daily or monthly caps; runaway loops can spike bills.

Fix:

openclaw config set ai.dailyLimit 1000
openclaw config set ai.monthlyBudget 50

Combine with provider-side limits.

Anti-pattern 6: Skipping security audit

Issue: Never running the security audit before expanding skills or channels.

Fix:

openclaw security audit --deep
openclaw security audit --fix

Run regularly, especially after adding skills or channels.

Periodic review checklist

  1. Is SOUL.md growing too long?
  2. Are too many skills and tools mounted?
  3. Are permissions wider than needed?
  4. Are cost limits set?
  5. Are dev and prod separated?
  6. Have you checked bills and error rates recently?

Next steps