What does this skill do?

The Security Guardian Skill intercepts destructive operations before they are executed, blocking commands such as `rm -rf`, `git push --force`, or `DROP TABLE` using PreToolUse hooks. It also allows you to restrict edits to a specific directory so that autonomous agents only modify what is authorized. Any blocked action is recorded in an audit log for later review.

Production Protection
Avoid running destructive commands on production systems or sensitive databases during deployments and migrations.
Self-Employed Insurance Agents
Restrict an agent's edits in full-auto mode to a specific directory subtree without direct supervision.
Directory Freeze
Block any "Write" or "Edit" operations outside a specific folder so that the agent focuses only on the specified area.
Peer-reviewed publications
Intercept accidental `npm publish` commands and commands with `--no-verify` before packages are sent to the registry.

Usage examples

🤖 Protected standalone session
Enable watch mode so that the agent can only write to src/api/ but can read the entire repository.
❄️ Freeze a component
Lock the files in src/components/ so that the agent doesn't modify anything outside that folder.
🛡️ Protect Before Deployment
Enable safe mode before running the database migration in production.
🔓 Disable protections
Disable all the security guardian's protections; I've already finished the deployment.

Features

Interception of Destructive Commands Blocks `rm -rf`, `git push --force`, `git reset --hard`, `DROP TABLE`, `docker system prune`, `kubectl delete`, and more before they are executed.
Write Restriction by Directory Limit edits to a specific subtree of the project using freeze or guard mode.
Three protection modes Careful Mode (confirmation), Freeze Mode (directory lock), and Guard Mode (a combination of both).
Audit Log All blocked actions are logged in ~/.claude/safety-guard.log for later review.
Native PreToolUse Hooks It works by intercepting Bash, Write, Edit, and MultiEdit through Claude hooks without disrupting the normal flow.

Frequently asked questions

Block rm -rf, git push --force, git reset --hard, git checkout ., DROP TABLE, DROP DATABASE, `docker system prune`, `kubectl delete`, `chmod 777`, `sudo rm`, `npm publish`, and any command with `--no-verify`.
Yes. In watch mode with --allow-read-all, the agent can read any file in the repository; only write operations and destructive commands are restricted.
Run the /safety-guard off command to completely disable the safety guard.
The skill uses Claude's native PreToolUse hooks. Make sure the hooks are enabled in your settings so that interception works correctly.
Security Guardian — Preventing Destructive Operations with Claude AI

¿Prefieres escuchar el contenido? Genera la narración de audio con un clic.