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
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-verifybefore 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 -yInstalls 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- Claude Devfleet11K
- Product Lens11K
- Repo Scan11K
- Laravel Plugin Discovery11K
- Agent Introspection Debugging11K
- Agent Payment X40210.9K
- Ck10.9K
- Canary Watch10.9K
- Healthcare Cdss Patterns10.9K
- Security Bounty Hunter10.9K
- Dotnet Patterns10.9K
- Healthcare Eval Harness10.9K
- Llm Trading Agent Security10.8K
- Nodejs Keccak25610.8K
- Github Ops10.8K
- Customer Billing Ops10.8K
- Lead Intelligence10.8K
- Code Tour10.7K
- Finance Billing Ops10.7K
- Api Connector Builder10.7K
- Openclaw Persona Forge10.7K
- Google Workspace Ops10.7K
- Knowledge Ops10.7K
- Workspace Surface Audit10.7K
Similar to Safety Guard
More SecurityguardrailsPlugindavepoon/buildwithclaude3.8K starsPreToolUse Bash guard for Claude Code that still holds under --dangerously-skip-permissions. Blocks pipe-to-shell installs, disk wipes and fork bombs; asks befo
safe-modeSkillrohitg00/pro-workflow172 installsOpt-in guard that warns on destructive shell commands and restricts edits to one directory tree.
git-guardrails-claude-codeSkillmattpocock/skills583.2K installsSet up a PreToolUse hook that blocks destructive git commands in Claude Code before they run.
agent-hooksSkillstarchild-ai-agent/official-skills2.2K installsManage shell hooks that block, rewrite, or warn on agent actions at fixed lifecycle points.
ThumbGate — PreToolUse Agent FirewallMCP serverigorganapolsky34 starsThumbGate is a local pre-action firewall for AI coding agents that captures feedback and enforces prevention rules.