safety-guard

Block destructive commands and confine file edits with three safety modes.

7|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/Davie521/claude-skills --skill safety-guard-davie521
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: safety-guard
Source: https://github.com/Davie521/claude-skills/tree/main/plugins/quality/skills/safety-guard
Command: npx skills add https://github.com/Davie521/claude-skills --skill safety-guard-davie521

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Use this skill to prevent destructive operations when working on production systems or running agents autonomously.

Core Features & Use Cases

  • Mode 1: Careful Mode intercepts destructive commands before execution and warns the user.
  • Mode 2: Freeze Mode locks file edits to a specific directory tree, blocking outside edits.
  • Mode 3: Guard Mode combines both protections for maximum safety.
  • Unlock and operational wrappers for safe recovery.
  • Implementation uses PreToolUse hooks to intercept commands and guard executions.
  • Integration defaults include logging and risk scoring for observability.

Quick Start

Enable safety-guard in a session and apply the desired mode to prevent destructive actions.

Frequently Asked Questions about safety-guard

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

FAQPage Schema
How do I prevent destructive commands from executing in autonomous workflows?

You can prevent destructive commands by applying PreToolUse hooks that intercept unsafe actions before execution, warning the user and blocking dangerous operations during deployments and migrations.

Can I lock file edits to a specific directory tree during production migrations?

Yes, Freeze Mode locks file edits to a specific directory tree, blocking any outside edits to confine writes to approved areas during sensitive operational tasks.

What is the best way to add guardrails for autonomous agents on production systems?

The best approach is enabling Guard Mode, which combines command interception and directory confinement to block dangerous actions and confine writes to approved areas for maximum safety.

Does safety-guard log blocked actions and risk scores for observability?

Yes, it logs comprehensive blocked-action data and applies risk scoring to ~/.claude/safety-guard.log, providing integration defaults for observability and monitoring during sensitive operations.

How do I safely recover or unlock files after applying guardrails to autonomous workflows?

You can safely recover by using the unlock and operational wrappers provided, which allow controlled recovery and safe resumption of edit operations after guardrails are applied.