This page details environment variable configuration for the Agent Sandbox feature as part of the FastGPT 4.16.1 upgrade. When Agent Sandbox is enabled, both fastgpt-app and fastgpt-pro services require updated environment variable settings to use the standardized single full runtime image reference introduced in this version.
Core Environment Variables
FastGPT 4.16.1 replaces prior fragmented sandbox image configurations with a single, explicit image reference. Two environment variables control the sandbox runtime and package installation behavior:
For standard non-root deployments (default, no in-sandbox apt package installs needed):
# Standard non-root image, used by default
AGENT_SANDBOX_OPENSANDBOX_IMAGE=ghcr.io/labring/fastgpt-agent-sandbox:v0.3.1For deployments needing apt package installs within sandboxes, use the root image and optional custom apt mirror:
AGENT_SANDBOX_OPENSANDBOX_IMAGE=ghcr.io/labring/fastgpt-agent-sandbox-root:v0.3.1
AGENT_SANDBOX_APT_MIRROR=https://archive.ubuntu.com/ubuntuThe AGENT_SANDBOX_APT_MIRROR variable lets you specify a regional or local apt mirror to optimize package download speeds for sandbox environments.
Configuration Steps
- Confirm that the Agent Sandbox feature is active in your FastGPT deployment.
- Locate the environment variable files or secrets management setup for both
fastgpt-appandfastgpt-proservices, as both require identical Agent Sandbox configuration. - Choose the correct sandbox image:
- For standard use cases without in-sandbox apt package installs, retain or set the default non-root image value.
- For sandboxes that need to install additional system packages, switch to the root image and set
AGENT_SANDBOX_APT_MIRRORif a custom mirror is required.
- Update the relevant environment variables in your deployment configuration.
- Redeploy or restart the
fastgpt-appandfastgpt-proservices to apply the changes.
Additional Configuration Resources
For complete documentation covering global and mainland China container registry image lists, root vs non-root image selection, and custom package registry settings, consult the official OpenSandbox Configuration guide.