hybrid-search-implementation
Pass
Audited by Gen Agent Trust Hub on Sep 21, 2026
Risk Level: SAFECOMMAND_EXECUTIONINDIRECT_PROMPT_INJECTION
Full Analysis
- [COMMAND_EXECUTION]: The
PostgresHybridSearch.hybrid_searchmethod inresources/implementation-playbook.mdcontains a SQL injection vulnerability during query construction. - Evidence: The implementation iterates through
filter_metadataand interpolates keys directly into the SQL string:where_clause += f" AND metadata->>'{key}' = ${len(params)}". If the keys in the metadata dictionary are derived from untrusted user input, an attacker could manipulate the SQL query structure. - [INDIRECT_PROMPT_INJECTION]: The
HybridRAGPipelineand reranking templates inresources/implementation-playbook.mdrepresent an attack surface for indirect prompt injection. - Ingestion points:
_vector_searchand_keyword_searchmethods inHybridRAGPipelinefetch external data. - Boundary markers: The templates do not demonstrate the use of delimiters or 'ignore' instructions for the retrieved content.
- Capability inventory: The pipeline performs database operations and neural model inference (reranking).
- Sanitization: No sanitization or validation of the retrieved document content (
SearchResult.content) is performed before it is passed to the reranker or potentially a downstream LLM.
Audit Metadata