Gateway Guard for Openclaw

A synchronization and recovery tool that maintains OpenClaw gateway authentication and automatically resumes agent sessions after errors.

austindixson
v1.0.7
Mar 8, 2026
2
1.1k
10

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install gateway-guard

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install gateway-guard using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Gateway Guard?

Gateway Guard is a critical utility designed to ensure seamless communication between the OpenClaw orchestrator and its gateway. It actively manages the synchronization of authentication credentials, such as tokens and passwords, between the local configuration and the running gateway process. This tool is essential for developers using Openclaw Skills who encounter device_token_mismatch or unauthorized errors during agent execution.

Beyond simple configuration management, it acts as a self-healing mechanism for your AI environment. By monitoring gateway logs for unhandled errors, it can automatically trigger a continue command, allowing agents to resume their work without manual intervention. This increases the autonomy and reliability of multi-agent workflows and long-running sessions.

Gateway Guard Use Cases

  • Resolving gateway authentication issues including unauthorized access and device token mismatches.
  • Automating the restart of the gateway with correct credentials during deployment or after configuration changes.
  • Resuming interrupted agent runs automatically when the gateway logs show an unhandled stop reason.
  • Verifying the environment health of Openclaw Skills before delegating tasks to sub-agents via the orchestrator.

How Gateway Guard Works

  1. The skill parses the local configuration to identify the required authentication mode and port settings.
  2. It audits the active gateway process to detect any discrepancies between the running state and the intended configuration.
  3. If a mismatch is found, the tool can stop the gateway and restart it using the correct token or password while waiting for the port to stabilize.
  4. A background watcher monitors the gateway log file for specific error signatures indicating a run failure.
  5. Upon detecting an error, the skill waits for a cooldown period and then sends a delivery message to the agent to resume processing.

Gateway Guard Setup

To integrate Gateway Guard with your existing Openclaw Skills, follow these steps.

Verify the current status of your gateway authentication:

python3 scripts/gateway_guard.py status --json

Apply configuration fixes and restart the gateway if necessary:

python3 scripts/gateway_guard.py ensure --apply --wait

To install the persistent watcher that handles both auth sync and auto-recovery, run the installation script:

bash scripts/install_watcher.sh

Gateway Guard Data Schema & Taxonomy

Gateway Guard manages state through configuration files and dedicated log trackers for Openclaw Skills.

Component Description
openclaw.json Stores the primary gateway.auth (token or password) and gateway.port settings.
logs/gateway.log The source log file analyzed for unhandled stop reason strings.
logs/gateway-guard.continue-state.json Tracks cooldowns and execution state for the automated continue-on-error logic.
com.openclaw.gateway-guard.watcher.plist The LaunchAgent configuration used for background persistence on macOS.

Gateway Guard Advanced Features

  • Integrated token generation that automatically populates missing configuration fields during the ensure process.
  • Orchestrator-friendly JSON output for programmatically checking gateway health and recommended actions.
  • Configurable cooldown intervals to prevent rapid-fire recovery attempts during persistent system failures.
  • Support for ensure_gateway_then.sh wrappers to guarantee gateway readiness before launching TUIs or agent sessions.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*