safety-guard

Intercept destructive commands via PreToolUse hooks during autonomous execution.

3|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/idiaz01/enterprise-superpowers --skill safety-guard
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: safety-guard
Source: https://github.com/idiaz01/enterprise-superpowers/tree/main/content/skills/safety-guard
Command: npx skills add https://github.com/idiaz01/enterprise-superpowers --skill safety-guard

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Protect against destructive operations when working on production systems or running autonomous agents.

Core Features & Use Cases

  • Intercepts destructive commands before execution (rm -rf, git push --force, etc.)
  • Freeze Mode restricts edits to a specific directory, blocking outside changes
  • Guard Mode combines Careful + Freeze for maximum safety during autonomous sessions
  • Logs blocked actions to ~/.claude/safety-guard.log
  • Enabled by default for autonomous sessions

Quick Start

Enable Safety Guard for autonomous sessions to intercept risky commands and lock edits to a safe directory.

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 like rm -rf during autonomous agent sessions?

You can prevent destructive commands during autonomous agent sessions by implementing PreToolUse hooks that intercept and block risky Bash calls like rm -rf before they execute. This guardrail mechanism monitors tool invocations and halts dangerous operations automatically.

How do I restrict file edits to a specific directory and block changes outside of it?

You can restrict file edits to a specific directory and block changes outside of it by enabling Freeze Mode. This safety feature locks modifications to a designated safe directory, preventing unauthorized edits to files outside the defined boundary during development workflows.

What is the best way to protect production environments from accidental force pushes?

Protecting production environments from accidental force pushes requires command interception guardrails that monitor git push --force calls via PreToolUse hooks. These guardrails block destructive operations before they impact the production system.

Does Guard Mode combine directory restrictions with command interception for autonomous ops?

Yes, Guard Mode combines directory restrictions with command interception for autonomous ops. It merges Freeze Mode and Careful Mode to provide maximum safety, locking edits to a safe directory while intercepting destructive commands during autonomous sessions.

Can I log blocked actions to monitor what commands were intercepted?

Yes, you can log blocked actions to monitor intercepted commands. Blocked actions are logged to a safety-guard log file, providing an audit trail of destructive commands that were halted during autonomous agent execution or development workflows.