Run this helper free β no credit card
Every helper is free for 30 days. Answer 3 questions and get the full result in 2 minutes.
Start free βConfig Guard π‘οΈ
Prevent self-inflicted gateway crashes with automatic validation
β AI agents editing their own config files can crash the gateway and go offline with no way to recover remotely.
β Config changes are validated and backed up automatically, with instant rollback if something breaks the gateway.
- βAuto-backup before any config change is applied
- βSchema validation catches invalid fields and formats
- βCritical field protection prevents gateway-breaking edits
- βAutomatic rollback restores last working configuration instantly
π 1 views Β· π¦ 0 installs
Free to install β no account needed
Copy the command below and paste into your agent.
Instant access β’ No coding needed β’ No account needed
What you get in 5 minutes
- Full skill code ready to install
- Works with 2 AI agents
- Lifetime updates included
Run this helper
Answer a few questions and let this helper do the work.
βΈAdvanced: use with your AI agent
Description
--- name: config-guard description: Prevent OpenClaw config changes from crashing the gateway. Auto-backup, schema validation, critical field checks, and auto-rollback. Use before any config.apply, config.patch, or openclaw.json edit. metadata: openclaw: emoji: "π‘οΈ" --- # Config Guard π‘οΈ **Stop AI agents from killing themselves by editing their own config wrong.** OpenClaw agents have full access to `openclaw.json` β the file that controls the gateway, channels, models, and tools. One bad edit and the gateway crashes. The agent goes offline. Nobody can fix it remotely. This skill prevents that. ## The Problem Real incidents (all from 2026-02-04, same day): | What happened | Root cause | |---|---| | Gateway crashed after update | AI added unknown config fields (`auth`, `fallbacks`) | | Model not found | AI wrote `claude-sonnet-4.5` (dots) instead of `claude-sonnet-4-5` (hyphens) | | Telegram stopped working | Config change silently wiped the channel section | | browser.profiles error | AI forgot the required `color` field (must be hex) | | Plugin SDK missing | Update broke module paths, no validation caught it | **Core truth: AI doesn't know correct config formats. It guesses. Wrong guesses crash systems.** ## What Config Guard Does ### Before config changes: 1. **Auto-backup** β `cp openclaw.json` to timestamped backup 2. **JSON syntax check** β catches malformed JSON before it hits the gateway 3. **Schema validation** β checks required fields, correct types, valid values 4. **Semantic checks** β catches AI-specific mistakes: - Model names with dots instead of hyphens - Missing required fields (browser.profiles.color) - Unknown top-level keys - Placeholder values in sensitive fields 5. **Critical field diff** β warns if Telegram channel, auth tokens, or tool deny lists changed ### After config changes (with `--restart`): 6. **Gateway health check** β polls gateway for up to 30s 7. **Auto-rollback** β if gateway doesn't recover, restores backup automatically ## Usage ### As a script (recommended): ```bash # Validate current config bash scripts/config-guard.sh check # Validate β backup β apply β verify bash scripts/config-guard.sh apply --restart # Show what changed vs last backup bash scripts/config-guard.sh diff # Emergency rollback bash scripts/config-guard.sh rollback ``` ### As a git hook: ```bash # Install the pre-commit hook cp scripts/pre-config-hook.sh /path/to/repo/.git/hooks/pre-commit # Or chain it in your existing hook ``` ### For AI agents: ## β CRITICAL: DO NOT USE `gateway config.patch` DIRECTLY The `gateway` tool's `config.patch` action **bypasses all validation**. One wrong model name, one invalid field, and the gateway crashes. You go offline. Nobody can fix you remotely. **Use `safe-config-patch.sh` instead:** ```bash # β CORRECT: Validates before applying bash scripts/safe-config-patch.sh '{"agents":{"defaults":{"model":"anthropic/claude-opus-4-5"}}}' # β WRONG: No validation, will crash on bad input gateway config.patch raw='{"agents":{"defaults":{"model":"claude-opus-4.5"}}}' # dots = crash ``` ## MANDATORY WORKFLOW 1. **Use the safe wrapper** (validates β backs up β applies β verifies): ```bash bash /path/to/config-guard/scripts/safe-config-patch.sh '<json-patch>' ``` 2. **Never guess config field names or values.** If unsure: - Use `gateway config.schema` to check valid fields - Use `gateway config.get` to see current values - Change ONE field at a time 3. **For complex changes**, validate first: ```bash bash /path/to/config-guard/scripts/config-guard.sh check ~/.openclaw/openclaw.json ``` 4. **If gateway dies**, rollback: ```bash bash /path/to/config-guard/scripts/config-guard.sh rollback ``` ## Why This Matters On 2026-02-05, the agent used `gateway config.patch` to upgrade to Claude Opus 4.6. The model ID was wrong (`claude-opus-4-6-20260205` doesn't exist yet). Gateway kept crashing and falling back to 4.5. Human had to manually fix. **config-guard existed but was bypassed** because the agent used the raw gateway tool instead of the validated wrapper. This is exactly the failure mode this skill was designed to prevent. ## Checks Performed | Check | What it catches | |---|---| | JSON syntax | Malformed JSON, trailing commas, unquoted keys | | Unknown top-level keys | AI inventing fields like `fallbacks`, `auth` at wrong level | | Model name format | `claude-sonnet-4.5` β should be `claude-sonnet-4-5` | | browser.profiles.color | Missing required field, non-hex values | | commands.native | Missing required fields | | Placeholder values | `your-token-here`, `sk-xxx` in sensitive fields | | Empty primary model | No model configured = agent can't think | | Telegram channel wipe | Silent removal of channel config | | Auth token removal | Gateway auth accidentally deleted | | Tool deny list changes | Security-critical tools removed from deny | ## Philosophy **Prompts are suggestions. Code is law.** This skill doesn't ask the AI to "please validate before changing config." It provides executable scripts that enforce validation. The pre-commit hook blocks bad configs from being committed. The apply script auto-rollbacks on failure. The AI doesn't need to cooperate. The code runs regardless. ## Install ```bash clawdhub install config-guard # or copy the scripts/ directory to your workspace ``` ## Requirements - `python3` (for JSON parsing and validation) - `curl` (for gateway health checks) - `bash` 4+
Security Status
Scanned
Passed automated security checks
Related AI Tools
More Grow Business tools you might like
codex-collab
FreeUse when the user asks to invoke, delegate to, or collaborate with Codex on any task. Also use PROACTIVELY when an independent, non-Claude perspective from Codex would add value β second opinions on code, plans, architecture, or design decisions.
Run freeRails Upgrade Analyzer
FreeAnalyze Rails application upgrade path. Checks current version, finds latest release, fetches upgrade notes and diffs, then performs selective upgrade preserving local customizations.
Run freeAsta MCP β Academic Paper Search
FreeDomain expertise for Ai2 Asta MCP tools (Semantic Scholar corpus). Intent-to-tool routing, safe defaults, workflow patterns, and pitfall warnings for academic paper search, citation traversal, and author discovery.
Run freeHand Drawn Diagrams
FreeCreate hand-drawn Excalidraw diagrams, flows, explainers, wireframes, and page mockups. Default to monochrome sketch output; allow restrained color only for page mockups when the user explicitly wants webpage-like fidelity.
Run freeMove Code Quality Checker
FreeAnalyzes Move language packages against the official Move Book Code Quality Checklist. Use this skill when reviewing Move code, checking Move 2024 Edition compliance, or analyzing Move packages for best practices. Activates automatically when working
Run freeClaude Memory Kit
Free"Persistent memory system for Claude Code. Your agent remembers everything across sessions and projects. Two-layer architecture: hot cache (MEMORY.md) + knowledge wiki. Safety hooks prevent context loss. /close-day captures your day in one command. Z
Run free