Safety Guard — Prevent Destructive Operations

Block destructive shell commands and restrict file writes to specified directories.

1|Updated Mar 3, 2026
One-click install
npx skills add https://github.com/samymity/bridge-ventures-backend --skill safety-guard-prevent-destructive-operations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Safety Guard — Prevent Destructive Operations
Source: https://github.com/samymity/bridge-ventures-backend/tree/main/.claude/skills/safety-guard
Command: npx skills add https://github.com/samymity/bridge-ventures-backend --skill safety-guard-prevent-destructive-operations

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents autonomous agents from performing destructive or risky filesystem and database operations that can cause irreversible damage during production work.

Core Features & Use Cases

  • Watched destructive-command blocking (Careful Mode): Intercepts high-risk bash commands and dangerous patterns (for example: rm -rf variants, forceful git operations, DROP TABLE/DROP DATABASE, aggressive chmod, prune/delete commands) and requires confirmation while suggesting safer alternatives.
  • Directory write locking (Freeze Mode): Blocks any Write/Edit operations outside a specified directory tree so agents can’t modify unrelated parts of the codebase.
  • Combined maximum protection (Guard Mode): Applies both command blocking and directory write restrictions together, allowing read access broadly while limiting writes to a targeted area.
  • Auditability and operational control: Provides an explicit off/unlock command and logs blocked actions to a local safety-guard log for traceability.

Quick Start

Enable guardrails by running the command: /safety-guard guard --dir src/api/ --allow-read-all

Frequently Asked Questions about Safety Guard — Prevent Destructive Operations

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

FAQPage Schema
How do I prevent autonomous agents from running destructive shell commands during production deploys?

Preventing destructive shell commands during production deploys requires intercepting high-risk bash operations like rm -rf variants, forceful git pushes, and DROP TABLE statements before execution, requiring confirmation while suggesting safer alternatives. It uses PreToolUse interception with configurable careful, freeze, or guard modes.

Can I restrict autonomous agent filesystem writes to a specific directory tree?

Restricting autonomous agent filesystem writes to a specific directory tree requires Freeze Mode, which blocks any Write or Edit operations outside a specified directory tree so agents cannot modify unrelated parts of the codebase while retaining broad read access.

What is the best way to combine command blocking and filesystem protection for autonomous agents?

Combining command blocking and filesystem protection for autonomous agents requires Guard Mode, which applies both destructive command blocking and directory write restrictions together, allowing read access broadly while limiting writes to a targeted area for maximum operational safety.

How do I enable guardrails to block destructive operations in a specific directory?

Enabling guardrails to block destructive operations in a specific directory requires running the command /safety-guard guard --dir src/api/ --allow-read-all, which applies combined maximum protection to constrain agent writes and intercept high-risk bash commands.

How are blocked destructive operations logged for auditability during agent runs?

Logging blocked destructive operations for auditability during agent runs requires recording intercepted actions to a local safety-guard log, providing traceability and operational control over autonomous agent runs alongside an explicit off or unlock command to disable guardrails.