ai-langchain-patterns
Fail
Audited by Gen Agent Trust Hub on Jun 13, 2026
Risk Level: HIGHREMOTE_CODE_EXECUTIONCOMMAND_EXECUTIONPROMPT_INJECTION
Full Analysis
- [REMOTE_CODE_EXECUTION]: Multiple code patterns in
SKILL.md(Pattern 6) andreferences/tool-integration.mdimplement a calculator tool using theeval()andcompile()functions. These implementations do not restrict the available globals or locals, enabling an attacker to execute arbitrary Python code (e.g., via the__import__function) if the agent is prompted to evaluate a malicious expression. - [INDIRECT_PROMPT_INJECTION]: The skill describes architectures for Retrieval Augmented Generation (RAG) and tool-calling agents that ingest data from external sources such as document loaders, web scrapers, and database queries. There is a lack of evidence regarding input sanitization or the use of boundary markers to distinguish untrusted data from system instructions, creating a surface for indirect prompt injection.
- [COMMAND_EXECUTION]: While intended for math, the unrestricted use of
eval()in the provided tool examples effectively permits arbitrary system command execution through Python'sosorsubprocessmodules. - [SAFE_PRACTICE]: Note that the
read_filetool implementation inreferences/tool-integration.mdcorrectly includes a path normalization and verification check to prevent directory traversal attacks.
Recommendations
- AI detected serious security threats
Audit Metadata