Workspace Environments
Configure and utilize different workspace environments for running your SWE agents
Overview
Workspace environments facilitate isolated and secure execution of tools with customizable configurations. The SWE Development Kit (swekit) provides a range of environments tailored to your agents’ needs, encompassing security, configuration, CPU allocation, and network port access for public services.
Why Workspace Environments Matters?
Workspace environments are essential for:
- Security: Isolating execution to protect the host system and sensitive data.
- Specific Configuration Needs: Tailoring the environment to the requirements of different agents.
- Resource Allocation: Allocating specific CPU and memory resources to agents.
- Networking: Configuring open ports for services that need to be accessible publicly.
Supported Environments
Docker
Isolate agents in Docker containers for enhanced security.
E2B
Utilize E2B sandboxes for cloud-based execution.
Fly.io (Coming Soon)
Deploy agents on Fly.io for scalable, distributed execution.
Configuring Workspace Environment Variables
Configurable Parameters
When configuring your workspace environment, consider the following customizable parameters to tailor the environment to your SWE agents’ needs:
GITHUB_ACCESS_TOKEN
: Optional. This token is used for GitHub operations. Useexport GITHUB_ACCESS_TOKEN=<github_access_token>
environment variable to provide it.environment
: Optional. A set of key-value pairs representing environment variables specific to the workspace’s needs.persistent
: A boolean flag, when set toTrue
, ensures that the workspace persists beyond the execution of an agent. This is particularly useful for scenarios where you want your agent to deploy a service, such as a website, and require that the service remains active and accessible after the agent’s task is complete.ports
: Optional. A dictionary specifying the port mappings for services that need to be publicly accessible. For example, if your agent is running a web server, you can map the internal port to an external one to allow public access.
These parameters empower you to customize the security, configuration, resource allocation, and networking aspects of your workspace environment, ensuring optimal conditions for your SWE agents’ operation.
Docker Environment
For enhanced security and isolation, use Docker:
You can configure exposed ports for development:
For more details on configuring Docker ports, refer to the Dockerode SDK documentation.
E2B Environment
To use E2B sandboxes for cloud-based execution:
To use E2B sandboxes, you need to set the E2B_API_KEY
environment variable with your E2B API key.
Customizing Workspace Environments Variables
You can customize the workspace environment by adding environment variables while creating workspace.
Was this page helpful?