Gateway security guide · Independent guidance

Find, generate, and rotate an OpenClaw Gateway token

Generic config output intentionally redacts the Gateway token. In an interactive terminal, `openclaw gateway auth-token --show` resolves the configured token or SecretRef and refuses redirected output. If no token exists, generate one with doctor, restart the Gateway, and update every authorized client.

Current snapshotUpdated 2026-08-24Official docs main snapshot · OpenClaw 2026.8.1
01

Token workflow

  1. 1

    Inspect auth mode

    Use redacted status/config output first; do not reveal the token unnecessarily.

    openclaw gateway status --json
  2. 2

    Show only in an interactive terminal

    The command refuses pipes and redirection to reduce accidental logging.

    openclaw gateway auth-token --show
  3. 3

    Generate when missing

    This changes configuration; back up first, then restart the Gateway.

    openclaw doctor --generate-gateway-token
    openclaw gateway restart
    openclaw gateway status --require-rpc
02

Rotate after exposure

  • Assume compromise if a token appeared in chat, issue text, logs, shell history, a screenshot, or an analytics URL.
  • Generate a replacement, restart the Gateway, and update clients one at a time.
  • Revoke or delete cached client/device authorization that should not survive the rotation.
  • Confirm the old token fails and the expected clients still pass authenticated status checks.

Primary sources

Verify against the owner.

Content snapshot follows official docs main at the recorded commit; the current package metadata reported 2026.8.1 when verified. Your installed release and live CLI schema remain authoritative.