safety-guard
- Use it when:
- An agent works on production systems, runs unattended, or should only touch one folder during a migration or deploy.
- It does:
- Careful mode pauses before rm -rf, force pushes, DROP TABLE and similar, and suggests a safer command; Freeze mode limits writes to one directory.
- Runs:
- Until you tell the agent to stop applying the rules.
- Unlike hooks and denylists:
- Nothing blocks a tool call, as a hook or permission deny rule would; the agent follows the rules itself.
Advisory only: no hook enforces it, so nothing blocks a command the agent decides to run. It stays on until you tell the agent to stop.
TL;DR
Three modes the agent applies to itself. Careful mode watches for destructive commands: rm -rf (especially on /, ~ or the project root), git push --force, git reset --hard, git checkout ., DROP TABLE or DATABASE, docker system prune, kubectl delete, chmod 777, sudo rm, npm publish and anything with --no-verify. Before running one, the agent says what it does, asks you to confirm and offers a safer alternative. Freeze mode locks edits to a directory you name, such as src/components/, and the agent explains when a change would need to go outside it. Guard mode combines the two: read anything, write only in one folder, and ask before anything destructive. You turn it off by telling the agent to stop. The skill says plainly that it's advisory: ECC ships no command or hook for it, so for blocking that doesn't depend on the agent it points to Claude Code's permission deny rules or a PreToolUse hook.
Summarizes the skill at d2ef268.
npx skills add https://github.com/affaan-m/ecc --skill safety-guard More weekly downloads than 61% of skills
Weekly values
| Week to | Installs |
|---|---|
| Sep 21 | 258 |
| Sep 28 | 160 |
| Oct 5 | 145 |
| Oct 12 | 241 |
| Oct 19 | 415 |
| Oct 26 | 404 |
| Nov 2 | 479 |
| Nov 9 | 451 |
Fewer downloads than 87% of skills
More stars than 97% of repos
Newer than 66% of skills
| Category |
Compliance, guardrails, skill vetting and browser fingerprinting. Everything for building software: planning, coding, debugging, design, frameworks, cloud, agents and skills. |
|---|---|
| Type |
Changes how the agent talks or behaves for the rest of the session. |
| Effect |
Adds no side effects of its own. It shapes how the agent thinks, writes or reviews. Guidelines and routers are always effect:none, even when the task they support edits code. |
| Needs |
Instructions only. Works in any agent that supports skills. |
| Publisher |
Everyone else. Unverified vendor claims default to community. |
| Topics |
SKILL.md
From affaan-m/ecc at d2ef268. Checked daily, last changed Nov 6, 2026.
Frontmatter
name: safety-guard
description: "Guard against destructive operations with three modes: Careful intercepts dangerous commands (rm -rf, git push --force, DROP TABLE) for confirmation, Freeze locks writes to one directory, and Guard combines both. Advisory: the agent applies these rules itself; no hook ships with it. Use when working on production systems, running agents autonomously, restricting edits to a directory, or during migrations, deploys, and data changes."
metadata:
origin: ECCSafety Guard — Prevent Destructive Operations
When to Use
- When working on production systems
- When agents are running autonomously (full-auto mode)
- When you want to restrict edits to a specific directory
- During sensitive operations (migrations, deploys, data changes)
How It Works
Three modes of protection. They are instructions the agent follows, not enforced blocks (see Enforcement).
Mode 1: Careful Mode
Before it runs a destructive command, the agent stops and warns:
Watched patterns:
- rm -rf (especially /, ~, or project root)
- git push --force
- git reset --hard
- git checkout . (discard all changes)
- DROP TABLE / DROP DATABASE
- docker system prune
- kubectl delete
- chmod 777
- sudo rm
- npm publish (accidental publishes)
- Any command with --no-verify
When detected: shows what the command does, asks for confirmation, suggests safer alternative.
Mode 2: Freeze Mode
Locks file edits to a specific directory tree, for example: "freeze edits to src/components/".
The agent does not Write/Edit outside src/components/, and explains why when a change would need it. Useful when you want an agent to focus on one area without touching unrelated code.
Mode 3: Guard Mode (Careful + Freeze combined)
Both protections active, for example: "guard mode, write only to src/api/, read anything".
The agent can read anything but only writes to src/api/, and asks before any destructive command.
Unlock
Tell the agent to stop applying the rules.
Enforcement
This skill is advisory. ECC ships no /safety-guard command and no hook for it, so nothing blocks a tool call that breaks these rules. For blocking that does not depend on the agent, use Claude Code permission deny rules (for example Bash(rm -rf *)) or a PreToolUse hook.
Integration
- Enable by default for
codex -a neversessions - Pair with observability risk scoring in ECC 2.0