langchain
Fail
Audited by Gen Agent Trust Hub on Mar 31, 2026
Risk Level: HIGHCOMMAND_EXECUTIONREMOTE_CODE_EXECUTIONPROMPT_INJECTION
Full Analysis
- [COMMAND_EXECUTION]: The skill defines a
calculatetool that uses the built-in Pythoneval()function to evaluate user-provided expressions. This is a critical security risk as it allows for arbitrary code execution if an attacker or a subverted agent passes malicious Python strings. - [REMOTE_CODE_EXECUTION]: The agent configuration includes the
PythonREPLToolfrom thelangchain_experimentalpackage. This tool provides the AI agent with a persistent Python shell, enabling it to execute any code it generates. This capability can be easily abused to perform unauthorized file system operations, network scanning, or data exfiltration. - [PROMPT_INJECTION]: The skill implements Retrieval-Augmented Generation (RAG) using
PyPDFLoaderandWebBaseLoaderto ingest external content. - Ingestion points: External data is loaded from
document.pdfand web sources into the agent context. - Boundary markers: The prompt templates for the RAG chain and Agent do not employ delimiters or 'ignore' instructions to prevent the agent from obeying malicious instructions embedded within the retrieved text.
- Capability inventory: The agent possesses powerful capabilities including arbitrary code execution (
eval,PythonREPLTool) and network access (requests,DuckDuckGoSearchRun). - Sanitization: No sanitization or validation of the retrieved context is performed before it is interpolated into the LLM prompt.
Recommendations
- AI detected serious security threats
Audit Metadata