A protective layer for handling untrusted code or high-risk commands: enabling the sandbox, isolation boundaries, and related configuration.
The Sandbox allows Qoder CLI to execute commands and tools within a restricted, isolated environment, reducing the risk of accidental operations or untrusted code. When the sandbox is enabled, file system and network access for commands are confined to defined boundaries, and any operations exceeding these boundaries are denied.The sandbox is ideal for handling untrusted code, executing potentially risky commands, or adding an extra layer of protection to automated workflows. This page covers how to enable the sandbox, its isolation capabilities, and related configurations.
-s, --sandbox is a boolean flag used solely to enable the sandbox; it does not accept a backend name:
Copy
qodercli --sandbox
The backend used is determined by the environment variable QODER_SANDBOX or the configuration file. If neither is specified, it is automatically detected based on the platform (see below).
If it is detected that the process is already running inside a sandbox (the SANDBOX environment variable is set), Qoder CLI will not enable nested sandboxing.
When sandbox is set to true without specifying a concrete command, Qoder CLI automatically selects one based on the platform: it prefers sandbox-exec on macOS; otherwise, it tries docker and then podman in sequence. If the sandbox is enabled but no available command is found, an error will prompt you to install Docker/Podman or explicitly specify a command. runsc and lxc are not automatically detected and must be explicitly specified.
Controlled by tools.sandboxNetworkAccess (or networkAccess in the object configuration), defaulting to false (network access denied).
When network access is denied or a sandbox proxy is configured, an internal network is created for the sandbox to restrict its external connections.
You can configure a proxy command for internal sandbox requests via the environment variable QODER_SANDBOX_PROXY_COMMAND, and proxy-related environment variables will be forwarded into the sandbox.
In addition to sandboxing the entire CLI process, you can enable a more granular Tool-Level Sandbox:
Copy
{ "security": { "toolSandboxing": true }}
security.toolSandboxing (defaults to false, requires a restart) isolates the execution of individual tools rather than the entire CLI process, making it suitable for scenarios where you only want to restrict specific high-risk operations.