| sand(1) | General Commands Manual | sand(1) |
sand - run commands in a bwrap-based sandbox, configured with extensible TOML rules.
sand [-f] [-t template] [command [arguments]]
sand runs a command inside a sandbox created by bwrap(1). The sandbox is described by TOML template read from $XDG_CONFIG_HOME/sand, documented in sand(5).
-t template, --template=template
-f, --force
-h, --help
--version
Hooks are commands that run on the host, outside of the sandbox. The following hooks are supported:
sand exports the following environment variables and, unless said otherwise, exposes them to the hooks and template expansions. They are not passed automatically to the sandbox, unless sand.bootstrap is set to true (see sand(5) [sand] section).
UID, GID
HOSTNAME
SAND_PID
SAND_TEMPLATE_DIR
SAND_SANDBOX_RC
Templates, configuration directory and hooks are trusted and protected. Anyone who can write to the configuration directory can run arbitrary commands with the privileges of the user.
Before starting the sandbox, sand will perform the following checks and will refuse to start if any of them fails:
This is discouraged, but security checks can be disabled with -f switch.
If the sandbox runs, sand exits with the status of the sandboxed command.
If the pre hook fails, sand exits with the status of the hook and the sandbox is not started. If the post hook fails while the sandboxed command succeeded, sand exits with the status of the post hook.
Other errors, like invalid command line usage, invalid templates, missing commands or failed security checks result with non-zero error status.
Run Bash inside the sandbox defined by the dev template:
Run the default executable of the dev template:
sand(5), bwrap(1)
Michal Goral <dev@goral.net.pl>
| 2026-11-17 | sand |