Bash Guardian
v2.0.0AST Scan: 0 CriticalSource PublicCLI v2.1.287+ TestedPOSIX command sanitizer preventing accidental recursive deletes, fork bombs, and sudo privilege escalation.
claude plugin uninstall bash-guardian@marketplaceProblem Solved & Architectural Motivation
Analyzes shell command pipelines before OS execution. Replaces unquoted variables, checks sudo requirements, and converts dangerous recursive deletes into safe dry-run previews.
Zero-Time AST Interception
Evaluates tool payloads prior to kernel fork.
0-100 Impact Index
Weighted heuristic scoring: files touched, git dirty state, env scope.
Native CLI Hook
Zero proxy daemon required; hooks straight into Claude tool calls.
Lifecycle Architecture & Hook Flow
Manifest Schema (plugin.json)
{
"name": "bash-guardian",
"version": "2.0.0"
}Hook Implementation (register.js)
export default function guardian(sdk) {
sdk.on('tool.call:execute_bash', ({ command, rewrite, abort }) => {
if (command.includes('rm -rf /') || command.includes(':(){ :|:& };:')) {
return abort('Catastrophic shell pattern intercepted by Bash Guardian.');
}
});
}Static heuristic checks only. Not a formal commercial certification or warranty. Review source before installing.
Technical Specifications
Related tool-guards Mods
Pre-execution AST blast radius auditor for Claude Code CLI. Intercepts bash commands, dangerous file deletions, env leaks, and unexpected AST mutations before local execution.
Automatic API key, SSH credential, and secret redaction proxy for terminal outputs and tool requests.
Zero-trust policy engine and human-in-the-loop escalation guardrail for sensitive terminal commands.