Set sandbox options

Sandbox

Handle large responses and bulk operations in the remote sandbox. Instead of stuffing long tool responses into the model context, the agent reads files, searches outputs, writes Python, transforms data, and calls Composio tools in bulk.

The sandbox is scoped to the session, so files, variables, helper functions, and intermediate results stay available while the agent works through a task. Learn more about sandboxes here.

Disabling the sandbox

By default, sessions include the sandbox, a persistent environment that provides COMPOSIO_REMOTE_WORKBENCH and COMPOSIO_REMOTE_BASH_TOOL. If your use case doesn't need code execution, disable it:

session = composio.sessions.create(
    user_id="user_123",
    sandbox={
        "enable": False
    }
)

When disabled:

  • COMPOSIO_REMOTE_WORKBENCH and COMPOSIO_REMOTE_BASH_TOOL are excluded from the session
  • Sandbox-related system prompt lines are stripped
  • Direct sandbox calls are rejected with a 400 error

Zero Data Retention does not cover the sandbox, so disable it in sessions that handle data that needs ZDR.

To keep the sandbox but block raw HTTP calls from it, set enable_proxy_execution (Python) or enableProxyExecution (TypeScript) to false. See Proxy execute for how session restrictions apply to proxy calls.

sandbox is the preferred config key. workbench still works as a fully supported alias and isn't deprecated, so existing code keeps running unchanged.

Sandbox compute tier

The sandbox runs per session. Pick a compute tier to match the workload: heavier code execution or larger in-memory data benefits from a bigger sandbox. Pass the tier via sandbox.sandbox_size (snake_case on the wire, sandboxSize in the TypeScript SDK).

Requires @composio/core ≥ 0.8.1 (TypeScript) or composio ≥ 0.12.1 (Python). Older SDKs reject sandboxSize (TypeScript) or silently drop sandbox_size (Python). See the release notes.

TiervCPURAM
standard11 GB
medium22 GB
large44 GB
xlarge88 GB

Defaults to standard when omitted.

session = composio.sessions.create(
    user_id="user_123",
    sandbox={
        "enable": True,
        "sandbox_size": "large",
    },
)

Pricing: Sandboxes are not billed today. Composio plans to begin billing for sandbox usage soon (metered by tier and runtime). Pick a tier that matches your workload, but expect future pricing to track actual usage.

Changing sandbox_size on an existing session recreates the sandbox on the next access. The sandbox's in-memory filesystem state is lost, but the persistent /mnt/files/ mount survives the restart.

Next

Sandbox

Give sessions a persistent compute environment with COMPOSIO_REMOTE_WORKBENCH and COMPOSIO_REMOTE_BASH_TOOL