DifySandbox
is a lightweight, fast, and secure code execution environment that supports multiple programming languages, including Python and Node.js. It serves as the underlying execution environment for various components in Dify Workflow, such as the Code node, Template Transform node, Jinja2 syntax in LLM nodes, and the Code Interpreter in Tool nodes. DifySandbox ensures system security while enabling Dify to execute user-provided code.
Before installing and deploying the DifySandbox project, ensure your system meets the following dependency requirements:
Execute the appropriate commands based on your Linux distribution to install necessary system components:
Install Go development environment (recommended Go 1.20.6 or higher):
Verify installation:
Sandbox Environment Preparation
Python 3.10 or higher is recommended.
Pre-installed Dependency Management
DifySandbox comes pre-configured with the following Python dependencies:
http
- Basic networking libraryjinja2
- Template engine for LLM prompt processingrequests
- HTTP client libraryAdding Custom Dependencies
If you need additional Python dependencies, follow these steps:
dependencies/python-requirements.txt
file in the project root directory.Adding new dependencies may introduce additional permission requirements. Please carefully evaluate security implications. Do not change permission configurations if you cannot fully assess the potential security risks.
You can refer to the Contribution Guide to participate in the development of DifySandbox
.
Edit this page | Report an issue