Skip to content
This repository was archived by the owner on Mar 8, 2026. It is now read-only.

anthonyduong9/inspect_modal_sandbox

Repository files navigation

Inspect Modal Sandbox

Transitioning to Inspect Sandboxes

I recommend transitioning from Inspect Modal Sandbox to Inspect Sandboxes or that new projects use Inspect Sandboxes instead.

Existing Inspect Modal Sandbox users can continue using it but should be aware of this transition.

Purpose

This plugin for Inspect allows you to use containers as sandboxes, running within Modal.

Installing

Add this using Poetry

poetry add git+ssh://git@github.com/anthonyduong9/inspect_modal_sandbox.git

or in uv,

uv add git+ssh://git@github.com/anthonyduong9/inspect_modal_sandbox.git

Requirements

This plugin requires a Modal account. Sign up at modal.com.

Authenticate the Modal CLI:

pip install modal
python3 -m modal setup

Configuring evals

You can configure the eval using either a Docker Compose file, or by specifying a Dockerfile path.

By default, the provider uses Modal's default Debian-based image with Python 3.11.

Docker Compose

The services key is required. All other options are optional.

services:
  default:
    image: python:3.12
    build:
      context: .
      dockerfile: Dockerfile
    working_dir: /app
    environment:
      MY_VAR: "value"
    mem_limit: 1g
    cpus: 2.0
x-inspect_modal_sandbox:
  timeout: 3600
  idle_timeout: 300
  block_network: false
  cidr_allowlist:
    - "0.0.0.0/0"
  cloud: aws
  region: us-east-1

Dockerfile

As an alternative to Docker Compose you can specify a Dockerfile path directly, e.g.

sandbox=("modal", "path/to/Dockerfile")

Known Limitations

  • User switching: The user parameter in exec() is ignored. Commands run as the container's default user (root).
  • Root execution: Modal containers run as root by default.

Developing

See CONTRIBUTING.md

About

A Modal sandbox environment for use with inspect_ai

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages