Destructive command guard
Also known as: command guard, agent command filter, dangerous command blocking, agentic command safety
AI coding agents execute shell commands (instructions that run directly on your computer or server) as part of their work. Most of the time this is fine. Occasionally an agent will plan a command that would cause real damage: deleting files recursively, overwriting a database, force-pushing to a main branch (the primary version of a codebase), or running a script with unintended side effects. A destructive command guard is a layer that watches the queue of pending commands, matches them against a blocklist or rule set of dangerous patterns, and stops or flags them before execution.
The concept gained visibility in mid-2026 as part of a broader wave of agentic security tooling, appearing in GitHub Trending discussions alongside sandbox escape research. The core implementation is usually a pre-execution hook (a function that runs automatically before an action): the agent outputs a command, the hook checks it, and either lets it through, asks for human confirmation, or blocks it outright. Some implementations are static blocklists; more sophisticated ones use a lightweight model to reason about whether a command matches the stated task.
For builders running agentic coding tools on real codebases, destructive command guards represent a practical middle ground between full sandboxing (which can be complex to configure) and no safety layer (which is how most people run today). The setup is usually a config file in the project root (the top-level folder of a codebase) that defines blocked command patterns and exception conditions. It doesn't prevent all agentic misuse, but it adds a meaningful friction layer for the most common failure modes.