SAFELY RUN UNTRUSTED CODE
Execute any code — scripts, tests, jobs, agents — securely in isolated sandboxes. ~100ms startup, filesystem access, no host exposure. Scale to thousands, pay only when running.
Install the HopX SDK
pip install hopx-aiCreate and use a sandbox
1from hopx_ai import Sandbox
2
3# Create sandbox
4sandbox = Sandbox.create(
5 template="code-interpreter"
6)
7
8# Execute code
9result = sandbox.run_code(
10 "print('Hello, World!')"
11)
12print(result.stdout)
13
14# Cleanup
15sandbox.kill()Startup in ~100ms
Sandboxes launch from prebuilt snapshots, allowing near-instant cold starts instead of seconds or minutes.
Isolated at the VM Level
Firecracker microVMs provide hardware-level security and kernel isolation — far beyond containers or serverless functions.
Run Continuously
No execution time limits. Keep agents, notebooks, or jobs running for hours, days, or weeks — with full state persistence.
How It Works
A runtime primitive. Create → Run → Destroy. That's it.
Create
Spin up an isolated sandbox
1from hopx_ai import Sandbox
2
3# Create sandbox
4sandbox = Sandbox.create(
5 template="code-interpreter"
6)Run
Execute code, commands, files
1result = sandbox.run_code("""
2import sys
3print(f"Python {sys.version}")
4print("Hello from HopX!")
5""")
6
7result = sandbox.commands.run(
8 "pip install requests && python --version"
9)
10
11# Write file
12sandbox.files.write(
13 "/workspace/data.json",
14 json.dumps({"name": "Alice", "age": 25})
15)
16
17# Read file
18content = sandbox.files.read("/workspace/data.json")Inspect & Destroy
Stream outputs, then tear it down
1# Stream code execution output in real-time
2code = """
3import time
4for i in range(5):
5 print(f"Step {i+1}/5")
6 time.sleep(1)
7print("Complete!")
8"""
9
10print("Streaming output:")
11async for message in sandbox.run_code_stream(code):
12 if message['type'] == 'stdout':
13 print(f"📤 {message['data']}", end='')
14 elif message['type'] == 'stderr':
15 print(f"⚠️ {message['data']}", end='')
16 elif message['type'] == 'result':
17 print(f"✅ Exit code: {message['exit_code']}")
18
19print(result.stdout)
20
21sandbox.kill()Trusted by Engineers Worldwide
Real feedback from teams running production workloads on Hopx
"We run 10,000+ AI-generated scripts per day in isolated sandboxes — zero host impact, zero security incidents."
"48-hour data transformation jobs with 100% isolation. Finally, no more 'it works on my machine' issues."
"Sandbox per PR for integration tests. No containers to manage, no flaky shared state. Our CI is 3x faster."
"Fair benchmarks at last — identical environments, interference-free, reproducible results every single time."
"Our agents execute untrusted user code without any risk to our infrastructure. Game changer for our platform."
"Spun up 500 parallel sandboxes for load testing. ~100ms cold starts, exactly as advertised. Impressive."
"We let users run arbitrary Python in our SaaS product. Hopx makes it safe and simple. No PhD required."
"Migrated from Lambda for long-running jobs. No more 15-minute timeouts. Sandboxes run for days if needed."
"Desktop automation in the cloud finally works. VNC streaming, screenshots, browser control — all via API."
"Our research team runs ML experiments in isolated environments. Reproducibility is no longer a problem."
"Built our entire code review AI on Hopx. It safely executes suggested changes before recommending them."
"We process 1M+ webhook events daily, each in its own sandbox. Zero cross-contamination, perfect isolation."
"Our coding bootcamp lets students run code safely. No more crashed servers from infinite loops."
"Replaced our entire sandboxing infrastructure with Hopx. 60% cost reduction, 10x less maintenance."
"MCP server hosting made simple. Each tool runs isolated, secure by default. Exactly what we needed."
Simple, Powerful SDK
Connect to sandboxes with clean APIs in your favorite language
Execute Code
Run Python, JavaScript, and more with rich output capture
Stream Output
Real-time streaming of code execution output via WebSocket
File Operations
Upload, download, watch files with full filesystem access
Commands
Execute shell commands and capture stdout/stderr
Processes
Start, monitor, and manage long-running background processes
Templates
List available templates and create custom sandboxes
Desktop Automation
Control desktop environments and automate GUI interactions
Metrics
Monitor CPU, memory, network, and disk in real time
1import { Sandbox } from '@hopx-ai/sdk';
2
3const sandbox = await Sandbox.create({
4 template: 'code-interpreter',
5 apiKey: process.env.HOPX_API_KEY
6});
7
8// Execute Python code
9const result = await sandbox.runCode(`
10import sys
11print(f"Python {sys.version}")
12print("Hello from HopX!")
13`);
14
15console.log(result.stdout);
16// Output: Python 3.11...
17// Hello from HopX!
18
19await sandbox.kill();Execute Code From YOUR IDE
in isolated cloud sandboxes
The Hopx MCP server lets your IDE or AI assistant execute Python, JavaScript, Bash, and Go code in blazing-fast (~100ms startup), isolated sandboxes. Works with Cursor, Claude, VS Code, and more.
$ uvx hopx-mcpSelect your IDE
1{
2 "mcpServers": {
3 "hopx-sandbox": {
4 "command": "uvx",
5 "args": ["hopx-mcp"],
6 "env": {
7 "HOPX_API_KEY": "your-api-key-here"
8 }
9 }
10 }
11}Quick Start:
- Get your free API key from console.hopx.ai
- Add the configuration to your IDE's MCP settings file
- Replace
your-api-key-herewith your actual API key - Restart your IDE/assistant and start executing code securely!
Execute Code
Python, JavaScript, Bash, Go in isolated sandboxes
Pre-installed Libraries
pandas, numpy, matplotlib ready to use
Auto-cleanup
Sandboxes destroy after use - no manual cleanup
WHAT BUILDERS RUN ON HOPX
From quick scripts to long-running jobs — a runtime primitive for every workload
Execute Untrusted Code Safely
Run user-submitted scripts, third-party code, or AI-generated programs in fully isolated sandboxes.
Run CI/CD Tests in Isolation
Spin up a sandbox per PR to run unit tests, integration tests, and fuzz critical paths.
Run Long-Running Jobs
Data processing, scraping, analysis — jobs that need hours or days without forced shutdowns.
Run Background Workers
Workers, schedulers, and recurring jobs that must keep running reliably.
Benchmark & Compare Runtimes
Spin up identical sandboxes repeatedly for fair, interference-free benchmarks.
Validate AI-Generated Code
Test AI outputs, inspect results, and reject changes that fail — all in disposable environments.
Run Data Processing Jobs
Spin up environments with pandas, numpy, and ML libraries preinstalled.
Run AI Agents
Launch agents that write and execute code in dedicated runtimes.
Run Desktop Automation
Control a full cloud desktop — GUI, browser, apps — programmatically.
Host Secure MCP Servers
Run MCP servers and tools in a controlled, isolated perimeter.
Only Pay When Your Code Is Running.
Hopx lets you launch fully isolated sandboxes in milliseconds — and shut them down instantly when you're done. Build, test, and run agents without waste.
Frequently Asked Questions
Everything you need to know about Hopx sandboxes