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 thepsqlcommand-line tool usingsubprocess.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-Xflag, and wrapping all SQL queries in a transaction (BEGINandROLLBACK) to ensure that evenANALYZEoperations 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
psqlclient (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