Code Sandbox

Description: Enable agents to run code in a sandboxed environment.

Author: Arcade

Code: GitHub

Auth: API Key

PyPI VersionLicensePython VersionsWheel StatusDownloads

The Arcade Code Sandbox toolkit provides a pre-built set of tools for running code in a sandboxed environment. These tools make it easy to build agents and AI apps that can:

  • Run code in a sandboxed environment
  • Create a static matplotlib chart

Install

pip install arcade-code-sandbox

pip installing the toolkit is only needed if you are self-hosting Arcade. You do not need to install the toolkit if you’re using Arcade Cloud.

Available Tools

These tools are currently available in the Arcade Code Sandbox toolkit.

Tool NameDescription
RunCodeRun code in a sandboxed environment.
CreateStaticMatplotlibChartCreate a static matplotlib chart.

If you need to perform an action that’s not listed here, you can get in touch with us to request a new tool, or create your own tools.

RunCode


Run code in a sandbox and return the output.

Auth:

  • Environment Variables Required:
    • E2B_API_KEY: Your API key for authentication.

Parameters

  • code (string, required) The code to run.
  • language (string, optional) The language of the code. Valid values are ‘python’, ‘js’, ‘r’, ‘java’, ‘bash’. Defaults to ‘python’.

CreateStaticMatplotlibChart


Run the provided Python code to generate a static matplotlib chart. The resulting chart is returned as a base64 encoded image.

Auth:

  • Environment Variables Required:
    • E2B_API_KEY: Your API key for authentication.

Parameters

  • code (string, required) The Python code to run.

Auth

The Arcade Code Sandbox toolkit uses E2B to run code in a sandboxed environment.

Global Environment Variables:

  • E2B_API_KEY: Your E2B API key.