Pre-Action Guard

Validate destructive file and command actions before execution.

27|8|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/Sounder25/Google-Antigravity-Skills-Library --skill pre-action-guard
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Pre-Action Guard
Source: https://github.com/Sounder25/Google-Antigravity-Skills-Library/tree/main/18_pre_action_guard
Command: npx skills add https://github.com/Sounder25/Google-Antigravity-Skills-Library --skill pre-action-guard

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

## What problem does it solve? This Skill intercepts high-stakes actions (file writes, command execution) and validates them against safety rules and the current active plan to prevent accidental data loss or system corruption.

## Core Features & Use Cases

  • Safety gate: Validates destructive or irreversible actions before they run.
  • Context awareness: Checks actions against the active plan to ensure alignment.
  • Root deletion protection: Automatically blocks dangerous broad deletions and prompts for confirmation for risky but targeted operations.

### Quick Start Use the guard_check.ps1 script to assess a risky action before execution. Example: powershell -NoProfile -ExecutionPolicy Bypass -File scripts/guard_check.ps1 -Action "write_to_file" -Target "/path/to/file" -Plan "current plan"

Frequently Asked Questions about Pre-Action Guard

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

FAQPage Schema
How do I prevent destructive PowerShell automation actions from deleting files?

To prevent destructive PowerShell automation actions from deleting files, you can use a pre-action safety guard script to validate commands against risk rules. It intercepts high-stakes operations like root deletions and blocks them before execution.

How do I validate risky commands against an active deployment plan before execution?

Validating risky commands against an active deployment plan involves checking the intended action for context awareness. A pre-action guard compares file writes and command executions to the current plan to ensure alignment and prevent unsafe changes.

Can I add a confirmation prompt for risky file write operations in PowerShell scripts?

Yes, you can add an explicit user confirmation prompt for risky file write operations in PowerShell scripts. A pre-action guard automatically triggers these prompts for targeted but dangerous operations, preventing accidental data loss.

What is the best way to gate destructive actions in deployment and maintenance workflows?

The best way to gate destructive actions in deployment and maintenance workflows is applying an automated safety guard. It enforces input validation and risk assessment, automatically blocking broad deletions and prompting for targeted risky operations.

Does the pre-action guard script require any external dependencies to run?

No, the pre-action guard script requires no external dependencies to run. It operates independently using the PowerShell environment, allowing you to execute the guard check script directly without installing additional packages.