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) and references/tool-integration.md implement a calculator tool using the eval() and compile() 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's os or subprocess modules.
  • [SAFE_PRACTICE]: Note that the read_file tool implementation in references/tool-integration.md correctly includes a path normalization and verification check to prevent directory traversal attacks.
Recommendations
  • AI detected serious security threats
Audit Metadata
Risk Level
HIGH
Analyzed
Jun 13, 2026, 09:10 AM
Security Audit — agent-trust-hub — ai-langchain-patterns