Skip to content

Add File Guard plugin - #430

Open
wgnrai wants to merge 1 commit into
agent0ai:mainfrom
wgnr-ai:add-file-guard
Open

Add File Guard plugin#430
wgnrai wants to merge 1 commit into
agent0ai:mainfrom
wgnr-ai:add-file-guard

Conversation

@wgnrai

@wgnrai wgnrai commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

File Guard

Protects files from agent-caused corruption by creating pre-write backups and blocking empty overwrites.

What it does

  • Pre-write backups — Before every text_editor, text_editor_remote, or office_artifact write/patch/create/edit, creates a timestamped backup in .file_guard_backups/ (5-version rotation per file).
  • Empty-overwrite blocking — If an agent attempts to write empty or whitespace-only content to a file that currently has data, the operation is blocked with a descriptive error. The original file is untouched.
  • Agent-callable restore — Includes a file_guard_restore tool that lets agents list backups and restore files themselves.

Why

AI agents that edit files can accidentally destroy working content — empty overwrites, bad patches, malformed content. Once the write lands, the previous version is gone. File Guard prevents this at the interception layer, before the write executes.

Details

  • Zero LLM calls — pure filesystem operations
  • No configuration required — works out of the box
  • Excludes caches/build artifacts (__pycache__/, .git/, node_modules/, venv/, .faiss/, *.pyc, *.pkl)
  • MIT license

Plugin repo: https://github.com/wgnr-ai/a0-file-guard

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@a0-bot

a0-bot Bot commented Aug 1, 2026

Copy link
Copy Markdown

Plugin submission validation failed

ERROR: Only files under plugins/ are allowed in plugin PRs: README.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant