document/content/self-host/upgrading/4-15/41503.en.mdx
Code Sandbox adds security-related environment variables such as SANDBOX_API_MAX_BODY_MB and SANDBOX_MAX_OUTPUT_MB, and now supports grouped request queuing for run APIs through queueId. The full defaults are listed below:
| Variable | Default | Description |
|---|---|---|
SANDBOX_API_MAX_BODY_MB | 8 | Maximum /sandbox API JSON body size, including variables, in MB. |
SANDBOX_MAX_OUTPUT_MB | 10 | Maximum output JSON size for one code execution, including return values and logs, in MB. |
CHECK_INTERNAL_IP | true | Enables internal IP checks for sandbox network requests by default to reduce SSRF risk. |
SANDBOX_MAX_TIMEOUT | 60000 | Timeout for one code execution, in milliseconds. |
SANDBOX_MAX_MEMORY_MB | 256 | Memory limit for one sandbox, in MB. The runtime reserves an extra 50 MB for overhead. |
SANDBOX_POOL_SIZE | 20 | Number of pre-warmed JS/Python workers. |
SANDBOX_REQUEST_MAX_COUNT | 30 | Maximum number of network requests allowed during one code execution. |
SANDBOX_REQUEST_TIMEOUT | 60000 | Timeout for one network request from inside the sandbox, in milliseconds. |
SANDBOX_REQUEST_MAX_RESPONSE_MB | 10 | Maximum response body size for one sandbox network request, in MB. |
SANDBOX_REQUEST_MAX_BODY_MB | 5 | Maximum request body size for one sandbox network request, in MB. |
SANDBOX_QUEUE_ID_CONCURRENCY | Empty | Number of requests with the same queueId that may enter execution at once. Empty disables queueing. |