Skip to main content
Fermion Sandbox lets you safely execute untrusted or user-generated code inside secure, containerized Linux environments. This guide walks you through installation, setup, and creating your first sandbox: from installing the SDK to running your first command inside an isolated container.

Prerequisites

Before you begin, ensure that your environment meets the following requirements.
  • You’ll need Node.js 18 or higher | Python runtime installed on your system, along with a package manager such as npm, yarn, pnpm, bun for Javascript runtimes or pip or uv for python runtimes.
  • A valid Fermion API key is required for authentication, which you can obtain from your Fermion Dashboard.
  • Familiarity with basic JavaScript or TypeScript will also be helpful as you follow along with the examples in this guide.

Installation

1

Install the Package

Install the package with the help of a package manager of your choice
2

Get Your API Key

Login to your Fermion instructor dashboard and head over to School Setting -> API Access to get your FERMION_API_KEY. Learn more on how to get your Fermion API key
3

Set Up Environment Variables

Create a .env file in your project root and add your API key:
Never commit API keys to version control. Always load them via environment variables or secure secret management systems.

Creating your first Sandbox

Let’s walk through a complete example of creating, running, and cleaning up a sandbox. This example shows how to execute a Node.js script securely in the cloud.

Expected Output

The following code snippet will create a sandbox that executes a simple node.js program. Following is the expected output:

Next Steps

Now that you’ve successfully run your first sandbox, you’re ready to explore more advanced concepts and integrations.

Typescript SDK

Explore all available methods for Typescript SDK

Python SDK

Explore all available methods for Python SDK