ast-grep

Pass

Audited by Gen Agent Trust Hub on Jul 9, 2026

Risk Level: SAFECOMMAND_EXECUTIONEXTERNAL_DOWNLOADSPROMPT_INJECTION
Full Analysis
  • [COMMAND_EXECUTION]: The scripts/ast_grep_helper.py script executes the ast-grep (or sg) binary using subprocess.run. The executable path is resolved dynamically at runtime by checking environment variables (OMO_AST_GREP_SG_PATH, CODEX_HOME), local bin directories, and the system PATH.
  • [EXTERNAL_DOWNLOADS]: The install.sh and install.ps1 scripts download the ast-grep binary from its official GitHub releases page (github.com/ast-grep/ast-grep). The download source is the authoritative repository for the tool.
  • [PROMPT_INJECTION]: The skill presents an indirect prompt injection surface as it is designed to analyze and potentially modify arbitrary source code files from the user's project.
  • Ingestion points: Local source code files processed by the search, replace, and scan subcommands in scripts/ast_grep_helper.py.
  • Boundary markers: Absent; the tool performs structural parsing of the code directly.
  • Capability inventory: The skill can read local files, perform AST-aware searching, and apply code modifications to the filesystem via the ast-grep binary.
  • Sanitization: The helper script includes a validate function that checks search patterns for common syntax errors and regex misuses, though it does not sanitize the contents of the files being analyzed.
Audit Metadata
Risk Level
SAFE
Analyzed
Jul 9, 2026, 12:58 PM
Security Audit — agent-trust-hub — ast-grep