safety-guard

Block destructive commands and log actions across Careful, Freeze, and Guard modes.

1|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/riftzen-bit/gemini-setup --skill safety-guard-riftzen-bit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: safety-guard
Source: https://github.com/riftzen-bit/gemini-setup/tree/main/skills/safety-guard
Command: npx skills add https://github.com/riftzen-bit/gemini-setup --skill safety-guard-riftzen-bit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill prevents destructive operations on production systems and during autonomous agent runs by enforcing safety rails and protective modes.

Core Features & Use Cases

  • Careful Mode: Intercepts destructive commands before execution and warns the user or agent, prompting for confirmation.
  • Freeze Mode: Locks file edits to a specified directory tree to prevent changes outside the intended scope.
  • Guard Mode: Combines Careful and Freeze protections, providing maximum safety for autonomous workflows.
  • Use Case: Prevents accidental data loss during migrations, deployments, or maintenance tasks.

Quick Start

Enable safety-guard in your session and start using the provided commands to activate Careful, Freeze, or Guard protections.

Frequently Asked Questions about safety-guard

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

FAQPage Schema
How do I block destructive commands in production environments?

To block destructive commands in production, safety-guard intercepts harmful operations before execution. It enforces protective rails by warning users or autonomous agents and prompting for confirmation to prevent accidental data loss during migrations or deployments.

How can I lock file edits to a specific directory during autonomous agent runs?

You can lock file edits to a specific directory tree by activating Freeze Mode. This safety mechanism prevents autonomous agents from modifying files outside the intended scope, ensuring operations remain strictly contained within authorized boundaries.

What is the best way to protect production systems during autonomous agent workflows?

The best way to protect production systems during autonomous workflows is Guard Mode, which combines Careful and Freeze protections. This provides maximum safety by intercepting destructive commands and locking file edits to a specified directory tree simultaneously.

Does safety-guard log blocked destructive operations for later audit?

Yes, safety-guard logs blocked destructive actions to ~/.gemini/safety-guard.log. This audit trail records intercepted commands and actions, allowing you to review what operations were blocked during sensitive maintenance tasks or autonomous agent runs.

How do I resume operations after a destructive command is blocked by a safety guard?

To resume operations after a destructive command is blocked, you must use the explicit unlock command provided by safety-guard. This ensures intentional confirmation before proceeding with sensitive operations that were previously intercepted.

When do I need to enable safety rails for production maintenance tasks?

You need safety rails for production maintenance tasks like migrations or deployments where accidental data loss is a risk. Enabling protective modes ensures destructive commands are intercepted and file edits are scoped correctly to prevent unintended changes.