Nov 19, 2025
4 min read

Koyeb Sandboxes: Fast, Scalable, Fully Isolated Environments for AI Agents and More

At Koyeb, we provide high-performance serverless infrastructure for intensive applications across CPUs, GPUs, and accelerators. We take code, build it, and run it in fully isolated, secure microVMs on bare-metal servers around the world. We scale automatically when needed, down to zero when idle, with cold starts as low as 250ms.

Over the past few months, we’ve been working with an increasing number of teams using Koyeb to orchestrate and run AI-generated code at massive scale. Through those collaborations, we’ve seen a consistent set of infrastructure requirements emerge:

  • Spawning thousands of applications per day
  • Sustainable, cost-effective infrastructure to run them
  • Fully isolated network and compute resources
  • The ability to handle both short- and long-running tasks
  • Fast startup times and minimal cold starts

While we deliver production-grade infrastructure with full multi-tenant isolation, we noticed a recurring pattern: many teams were leveraging Koyeb’s core primitives to build lightweight abstractions for running commands, managing files, launching background processes, and exposing ports for short- or long-lived workloads. We've set out to simplify that experience by combining our platform’s core primitives with higher-level abstractions in a single, unified Python SDK.

Today, we’re announcing Koyeb Sandboxes in public preview: a new way to effortlessly spin up fully isolated, secure environments to safely execute AI-generated and untrusted code at scale. Koyeb Sandboxes are available for all users on any of our pay-as-you-go plans, from Starter to Enterprise plans.

Get Started with Koyeb Sandboxes

Koyeb Sandboxes are available today in public preview.

Deploy Now

Sandboxes are ideal for:

  • Running AI agents and workflows in fully isolated environments
  • Executing untrusted or user-generated code securely
  • Prototyping applications quickly
  • Testing APIs or libraries in clean environments
  • Demonstrating functionality without configuring local infrastructure

Spin up a sandbox in seconds

Sandboxes give you instant, isolated environments with one command. Here’s how simple it is to create an ephermeral sandbox environment and start taking actions:

The following shows how to a create new sandbox, write a file to the sandbox, and read it in just a few lines of code:

sandbox = Sandbox.create(
    image="koyeb/sandbox",
    name="file-ops",
    wait_ready=True,
)

fs = sandbox.filesystem

 
# Write Python script
python_code = "#!/usr/bin/env python3\nprint('Hello from Python!')\n"
fs.write_file("/tmp/script.py", python_code)
sandbox.exec("chmod +x /tmp/script.py")
result = sandbox.exec("/tmp/script.py")
print(result.stdout.strip())

Understanding Koyeb Sandboxes

Koyeb Sandboxes are backed by our purpose-built infrastructure with the features you need:

  • Available for CPU and GPU for diverse workloads.
  • Run in multiple regions worldwide, allowing for low-latency wherever you need to run your sandboxes.
  • Straightforward usage through the Koyeb Python SDK, making it easy to build the solution you need without spending extra time on infrastructure.

Koyeb Sandboxes combines the power of our core primitives with developer-friendly abstractions for all the common actions you need to take in a sandboxed code environment:

Diagram of a sandbox lifecycle

To see what's possible with Koyeb Sandboxes, view the documentation.

Pricing

Koyeb Sandboxes are billed based on the underlying compute and storage resources you consume. You pay only for what you or your agents actually use, starting at $0.000001/second ($0.0036/hr). To find out more about Koyeb pricing, visit the Koyeb Instances page and the Koyeb pricing page.

Infrastructure for AI Agents

Fast, scalable, and secure sandbox environments to develop and run AI agents.

Deploy Now

Get started with Koyeb Sandboxes

Koyeb Sandboxes are available today to preview through the Koyeb Python SDK. Try it, experiment, and let us know what you build! Share your projects and ideas on Koyeb community. Let us know how it goes! Have a feature request or hit a bug? File an issue on the Koyeb Python SDK GitHub repo or chat with us on Slack.

Here's how to get started:


Deploy AI apps to production in minutes

Get started
Koyeb is a developer-friendly serverless platform to deploy apps globally. No-ops, servers, or infrastructure management.
All systems operational
© Koyeb