⌘

Bash Guardian

v2.0.0πŸ›‘οΈTier 1 Security AuditedCLI v2.1.287+ Verified

POSIX command sanitizer preventing accidental recursive deletes, fork bombs, and sudo privilege escalation.

@system-armorβ€’β˜…2,100 stars‒↓9,500 active installsβ€’MIT License
View Source β†—
⚑Installation Specifier
$/plugin install bash-guardian@marketplace

Problem 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.

Before Execution

Zero-Time AST Interception

Evaluates tool payloads prior to kernel fork.

Scoring Model

0-100 Impact Index

Weighted heuristic scoring: files touched, git dirty state, env scope.

Non-Intrusive

Native CLI Hook

Zero proxy daemon required; hooks straight into Claude tool calls.

Lifecycle Architecture & Hook Flow

POSIX Event Engine
Step 01
Claude Plan
Prompt Inference
β†’
Step 02
Tool Call
tool.call Payload
β†’
HOOK INTERCEPT
bash-guardian
<18ms Heuristic
β†’
Step 04
OS Execution
Kernel Fork

Manifest Schema (plugin.json)

{
  "name": "bash-guardian",
  "version": "2.0.0"
}

Hook Implementation (register.js)

TypeScript SDK
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.');
    }
  });
}
Security Audit99/100
Network EgressNone (Zero Socket Egress)
Filesystem ScopeBounded to Workspace
Credential Exposure0 Leaks Detected
Sandbox IsolationHost User Privilege

Technical Specifications

Min CLI Versionv2.1.287+
Categorytool-guards
Runtime Overhead< 18ms AST
LicenseMIT
Mod Publisher