360 Secure SkillHub
360 安全技能中心

Config Guardian

面向 OpenClaw 宿主的配置守卫技能:更新 openclaw.json 前先做带时间戳备份,用 openclaw config set 应用变更,再用 openclaw doctor 校验,校验失败或脚本崩溃时自动回滚;另附独立校验与手动恢复脚本,强调需用户显式批准后才应用。

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

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add config-guardian
Metadata
name
config-guardian
description
Safe OpenClaw config updates with automatic backup, validation, and rollback. For agent use - prevents invalid config updates.

Config Guardian

Overview

For Agent use only. Safe config updates with automatic backup, validation, and rollback. Prevents the agent from updating non-existent keys or invalid values.

When to Use

Use this skill every time you need to update openclaw.json. Prevents:

  • Updating non-existent config keys
  • Using invalid values
  • Breaking the gateway with bad config

Workflow: Atomic Apply (Default)

For all config changes - handles everything in one command:

./scripts/atomic_apply.sh <config_path> <new_value>
# Example: ./scripts/atomic_apply.sh "agents.defaults.model.primary" "minimax-portal/MiniMax-M2.5"

What it does:

  1. Creates timestamped backup automatically
  2. Applies change via openclaw config set <path> <value>
  3. Validates with openclaw doctor --non-interactive
  4. Auto-rollback if validation fails
  5. Trap ensures rollback even on crash

Backup location:

~/.openclaw/config-guardian-backups/

Guardrails

  • Never restart or apply config without explicit user approval
  • Always use atomic_apply.sh
  • If validation fails -> config auto-rolled back, don't force it

Scripts

Script Purpose
atomic_apply.sh Default - all-in-one safe apply
validate_config.sh Validate via OpenClaw doctor
restore_config.sh Manual restore from backup