suna/backend/sandbox
marko-kraemer a77f687a42 refactor(api): streamline sandbox handling
- Removed the `get_or_create_project_sandbox` function from `agent/api.py` and replaced its usage with direct sandbox retrieval logic.
- Updated `start_agent` and `ensure_project_sandbox_active` functions to directly access sandbox information from project data.
- Cleaned up unnecessary comments and improved logging for sandbox operations.
- Adjusted frontend form submission to ensure consistent handling of FormData and improved error handling.
2025-05-18 03:23:46 +02:00
..
docker chore(dev): upload images to s3 - draft 2025-05-14 16:07:15 +05:30
README.md fix new page opening in browser; latest container wip 2025-05-09 05:08:29 +02:00
api.py refactor(api): streamline sandbox handling 2025-05-18 03:23:46 +02:00
sandbox.py chore(config): refactor sandbox image constants into common config 2025-05-17 23:09:03 +00:00
tool_base.py add ensure active, fix utils logger impot in sb tool base 2025-05-11 18:36:33 +02:00

README.md

Agent Sandbox

This directory contains the agent sandbox implementation - a Docker-based virtual environment that agents use as their own computer to execute tasks, access the web, and manipulate files.

Overview

The sandbox provides a complete containerized Linux environment with:

  • Chrome browser for web interactions
  • VNC server for accessing the Web User
  • Web server for serving content (port 8080) -> loading html files from the /workspace directory
  • Full file system access
  • Full sudo access

Customizing the Sandbox

You can modify the sandbox environment for development or to add new capabilities:

  1. Edit files in the docker/ directory
  2. Build a custom image:
    cd backend/sandbox/docker
    docker-compose build
    
  3. Test your changes locally using docker-compose

Using a Custom Image

To use your custom sandbox image:

  1. Change the image parameter in docker-compose.yml (that defines the image name kortix/suna:___)
  2. Update the same image name in backend/sandbox/sandbox.py in the create_sandbox function
  3. If using Daytona for deployment, update the image reference there as well