skip to content

What does `openclaw security audit` check in plain mode versus `--deep`, and what does `--fix` change or deliberately leave alone?

level: seniorimportance: nice to knowfreq 5%

answer

  1. cold path versus live probe
  2. checkIds with a severity
  3. plugin and skill code scans
  4. permissions and open group policies
  5. never touches bind, auth or tokens

basics

~20 s

Plain openclaw security audit reads config and files without loading plugin runtimes; --deep adds a live Gateway probe, plugin collectors and code scans. --fix applies a narrow set, open group policies to allowlists and tighter file permissions, never bind, auth or tokens.

solid answer

~40 s

The audit emits findings keyed by `checkId` with a severity, covering inbound access, tool blast radius, network exposure (bind, auth, Tailscale, weak tokens), disk permissions, plugins and dangerous flags. Plain mode stays on the cold config/filesystem path and does not load plugin runtimes. `--deep` adds best-effort live Gateway probes (`gateway.probe_*`, with `--token` or `--password` when needed), plugin-owned collectors and the `plugins.code_safety*` / `skills.code_safety*` scans. `--fix` is intentionally narrow: it flips `groupPolicy="open"` to `"allowlist"` and tightens state, config, credential and include-file permissions (600 files, 700 dirs; ACL resets on Windows). It does not rotate secrets, disable tools, change bind or auth, or remove plugins and skills, so exposure findings stay yours to fix. `--json` feeds scripts, and suppressions hide accepted findings without deleting them.

code

bash · 2 lines
bash
openclaw security audit --deep --token "$OPENCLAW_GATEWAY_TOKEN" --json \
  | jq '.findings[] | select(.severity=="critical") | .checkId'

go deeper

for a junior

Know what the audit is for: run openclaw security audit after config changes and before exposing the Gateway, and fix criticals first.

for a middle

Read checkIds by prefix and say what --fix changes: open group policies and file permissions, nothing more.

for a senior

Separate plain from --deep, supply probe credentials, interpret truncation and suppressions correctly, and own the exposure findings --fix leaves behind.

for a principal

Make the audit a gate: a deep JSON run on every config change, documented suppressions with reasons, and zero unexplained criticals before access widens.

## What the audit is for `openclaw security audit` answers one question: **has this install drifted from safe defaults?** OpenClaw ships conservative defaults (loopback bind, generated token, pairing codes for unknown DM senders on most channels), and almost every real exposure comes from a later config change. The docs say to run the audit after any config change and before exposing a network surface. Each finding has a structured `checkId`, a severity (`info`, `warn`, `critical`, some `warn/critical` depending on exposure), and a fix key. The prefixes show the families: - `fs.*` — permissions on `~/.openclaw`, `openclaw.json`, include files, credentials, auth databases, transcripts, logs; - `gateway.*` — bind and auth, Tailscale Serve and Funnel, Control UI origins, trusted proxies, token strength; - `hooks.*`, `browser.*`, `sandbox.*`, `tools.exec.*` — per-surface hardening; - `plugins.*`, `skills.*` — supply chain; - `security.exposure.*`, `security.trust_model.*` — who can trigger the agent crossed with what its tools can do. ## Plain, `--deep`, `--fix` | Invocation | What it does | What it leaves out | |---|---|---| | `openclaw security audit` | Cold config, filesystem and read-only checks | Plugin runtimes are not loaded; no live probe | | `--deep` | Adds a best-effort live Gateway probe, plugin-owned audit collectors, and plugin/skill code scans | Code scans are bounded and can report truncation | | `--fix` | Applies safe, deterministic remediations, then reports | Exposure and secret choices stay with you | | `--json` | Machine-readable summary and findings | — | **`--deep` details.** The probe reports `gateway.probe_failed` when it cannot reach or authenticate to the Gateway; pass `--token` or `--password` (or `--auth password --password` when the password only exists at startup). These override auth for that run only and never rewrite config. The code scans check up to 500 source files per plugin or skill and skip files over 1 MiB; a `*.code_safety.scan_truncated` warning means some files went unchecked, not that dangerous code was found. ## Exactly what `--fix` changes 1. Flips common `groupPolicy="open"` to `"allowlist"`, including account variants. 2. Tightens permissions on state and config and on sensitive files such as `credentials/*.json`, auth stores and transcripts: `600` for files, `700` for directories, and `icacls` resets on Windows. 3. Tightens config include files referenced from `openclaw.json`. And what it deliberately does **not** do: - rotate tokens, passwords or API keys; - disable tools such as `exec`, `cron` or `gateway`; - change `gateway.bind`, auth or any network exposure choice; - remove or rewrite plugins and skills. So after `--fix`, findings like `gateway.bind_no_auth`, `gateway.tailscale_funnel` (critical) or `gateway.token_too_short` remain. That is by design: closing a port or replacing a token can lock the owner out or break clients, and only the operator knows which exposure is intended. ## Reading and accepting findings The documented triage order is: anything open with tools enabled first, then public network exposure (wide bind, Funnel, missing auth), browser-control exposure, file permissions, plugins, model choice. For a finding you accept on purpose, add an entry to `security.audit.suppressions` matching its exact `checkId`, optionally narrowed by `titleIncludes` or `detailIncludes`, with a `reason`. Suppressed findings leave the active summary but stay in the JSON under `suppressedFindings`, and an unsuppressible `security.audit.suppressions.active` info finding tells every reader the output was filtered. Dangerous flags are reported one per finding under `config.insecure_or_dangerous_flags`, so accepting one does not hide another. Because a suppression can hide standing risk, an agent-run shell command that adds or removes one needs exec approval unless exec already runs fully trusted with approvals off. ## Three gates, three jobs The audit is one of three places OpenClaw checks exposure, and they do different work: | Gate | When it runs | What it does about a problem | |---|---|---| | Gateway startup | Every start | Refuses unsafe combinations outright: a wide bind without a secret, Serve or Funnel on a non-loopback bind, Funnel without password mode, trusted-proxy with no `trustedProxies` | | `openclaw doctor` | On demand | Warns and offers repairs, such as tightening state permissions, generating a Gateway token, or (with `--fix`) rotating a `hooks.token` that reused the Gateway secret | | `openclaw security audit` | On demand, ideally after every change | Reports drift with `checkId`s and severities; `--fix` applies only the narrow safe set | Startup catches what must never run; the audit catches what may run but should not stay that way.

  • Why does `openclaw security audit --fix` not switch a wide `gateway.bind` back to loopback?
    `--fix` is limited to safe, deterministic remediations: open group policies to allowlists and file-permission tightening. Changing bind, auth or network exposure could cut off the operator's own remote access or break clients, and only the operator knows which exposure is intended, so those findings stay for a human to resolve.
  • A deep OpenClaw audit reports `skills.code_safety.scan_truncated`. Does that mean a skill is malicious?
    No. It means the bounded code scan stopped before checking everything, for example past 500 files per plugin or skill or on files over 1 MiB. Some files went unchecked; it does not identify dangerous code. Review the unscanned parts yourself or narrow what is installed.

  • Running --fix resolves every critical finding the audit reports.
  • Plain audit already probes the live Gateway over the network.
  • A suppression deletes the finding so nobody can see it.
  • --fix rotates a token that the audit found too short.
  • A code-scan truncation warning means the skill contains malware.