Security & Sandboxing¶
MiniBot exposes a minimal tool surface by default. The most sensitive capabilities are
python_execute, bash, and apply_patch — they can run arbitrary code or edit
host files when enabled.
Recommendations¶
Disable
tools.python_execunless you need it.Disable
tools.bashunless you need direct shell access.Keep
tools.apply_patch.restrict_to_workspace = trueunless unrestricted edits are required.Keep
tools.file_storage.allow_outside_root = falseto prevent path traversal.Prefer explicit sandbox isolation for untrusted code (
sandbox_mode:rlimit,cgroup,jail).Run the daemon as a non-privileged user; mount only the data directory in Docker.
Jail Mode (Firejail)¶
jail mode wraps the Python process with an arbitrary command prefix (e.g. firejail):
[tools.python_exec.jail]
enabled = true
command_prefix = [
"firejail",
"--private=/srv/minibot-sandbox",
"--quiet",
# "--net=none", # restrict network access from jailed processes
]
Firejail + artifact export example¶
Create shared directory:
mkdir -p /home/myuser/mybot/data/files/jail-shared chmod 700 /home/myuser/mybot/data/files/jail-shared
Configure Python exec:
[tools.python_exec]
sandbox_mode = "jail"
artifacts_allow_in_jail = true
artifacts_jail_shared_dir = "/home/myuser/mybot/data/files/jail-shared"
Configure Firejail wrapper:
[tools.python_exec.jail]
enabled = true
command_prefix = [
"firejail",
"--quiet",
"--noprofile",
"--caps.drop=all",
"--seccomp",
"--whitelist=/home/myuser/mybot/data/files/jail-shared",
"--read-write=/home/myuser/mybot/data/files/jail-shared",
"--whitelist=/home/myuser/mybot/tools_venv",
]
Notes:
artifacts_jail_shared_dirand the Firejail whitelist path must be identical.tools.python_exec.python_path(orvenv_path) must point to an interpreter visible inside Firejail.--noprofileavoids host distro defaults that may block home directory executables.Ensure
firejailis available in the runtime image or on the host.