safety-guard

Intercept destructive commands and restrict file writes to specified directories.

1|Updated Mar 27, 2026
One-click install
npx skills add https://github.com/samymity/node-poc --skill safety-guard-samymity
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: safety-guard
Source: https://github.com/samymity/node-poc/tree/main/.claude/skills/safety-guard
Command: npx skills add https://github.com/samymity/node-poc --skill safety-guard-samymity

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When working on production systems, running AI agents in fully autonomous mode, or performing sensitive operations like database migrations and code deployments, accidental execution of destructive commands (such as rm -rf, git push --force, or DROP TABLE) or unintended file edits can lead to catastrophic data loss, extended system downtime, and security vulnerabilities. This Skill eliminates these risks by providing lightweight, configurable protection layers that integrate directly with agent tool execution.

Core Features & Use Cases

  • Careful Mode: Intercepts high-risk destructive commands before execution, explains what the command will do, requests user confirmation, and suggests safer alternatives for common dangerous patterns like rm -rf, git reset --hard, docker system prune, and npm publish.
  • Freeze Mode: Locks all file write and edit operations to a specified directory tree, blocking any modifications outside the allowed path to keep autonomous agents focused on a single, designated code area.
  • Guard Mode: Combines both Careful and Freeze modes for maximum safety, allowing unrestricted read access while restricting writes to a defined directory and blocking all destructive commands across the entire system.
  • Use Case: A DevOps team running autonomous code generation agents for a microservices codebase can enable Guard Mode to ensure the agent only edits files in the src/api/ directory and cannot accidentally delete critical production data or force-push unvetted code to the main branch.

Quick Start

Enable the Safety Guard skill to automatically block high-risk destructive commands and restrict file write operations to your specified project directory for safe autonomous AI agent workflows.

Frequently Asked Questions about safety-guard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent autonomous agents from running destructive commands like rm -rf or git push --force?

To prevent autonomous agents from running destructive commands like rm -rf or git push --force, you can enable Careful Mode to intercept high-risk commands, explain their impact, and require explicit user confirmation before execution.

How do I restrict file edits to a specific directory when running AI agents?

You can restrict file edits to a specific directory by enabling Freeze Mode, which locks all file write and edit operations to a designated directory tree and blocks any modifications outside the allowed path.

What is the best way to protect production systems during autonomous code deployments and database migrations?

The best way to protect production systems during autonomous code deployments and database migrations is to use Guard Mode, which combines command interception with directory-scoped write restrictions to block destructive operations across the entire system.

Can I block destructive system commands while still allowing read access to the entire codebase?

Yes, you can block destructive system commands while allowing unrestricted read access to the entire codebase by using Guard Mode, which restricts file writes to a defined directory and intercepts dangerous commands globally.

Does the safety guard provide safer alternatives when it intercepts a dangerous command?

Yes, the safety guard provides safer alternatives when it intercepts a dangerous command, offering suggestions for common destructive patterns like rm -rf, git reset --hard, docker system prune, and npm publish during the confirmation prompt.

When should I use Careful Mode instead of Freeze Mode for AI agent workflows?

Use Careful Mode when you need to intercept and confirm destructive commands without restricting file write locations, and use Freeze Mode when you specifically need to lock file modifications to a designated directory tree for focused autonomous operations.