Agent SandboxSecure cloud sandboxes for your AI agents, right next to your models
Run the code your agents write in isolated Firecracker microVMs that start in seconds. Use the same RouterHub API key you already use for models, and see model and compute costs together on one bill.
Early access · opening in batches · we'll contact you to get started
# pip install routerhub-sandbox from routerhub_sandbox import Sandbox # Reads ROUTERHUB_API_KEY — the same key you use for models sbx = Sandbox.create() sbx.files.write("/home/user/hello.py", "print(2 ** 10)") result = sbx.commands.run("python /home/user/hello.py") print(result.stdout) sbx.kill()
1024
A place for your agents to act
Models decide what to do. Agent Sandbox gives them somewhere safe to do it — and keeps it inside the RouterHub account you already have.
A microVM per sandbox
Each sandbox is its own Firecracker microVM with its own kernel — not a shared container.
Ready in seconds
Spin up a Python environment on demand for agent‑generated code, file processing, and data analysis.
Models with zero setup
Agents inside the sandbox call RouterHub models with an injected, sandbox‑scoped token. Your real key stays out.
One key, one bill
The same RouterHub key, and the same bill — with model cost plus compute cost for every sandbox.
Your key opens the sandbox. The sandbox never sees your key.
Agent Sandbox runs inside the RouterHub platform, beside the AI Gateway. Sandbox model calls go through a dedicated proxy and are billed to the sandbox that made them.
Scroll sideways to see the full diagram →
- Create with your keyYour app calls Agent Sandbox with its RouterHub API key, through our SDK or the E2B SDK.
- Run in a microVMThe sandbox boots its own Firecracker microVM and runs commands and files you send it.
- Call models safelyCode inside uses a sandbox‑scoped, revocable token. The model proxy forwards calls to the RouterHub Gateway on behalf of your key.
- See one billCompute seconds and model usage roll up per sandbox in your RouterHub console.
A few lines of Python — or no code changes at all
Start with the routerhub-sandbox Python SDK, or keep your existing E2B code and change two environment variables.
Python SDK
Create a sandbox, write a file, run it, and clean up.
# pip install routerhub-sandbox from routerhub_sandbox import Sandbox sbx = Sandbox.create() # uses ROUTERHUB_API_KEY # Upload the script your agent generated sbx.files.write("/home/user/report.py", code_from_agent) # Execute it inside the microVM result = sbx.commands.run("python /home/user/report.py") print(result.stdout) # Destroy the sandbox — its data is cleared sbx.kill()
Already on E2B? Change two variables
Agent Sandbox is compatible with the E2B SDK. Point it at RouterHub and use your RouterHub key.
E2B_DOMAIN=sandbox.routerhub.ai E2B_API_KEY=<your RouterHub API key> # Your existing E2B code runs unchanged
Call models from inside — no key required
The sandbox comes with the RouterHub endpoint and a sandbox‑scoped token pre‑set in its environment.
from openai import OpenAI client = OpenAI() # base URL + token already set reply = client.chat.completions.create( model=MODEL, # any RouterHub model messages=[{"role": "user", "content": "Summarize data.csv"}], )
One key. One bill. One console.
Agent Sandbox isn't a separate product to sign up for. It lives inside the RouterHub account your team already uses for models.
Same API key
Your RouterHub key calls models and opens sandboxes. No second vendor account.
Same bill
Sandbox compute is usage‑based and billed per second, alongside your model usage.
Same console
A new Sandboxes page lists every sandbox with its details and its model + compute total.
prod-agentIllustrative preview. Values hidden.
Isolated by default
Two sizes to start with, and security defaults that don't depend on your agent behaving well.
Python environment
Comes with common data libraries, and you can pip install more at runtime.
Billing: usage‑based, billed per second.
microVM isolation
Every sandbox runs in its own Firecracker microVM with a separate kernel.
Internal networks blocked
By default, sandboxes can't reach internal networks or cloud metadata endpoints.
Your key stays outside
Long‑lived keys never enter the sandbox. Code inside gets a sandbox‑specific token you can revoke.
Destroyed means gone
When a sandbox is destroyed, its data is cleared.
What teams run in Agent Sandbox
Data analysis agents
Let the model write pandas over uploaded files, execute it, and return tables and charts.
Coding agents
Install dependencies, run tests, and iterate on generated code in a disposable machine.
Entire agents, isolated
Run a whole agent — such as a Claude Code‑style CLI agent — inside the sandbox, calling models through RouterHub.
What early access means
Agent Sandbox is not yet generally available. We're working closely with a small group of teams before opening it more widely.
- Opening in batchesWe onboard teams in batches, and each batch has limited spots.
- We'll contact youShare your use case and expected workload; our team will reach out to get you set up.
- Subject to changeFeatures, sizes, and limits may change as we learn from early users.
- Your existing accountEarly access is enabled on your current RouterHub account and key.
Questions, answered
Is Agent Sandbox generally available?
No. Agent Sandbox is in early access and opens to teams in batches with limited spots. Request access and we'll contact you. Model access through the RouterHub AI Gateway is available today.
Do I need a separate account or API key?
No. Sandboxes are created with the same RouterHub API key you use for models, and they appear in your existing RouterHub console.
How is it billed?
Sandbox compute is usage‑based and billed per second. Model calls made from inside a sandbox are billed like any other RouterHub model usage. Both appear on the same bill, broken down per sandbox. We'll share pricing details during onboarding.
We already use E2B. How hard is it to switch?
Agent Sandbox is compatible with the E2B SDK. Set E2B_DOMAIN and E2B_API_KEY to point at RouterHub with your RouterHub key, and your existing code keeps working.
How do agents inside the sandbox call models without my key?
We inject a sandbox‑specific, revocable token and the RouterHub endpoint into the sandbox environment. Calls go through our model proxy to the RouterHub Gateway on behalf of your key — the key itself never enters the sandbox.
What happens to my data when a sandbox ends?
When a sandbox is destroyed, its data is cleared. By default, sandboxes also can't reach internal networks or cloud metadata endpoints.
Run your agents next to your models
Join the Agent Sandbox early access. Tell us about your agent and we'll reach out as spots open.