graphrag-patterns
Warn
Audited by Gen Agent Trust Hub on Sep 19, 2026
Risk Level: MEDIUMCOMMAND_EXECUTIONINDIRECT_PROMPT_INJECTION
Full Analysis
- [COMMAND_EXECUTION]: Several code patterns demonstrate unsafe Cypher query construction for Neo4j. In Pattern 1 (SKILL.md), relationship types and entity labels are concatenated into strings. In Pattern 4 (SKILL.md), entity names extracted from user queries are directly interpolated into the query string (
MATCH (e {name: '{entity}'})) instead of using parameterized queries. If these variables are populated by untrusted LLM-extracted data, it allows for Cypher injection attacks against the underlying graph database. - [INDIRECT_PROMPT_INJECTION]: The skill's architecture is designed to process untrusted external data (documents and user queries) to populate and query a knowledge graph, creating a significant attack surface.
- Ingestion points: Document text ingestion in the
extract_knowledgefunction (SKILL.md) and user-provided queries in theHybridGraphRAG.retrievemethod (SKILL.md). - Boundary markers: The prompt templates, such as
EXTRACTION_PROMPT, lack boundary markers or explicit instructions to ignore malicious commands embedded within the text content. - Capability inventory: The skill interacts with Neo4j databases via network protocols and performs indexing operations that involve file system writes through the
graphragpackage. - Sanitization: There is a lack of robust input sanitization or validation for the entities and relationships extracted from the processed text before they are used to update the database state or execute queries.
Audit Metadata