An environment is the backend that actually executes the commands proposed by the agent. mini-swe-agent supports several environment backends ranging from direct local execution to fully isolated containers running in the cloud. Choosing the right environment depends on your use case. For exploratory local development, the defaultDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/swe-agent/mini-swe-agent/llms.txt
Use this file to discover all available pages before exploring further.
local environment is the simplest. For running benchmarks or untrusted code, container-based environments provide isolation that protects your host machine.
Available environments
local
Default. Runs commands directly on your machine using
subprocess.run. No isolation.docker
Runs commands inside a Docker container via
docker exec. Good for SWE-bench and reproducible evaluations.singularity
Runs commands in Singularity/Apptainer containers. Preferred on HPC clusters where Docker is unavailable.
bubblewrap
Linux-only lightweight unprivileged sandboxing via bubblewrap. Experimental.
swerex_docker
Docker execution routed through the SWE-ReX runtime layer.
swerex_modal
Modal cloud execution through SWE-ReX. Useful for running agents at scale with remote compute.
contree
ConTree platform — a sandboxed execution environment built for agents with Git-like execution semantics.
Specifying an environment
Pass the environment class via the CLI flag:--environment-class flag and the environment.environment_class key accept both short names (e.g., docker) and full import paths (e.g., minisweagent.environments.docker.DockerEnvironment).
Environment details
local
Thelocal environment is the default when you run mini. It executes bash commands directly on your host machine using Python’s subprocess.run. There is no isolation — the agent has the same access to your filesystem and network that you do.
Use when: interactive local development, quick experiments, or tasks where you are comfortable with the agent having full access to your environment.
Prerequisites: none.
docker
Thedocker environment starts a container from a specified image and runs commands inside it via docker exec. The container is created at the start of the run and cleaned up afterward.
Use when: SWE-bench evaluations, running untrusted code, or any time you want reproducible isolated execution.
Prerequisites: Docker must be installed and running.
The Docker executable path defaults to
docker. Override it with the MSWEA_DOCKER_EXECUTABLE environment variable if you use Podman or a custom Docker path.singularity
Thesingularity environment runs commands in Singularity/Apptainer containers. It mirrors the Docker environment but uses the Singularity runtime instead.
Use when: HPC clusters and environments where Docker is not available due to privilege requirements.
Prerequisites: Singularity or Apptainer must be installed.
Override the Singularity executable path with
MSWEA_SINGULARITY_EXECUTABLE (default: singularity).bubblewrap
Thebubblewrap environment uses bubblewrap for lightweight, unprivileged sandboxing on Linux. It does not require root and does not spin up a full container.
Use when: Linux systems where you want sandboxing without Docker overhead and without root privileges.
Prerequisites: bubblewrap (bwrap) must be installed. Linux only.
Override the bubblewrap executable path with
MSWEA_BUBBLEWRAP_EXECUTABLE (default: bwrap).swerex_docker
Theswerex_docker environment routes Docker execution through the SWE-ReX runtime layer. It provides an interface compatible with SWE-ReX tooling on top of a local Docker backend.
Use when: integrating with SWE-ReX pipelines or tooling that expects the SWE-ReX interface.
Prerequisites: SWE-ReX must be installed (pip install swe-rex). Docker must be available.
swerex_modal
Theswerex_modal environment executes commands on Modal cloud infrastructure via SWE-ReX. This enables running agents at scale without managing local compute.
Use when: large-scale evaluations, training data generation, or cloud execution where local resources are insufficient.
Prerequisites: SWE-ReX must be installed with Modal support. A Modal account and API token are required.
contree
Thecontree environment uses the ConTree platform for safe sandboxed code execution. ConTree is built specifically for coding agents and supports Git-like execution semantics.
Use when: you want a managed, agent-oriented sandbox with branching execution.
Prerequisites: a ConTree account and API access.
Startup commands
You can run a command inside the environment before the agent starts usingrun.env_startup_command. This is useful for setting up the workspace, installing dependencies, or configuring the environment.
env_startup_command supports Jinja2 templating with the same variables available in prompt templates, including any fields from the run config section.