Skip to main content
Glama
security-gate-x402

security-gate-x402

inspect_shell_command_safety

Ultra-low latency (<2ms) deterministic lexical and syntax inspector for Unix/Bash/Windows shell commands. Intercepts destructive disk commands (rm -rf, dd, mkfs, fork bombs), reverse shells (/dev/tcp, netcat), pipeline obfuscation (base64…

Instructions

Ultra-low latency (<2ms) deterministic lexical and syntax inspector for Unix/Bash/Windows shell commands. Intercepts destructive disk commands (rm -rf, dd, mkfs, fork bombs), reverse shells (/dev/tcp, netcat), pipeline obfuscation (base64 -d | sh), and credential harvesting (cat .env, id_rsa) before terminal execution.

Input Schema

NameRequiredDescriptionDefault
commandYesThe shell command line or chained pipeline string to inspect prior to terminal/bash execution.ls -la /app

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.3

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses latency characteristics (<2ms), that it is deterministic, and that it is purely lexical/syntax-based (not semantic), which are meaningful behavioral traits. It does not describe the return shape or what action the caller should take on a positive detection, which keeps it from a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two tight sentences with the latency claim front-loaded and threat categories grouped efficiently. It is slightly dense with parenthetical example lists but nothing is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter pre-execution inspection tool with no output schema and no annotations, the description covers purpose, timing, performance envelope, and detection scope. The main gap is what the inspector returns or what the caller should do on detection.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the single command parameter with examples. The description adds only that inspection happens pre-execution, which is context rather than parameter syntax. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (inspect) and resource (shell commands) with concrete scope and the sibling-distinguishing characteristic of being a lexical/syntax inspector rather than an output or AST inspector. The examples of what it detects make the purpose unmistakable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'before terminal execution' clearly signals when to invoke it, and 'intercepts' implies a pre-execution gate. However, it never explicitly names alternatives like inspect_code_ast_safety or states when this lexical approach should be preferred over that AST-based sibling.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.