ast-grep

Pass

Audited by Gen Agent Trust Hub on Oct 9, 2026

Risk Level: SAFEINDIRECT_PROMPT_INJECTIONCOMMAND_EXECUTION
Full Analysis
  • [INDIRECT_PROMPT_INJECTION]: The skill is designed to translate user natural language descriptions into structural code search patterns and shell commands. This creates a surface where an agent might execute unintended commands if the user input is malicious and the agent fails to sanitize the resulting shell command string.
  • Ingestion points: The skill ingests user queries and code examples to generate search patterns and rule files (SKILL.md, Steps 1-3).
  • Boundary markers: The workflow suggests testing rules against isolated example files before running searches on the full codebase, providing a manual verification step (SKILL.md, Step 4).
  • Capability inventory: The skill instructs the agent to execute shell commands using the ast-grep CLI (e.g., ast-grep run, ast-grep scan) (SKILL.md, Steps 4-5).
  • Sanitization: The skill explicitly includes a section on 'Escaping in Inline Rules' that teaches the agent to escape metavariables (e.g., using \$VAR) to prevent shell interpretation of characters like the dollar sign (SKILL.md, Tips section).
  • [COMMAND_EXECUTION]: The skill relies on the execution of the ast-grep CLI tool via the shell to perform its primary function. While these are legitimate search operations, they involve subprocess calls that interact with the local file system to analyze code (SKILL.md, CLI Commands section).
Audit Metadata
Risk Level
SAFE
Analyzed
Oct 9, 2026, 11:45 AM