Semantic shell command safety classifier for AI coding agents — AST-based risk scoring in under 100 microseconds
sh-guard-mcp exposes two well-named, security-focused tools with clear intent. Both tools have detailed descriptions (150+ chars) and comprehensive input schemas with proper types and enums. However, output schemas are not documented in the source code, the tool descriptions mention return fields (risk_score, risk_level, intent, MITRE ATT&CK mapping) but no formal schema is visible. Parameter descriptions are present and specific (e.g., 'shell type (bash or zsh), affects zsh-specific rule detection'). Error handling and recovery guidance are not evident in the provided code. The tools follow single-responsibility principle well (classify vs batch), but lack output schema documentation and error categorization.
Analyze multiple shell commands at once. Returns an array of analysis results.
Analyze a shell command for security risks before execution. Returns risk score (0-100), risk level (safe/caution/danger/critical), intent classification, target identification, data-flow analysis for pipelines, and MITRE ATT&CK technique mapping.
Output schemas not documented. Tool descriptions mention return fields (risk_score, risk_level, intent, MITRE ATT&CK mapping) but no formal JSON Schema is visible for responses. LLMs cannot plan downstream operations without knowing response structure.
No error handling or recovery guidance visible. Tool descriptions do not explain what errors can occur, how to interpret them, or what the LLM should do next (retry, ask user, etc.). Agents will be blind to failure modes.
No pagination or result limits documented. sh_guard_batch accepts an array of commands but does not specify max array size, result limits, or how to handle large batches. Unbounded arrays risk context window exhaustion.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 57 | 2026-07-28+ | v2 |
Tool descriptions lack 'when to use' guidance. Both tools describe what they do but not when an LLM should choose one over the other or what prerequisites exist. Descriptions should answer: 'When should I call this instead of a similar tool?'
STDIO transport only. Server is not remotely accessible and cannot be used by hosted MCP clients (Cursor, Cline, Windsurf). Limits deployment to local-only scenarios.