safety-guard

Intercept Bash, Write, Edit, and MultiEdit actions to block destructive commands and unsafe file edits.

Updated Jun 24, 2026
One-click install
npx skills add https://github.com/mostafa-ismail-2004/codex-plugin --skill safety-guard-mostafa-ismail-2004
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: safety-guard
Source: https://github.com/mostafa-ismail-2004/codex-plugin/tree/main/skills/safety-guard
Command: npx skills add https://github.com/mostafa-ismail-2004/codex-plugin --skill safety-guard-mostafa-ismail-2004

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps prevent destructive commands and unsafe edits when an agent is working on production systems, running autonomously, or handling sensitive changes.

Core Features & Use Cases

  • Destructive Command Blocking: Detects and intercepts risky operations such as force pushes, hard resets, bulk deletions, and dangerous system or database commands.
  • Directory Write Restrictions: Freezes edits to a chosen path so an agent can work safely within one area without changing unrelated files.
  • Autonomous Safety Mode: Combines command blocking and write scoping for high-trust workflows like migrations, deploys, and emergency maintenance.

Quick Start

Ask the agent to enable safety guard mode for the current project and restrict writes to the specified 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 autonomous agents from running destructive shell commands?

You prevent destructive shell commands by using hook-based interception to validate Bash, Write, Edit, and MultiEdit actions against active guard rules before execution. This blocks risky operations like force pushes, hard resets, and bulk deletions during autonomous development.

Can I restrict file edits to a specific directory during production-adjacent development?

Yes, you can restrict file edits to a specific directory by applying directory write restrictions that freeze changes outside a chosen path. This ensures an agent works safely within one area without modifying unrelated files during sensitive operations.

What is autonomous safety mode for agent workflows like migrations and deploys?

Autonomous safety mode is a combined protective state that enforces both destructive command blocking and write scoping for high-trust workflows. It secures migrations, deploys, and emergency maintenance by intercepting unsafe shell commands and file modifications.

How do I set up guardrails for an agent handling sensitive changes in production?

You set up guardrails by enabling safety guard mode for the current project and restricting writes to the specified directory. This activates path and command validation to intercept risky actions before they run during sensitive production work.

Does this safety guard work without external dependencies?

Yes, the safety guard works without external dependencies, relying entirely on hook-based interception of Bash, Write, Edit, and MultiEdit actions. It validates command execution and file modifications against active guard rules internally.

What risky operations does command blocking intercept during autonomous development?

Command blocking intercepts risky operations such as force pushes, hard resets, bulk deletions, and dangerous system or database commands. It validates these destructive shell commands against active guard rules before they execute during autonomous workflows.