data-sql-optimization

Pass

Audited by Gen Agent Trust Hub on Oct 6, 2026

Risk Level: SAFECOMMAND_EXECUTIONINDIRECT_PROMPT_INJECTION
Full Analysis
  • [COMMAND_EXECUTION]: The skill includes a Python utility, scripts/explain_collector.py, which executes the psql command-line tool using subprocess.run(). This is the intended primary functionality for collecting SQL execution plans. The implementation follows security best practices by using a list-based command structure to prevent shell injection, disabling user configuration files with the -X flag, and wrapping all SQL queries in a transaction (BEGIN and ROLLBACK) to ensure that even ANALYZE operations do not result in permanent database side effects.
  • [INDIRECT_PROMPT_INJECTION]: The skill processes external SQL queries provided by the user or from project files, which represents an indirect prompt injection attack surface.
  • Ingestion points: Queries are ingested from text files or stdin in scripts/explain_collector.py.
  • Boundary markers: No specific delimiters or safety warnings are included in the query ingestion process.
  • Capability inventory: The skill possesses the capability to execute database commands via the psql client (scripts/explain_collector.py).
  • Sanitization: The script uses transaction blocks to roll back changes, providing a level of execution safety, though it does not perform semantic validation or sanitization of the SQL text itself.
Audit Metadata
Risk Level
SAFE
Analyzed
Oct 6, 2026, 02:03 PM