Skip to content

Modal Sandbox

Modal Sandbox creates the sandbox in your Modal account, a cloud service that lets you use graphics cards for artificial intelligence tasks.

A sandbox is an isolated, temporary computer where an agent can write and run code, install programs or work with files without touching anything else. This component connects to the Sandbox connector of the Deep Agent, which appears when you turn on Enable Sandbox in its advanced options.

When to use it

  • The agent needs a graphics card, for example to run its own model.
  • You want to limit how long each run may last to control cost.
  • You already work with Modal.

Configuration

You need a Modal API credential with your Modal token ID and secret. See Credentials.

Advanced options

FieldWhat it does
App NameThe name of the Modal app where sandboxes are created; if it does not exist, it is created. Default: nappai-sandbox.
Docker ImageThe sandbox’s starting environment, for example ubuntu:22.04 or python:3.12-slim. Empty, Modal’s default image.
Timeout (Segundos)The longest the sandbox may last before Modal closes it. Default: 300.
GPUGraphics card: none (default, processor only), T4, A10G or A100. Your Modal account must have graphics cards enabled.
Variables De EntornoValues the agent’s code can read inside the sandbox, such as other services’ keys, written as name and value pairs, for example {"CRM_TOKEN": "..."}. Default: none.

Output

The Sandbox Backend output is the sandbox. Connect it to the Sandbox connector of the Deep Agent.

Example

A lab wants an agent to test an image classification model.

  1. Add Modal Sandbox with the Modal API credential and choose T4 in GPU.
  2. Connect it to the Sandbox connector of the Deep Agent, with Enable Sandbox on.

Good practices

  • Modal bills by usage time on your account, more with a graphics card: set Timeout (Segundos) to what you really need.