Skip to content
Back to skills

Openclaw Safe Change Flow

ASecurity

Safe OpenClaw config change workflow with backup, minimal edits, validation, health checks, and rollback. Single-instance first; secondary instance optional.

  • 33 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 5, 2026
toolspythongobash

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add dvcrn/openclaw-skills-marketplace --skill openclaw-safe-change-flow --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Openclaw Safe Change Flow?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Openclaw Safe Change Flow
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dvcrn-openclaw-safe-change-flow/badge)](https://www.skillsdirectory.com/skills/dvcrn-openclaw-safe-change-flow)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: openclaw-safe-change-flow
description: "Safe OpenClaw config change workflow with backup, minimal edits, validation, health checks, and rollback. Single-instance first; secondary instance optional."
---

# OpenClaw Safe Change Flow

Goal: **avoid outages, keep rollback ready, verify every change**.
Use **single-instance** mode by default. Secondary-instance checks are optional.

---

## Scope

### Default (recommended): single instance

- Main config: `~/.openclaw/openclaw.json`

### Optional (advanced): dual instance

- Secondary config: `~/.openclaw-secondary/openclaw.json` (or your custom path)

If you do not need high-availability validation, single-instance flow is enough.

---

## Required single-instance flow

1. **Backup first**
   - Create timestamped backup: `*.bak.safe-YYYYmmdd-HHMMSS`
2. **Make minimal edits**
   - Change only necessary keys
3. **Validate immediately**
   - Run: `openclaw status --deep`
4. **Auto rollback on failure**
   - Restore backup and restart gateway
5. **Confirm availability**
   - Verify channels/interfaces respond correctly

---

## Agent execution convention (default behavior)

After this skill is installed, treat this as default policy for config changes:

- **Default entrypoint:** run config changes through `safe-change.sh`
- **Avoid direct edits + bare restart**
- **If user explicitly asks to bypass:** allow it, but warn about risk

Mental model:

- Before: edit config directly
- Now: create a small edit script and run `safe-change.sh --main-script ./edit-main.sh`

---

## Optional dual-instance enhancement

On top of single-instance flow, you may also verify a secondary instance:

- `OPENCLAW_HOME=<secondary-home> openclaw gateway health --url <secondary-url> --token "$SECONDARY_TOKEN"`
- If either instance validation fails, rollback

Use this only when change risk is high or HA checks are required.

---

## Automation script (v1.0.2+)

This skill includes `safe-change.sh` to enforce:

**backup → change → validate → rollback on failure**

### Recommended: single-instance usage

```bash
cat > ./edit-main.sh <<'SH'
#!/usr/bin/env bash
python3 edit_main.py
SH
chmod +x ./edit-main.sh

./safe-change.sh --main-script ./edit-main.sh
```

### Optional: dual-instance usage

```bash
cat > ./edit-main.sh <<'SH'
#!/usr/bin/env bash
python3 edit_main.py
SH
chmod +x ./edit-main.sh

cat > ./edit-secondary.sh <<'SH'
#!/usr/bin/env bash
python3 edit_secondary.py
SH
chmod +x ./edit-secondary.sh

export SECONDARY_TOKEN="<your-secondary-token>"
./safe-change.sh \
  --main-script ./edit-main.sh \
  --secondary-script ./edit-secondary.sh
```

When secondary checks are enabled, set `SECONDARY_TOKEN` as an environment variable.

---

## Safety rules

- Never hardcode tokens or secrets
- Validate before announcing success
- Restore service first, investigate later
- Always keep a recent known-good backup in production

---

## Manual quick template (single instance)

```bash
TS=$(date +%Y%m%d-%H%M%S)
cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bak.safe-$TS

# ...apply minimal config edits...

openclaw status --deep
```

If validation fails:

```bash
cp ~/.openclaw/openclaw.json.bak.safe-$TS ~/.openclaw/openclaw.json
openclaw gateway restart
```

Files in this skill

  • SKILL.md3.2 KB
  • safe-change.sh2.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…