AI Agent Hub
Back to plugins
🧩

agent-guard

admin-security Updated 2026.08.25

Run the following command in DeepSeek Harness:

dsh plugin install mokuyoaxis/agent-guard

Paste the following prompt into your AI chat to install this plugin:

Install by running dsh plugin install mokuyoaxis/agent-guard in DeepSeek Harness; the full source is at https://github.com/mokuyoaxis/agent-guard

About this plugin

AI agents increasingly run shell commands autonomously, and a single rm -rf or a mis-expanded variable can wipe an entire directory tree in an instant. Traditional approval workflows either interrupt the agent or become rubber-stamps under automation pressure. agent-guard takes a different approach: it does not block operations by default; it makes every destructive operation reversible from the very moment it executes.

A three-tier decision protocol (SAFE, AMBIGUOUS, FORBIDDEN) intercepts commands before they hit disk: deletions are relocated to .agent-trash/ with a manifest, Git overwrites trigger a snapshot first, and only genuinely irreversible cases escalate to a human. Every verdict, compensation intent, and restore action is recorded in append-only JSONL. Session-scoped privileges, once downgraded, can only be restored by a human. Zero third-party dependencies; Python 3.9 or later is all you need.

Built for teams running agents autonomously in DSH, Codex, or Claude Code to execute builds, cleanup, or migrations, especially where a mistaken rm carries real cost. It is not a sandbox; it is the safety net for the most common failure mode: a well-intentioned agent making a wrong call.

Use Cases

  • Agent autonomously runs rm -rf or find -delete; deletions are relocated to a trash directory with a manifest before anything is lost
  • Agent overwrites tracked files; a Git snapshot is taken first so the state can be restored instantly
  • Agent encounters an ambiguous command shape it cannot safely automate and escalates the decision to a human
  • Post-incident recovery: audit the append-only JSONL trail and restore via txid

Best For

  • Teams running agents autonomously in DSH, Codex, or Claude Code for builds, cleanup, and migrations
  • Projects where a mistaken deletion carries real cost and a default safety net is required
  • Developers who want auditable, reversible guardrails on agent operations without the overhead of a full sandbox