gateguard

Blocks Edit, Write, and Bash actions until concrete codebase investigation facts are presented.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/freedom909/real-estate-saas --skill gateguard-freedom909
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gateguard
Source: https://github.com/freedom909/real-estate-saas/tree/main/.trae/skills/gateguard
Command: npx skills add https://github.com/freedom909/real-estate-saas --skill gateguard-freedom909

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI coding agents often guess instead of investigating, producing edits that break importers, mismatch data schemas, or ignore existing patterns. GateGuard replaces ineffective self-evaluation with a fact-forcing PreToolUse gate that demands concrete evidence before allowing file edits, new file creation, or destructive commands. ## Core Features & Use Cases - Edit/MultiEdit Gate: Blocks the first edit per file and requires listing all importing files, affected public functions, data schemas, and the verbatim user instruction. - Write Gate: Requires naming the callers of a new file and confirming via Glob that no existing file serves the same purpose. - Destructive Bash Gate: Triggers on commands like rm -rf, git reset --hard, and drop table, demanding a modification list and rollback procedure. - Use Case: When an agent tries to edit a shared module, the gate forces it to Grep for every importer first, preventing breaking changes across a federated GraphQL or DDD codebase. ## Quick Start Enable the included gateguard-fact-force.js hook via hooks.json, or run pip install gateguard-ai followed by gateguard init to add per-project configuration.

Frequently Asked Questions about gateguard

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

FAQPage Schema
How do I stop an AI coding agent from editing files without investigating first?▼

Use a PreToolUse hook that denies the first Edit or Write attempt and requires the agent to list importing files, affected functions, and data schemas before retrying. GateGuard implements this three-stage deny-force-allow cycle.

How to prevent destructive bash commands like rm -rf from AI agents?▼

GateGuard triggers a gate on destructive commands such as rm -rf, git reset --hard, git push --force, and drop table. The agent must list all affected files or data and write a one-line rollback procedure before the command is allowed.

Does gateguard work with MultiEdit batch operations?▼

Yes, MultiEdit is handled identically to single edits. Each file in the batch is gated individually, so the first edit per file requires the full investigation facts before proceeding.

Can I disable gateguard for setup or repair work?▼

Yes, start the session with ECC_GATEGUARD=off to disable the gate entirely. For finer control, use ECC_DISABLED_HOOKS with the GateGuard hook ID, or configure ignore paths in .gateguard.yml.

Why does AI self-evaluation fail compared to fact-forcing gates?▼

Self-evaluation questions like "did you violate any policies?" always return "no," which is experimentally verified. Forcing the agent to run Grep and Read to gather concrete facts creates context that measurably changes output quality, averaging +2.25 points in A/B tests.