Getting Started with Runloop
Runloop Devboxes are a secure and isolated environment for running AI-generated code. This tutorial gets you up and running with your first devbox in about 1 minute.For your convenience, we have SDKs for Python
and TypeScript. The Python SDK is available in both
synchronous and
async
variants. We recommend using the async SDK for improved performance.
Create an API Key
Visit the Runloop signup
page to create an
account. Once your account is active, visit the
Settings page on
the Runloop Dashboard to
create an API key.
Set Up Your Development Environment
Set up your Runloop API key as an environment variable. This allows
the Runloop SDK to authenticate you and create your devbox.
Create a Devbox and run a command
Now, let’s create a Devbox to use as our sandbox environment.
Copy the script below to a file, e.g. The
testprog.py for Python or
testprog.ts for TypeScript.runloop SDK object is your main entry point for interacting with the Runloop API.Run the example
Creating and starting a Devbox takes just seconds, and allows you
to safely run LLM-generated code, execute tests, etc. The example code above
- creates and launches a devbox
- runs a simple command
- shuts the devbox down when it is done
Our starter image is what starts when you start a devbox. You get the following packages available to your devbox:Core tools: curl, ca-certificates, jq, sudo, git
Extras: dnsutils, iputils-ping, less, vim, wget, rsync, gh
Python stack: Python 3.12, pip, uv
Node stack: Node 22.15.0, npm, Yarn 1.22.22 via corepack
Extras: dnsutils, iputils-ping, less, vim, wget, rsync, gh
Python stack: Python 3.12, pip, uv
Node stack: Node 22.15.0, npm, Yarn 1.22.22 via corepack
Using Runloop Code Examples
The other tutorials and code examples on this site assume you have set up your environment as indicated above. We also use the same variable names throughout, so if you want to try other code snippets, just paste them into yourrun_example function and try them out!
Tutorials
A collection of tutorials showing you how to use Runloop. We’re constantly expanding this collection, so check back often!Running Agents on Sandboxes
Create an AI agent, set up a devbox with code and agent mounts, and modify code in a demo app.
Share a Live Preview
Start your app and share a live preview link in pull requests using devbox tunnels.
Suspend and Resume Workflow
Preserve devbox state, wait for PR feedback, and resume to continue working iteratively.
Turn-Based Interaction
Create a workflow where the agent posts status updates and responds to PR comments as prompts.
Learn More
By default, a Devbox’s disk state is deleted when it is shut down. If
your application needs persistent state across boots, you can
configure your devbox for automatic suspend and
resume.
