360 Secure SkillHub
360 安全技能中心

Gateway Safety

该 Skill 通过 Bash 脚本安全替换 OpenClaw 网关配置:先校验 JSON 语法、备份现有配置,然后应用新配置并重启网关,再轮询 RPC 探测结果;如果探测器探测失败或超时,脚本会自动回滚;如果连续失败 3 次,脚本会写入锁定文件并停止操作。

allthebadthings
allthebadthings
热度 65.32
最近更新 2026-05-11 17:31:09
分类:自动化依赖:代码执行 / 读写文件应用场景:DevOps / 工作流 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add gateway-safety
Metadata
name
gateway-safety
description
Safely update OpenClaw gateway configuration (openclaw.json) with automatic validation, backup, and 30-second health-check rollback. Use this skill whenever an agent needs to modify gateway settings, ports, provider credentials, or network bindings to ensure the session is not permanently lost due to a bad configuration.
license
MIT

Gateway Safety

This skill ensures that any modifications to the OpenClaw gateway configuration are done safely. It prevents "death loops" and permanent session loss by verifying the gateway can successfully reboot before committing to a new config.

Core Rules

  1. Mandatory Script Use: Never edit ~/.openclaw/openclaw.json directly. Always use the provided safe-gateway-update.sh script.
  2. Anti-Loop Policy: If the script fails 3 times consecutively, it will create a GATEWAY_LOCKOUT file. If this file exists, STOP ALL OPERATIONS and wait for Kevin. Do not attempt to bypass the lockout.
  3. Backup Awareness: The script maintains its own backups, but for critical changes, manually verify ~/.openclaw/openclaw.json.known-good is up to date.

Usage

To update the gateway configuration:

  1. Prepare the new configuration JSON file (e.g., at /tmp/new_config.json).
  2. Execute the safety script:
    [SKILL_PATH]/scripts/safe-gateway-update.sh /tmp/new_config.json [timeout_seconds]
    
  3. The script will:
    • Validate the JSON syntax.
    • Backup the current config.
    • Apply the new config and restart the gateway.
    • Poll for a successful "RPC probe: ok" status.
    • Roll back to the previous config if the health check fails or times out.

Authorship

Created by Kevin Smith & Rook (Orbit Smith), March 2026.