Skip to content
affaan-m avatar

Safety Guard

Advisory guardrails that stop agents from running destructive commands or editing outside a chosen directory.

CCM score
67 of 100
skills.sh installs
11K
GitHub stars
312.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers three modes: Careful for warning on dangerous commands, Freeze for locking writes to one directory, and Guard for both together
  • Careful intercepts rm -rf, git push --force, git reset --hard, DROP TABLE, kubectl delete, npm publish, and --no-verify before they run
  • Freeze limits Write and Edit calls to a named tree such as src/components/, with reads still allowed everywhere
  • Advisory only: no hook ships with it, so for enforced blocking pair it with Claude Code permission deny rules or a PreToolUse hook

Install

$ npx -y skills add affaan-m/ecc --skill safety-guard -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Safety 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/".

Details

Repository
github.com/affaan-m/ecc
Categories
Security, Agent Workflow & Planning
First seen
Jul 14, 2026

Questions

What does the safety-guard skill do?

The safety-guard skill prevents destructive operations when working on production systems or running agents autonomously. It has three modes: Careful intercepts dangerous commands like rm -rf, git push --force, and DROP TABLE for confirmation, Freeze locks file writes to one directory, and Guard combines both.

Is safety-guard enforced or advisory?

The safety-guard skill is advisory, so the agent applies its rules itself and no hook ships with it. For blocking that does not depend on the agent, the skill points to Claude Code permission deny rules or a PreToolUse hook.

How do I install the safety-guard skill?

Run npx -y skills add affaan-m/ecc --skill safety-guard -y in a project to install it. Once installed, the agent can warn before destructive commands and restrict edits to a chosen directory.

Which skills rank alongside safety-guard in the Security category?

The safety-guard skill ranks in the top 100 on the Security category page of Claude Marketplaces. It guards against destructive commands and directory-wide edits during migrations, deploys, and data changes.

More from affaan-m/ecc

All 257

Similar to Safety Guard

More Security