Semantic shell command safety classifier — AST-based risk scoring for AI coding agents
# sh-guard [](https://crates.io/crates/sh-guard-core) [](https://www.npmjs.com/package/sh-guard) [](https://pypi.org/project/sh-guard/) [](https://github.com/aryanbhosale/sh-guard/actions/workflows/ci.yml) [](LICENSE) [](https://github.com/aryanbhosale/sh-guard/pkgs/container/sh-guard) Semantic shell command safety classifier for AI coding agents. Parses commands into ASTs, analyzes data flow through pipelines, and scores risk in under 100 microseconds. ``` $ sh-guard "rm -rf /" CRITICAL (100): File deletion: targeting filesystem root, recursive deletion Risk factors: recursivedelete MITRE ATT&CK: T1485 $ sh-guard "ls -la" SAFE (0): Information command ``` ## The Problem AI coding agents (Claude Code, Codex, Cursor, etc.) execute shell commands on your behalf. Real incidents include: - `rm -rf ~/` deleting a developer's entire home directory - A production database dropped by an AI agent during a code freeze - 70+ git-tracked files deleted after explicit "don't run anything" instructions - 43% of MCP server implementations containing command injection flaws **sh-guard catches these before execution.** ## Install ```bash # Homebrew (macOS / Linux) brew install aryanbhosale/tap/sh-guard # Cargo (Rust) cargo install sh-guard-cli # npm (CLI) npm install -g sh-guard-cli # PyPI pip install sh-guard # Docker docker run --rm ghcr.io/aryanbhosale/sh-guard "rm -rf /" # Or: Snap, Chocolatey, WinGet, GitHub Releases # See full install options below ``` ## Quick Start ### 1. Protect all your AI agents in one command ```bash sh-guard --
Agent that generates comprehensive documentation, API references, architecture diagrams, and developer onboarding guides from existing code.
Agent configuration for systematic bug investigation that traces issues from error logs through the codebase to root cause with suggested fixes.
Agent for integrating third-party APIs including SDK setup, type generation, error handling, retry logic, and rate limit management.
Cursor's built-in autonomous coding agent that can make multi-file edits, run terminal commands, search the codebase, and iteratively build features with minimal human intervention.
Cloud-based autonomous coding agent that runs in the background on remote sandboxed environments, handling complex multi-step tasks while you continue working.
Cursor's multi-file editing agent within Composer mode that can create, edit, and delete files across your entire project in a single conversation.