Securely run AI-generated Python code in long-lived, stateful sandboxes you can connect to through a CLI or TypeScript/JS SDK.
https://github.com/jamsocket/forevervmRunning AI-generated Python code in production used to mean choosing between security and convenience. You either executed code directly (dangerous) or spun up containers constantly (slow and expensive). ForeverVM changes this completely.
You're building with AI code generation, but every execution is a security nightmare. Traditional approaches suck:
You need something that's secure like containers but fast and stateful like local execution.
ForeverVM gives you long-lived, stateful Python environments that survive between sessions. When a sandbox goes idle, it automatically swaps to disk. When you need it again, it's back instantly with all your variables, imports, and state intact.
import { ForeverVM } from '@forevervm/sdk'
const fvm = new ForeverVM({ token: process.env.FOREVERVM_TOKEN })
const repl = fvm.repl()
// Execute AI-generated code safely
const result = await repl.exec(`
import pandas as pd
df = pd.read_csv('data.csv')
df.describe()
`).result
// Later session - df is still there
const analysis = await repl.exec('df.groupby("category").mean()').result
Your AI can build complex analysis pipelines across multiple interactions without losing context or recomputing expensive operations.
Multi-turn code conversations: AI assistants can now maintain computational context across an entire session. No more re-importing libraries or recalculating intermediate results every message.
Safe AI agent execution: Deploy agents that write and run their own Python code without worrying about system compromise. Each agent gets its own persistent sandbox.
Interactive data analysis: Build AI-powered data tools where users can ask follow-up questions without starting from scratch each time.
Code experimentation platforms: Create environments where AI can iterate on solutions, building on previous attempts rather than starting over.
ForeverVM handles the production complexities you don't want to think about:
# Start working on a machine
npx forevervm repl my-analysis
# Close laptop, come back later
npx forevervm repl my-analysis # Everything's still there
The TypeScript SDK makes integration straightforward. You're not learning a new paradigm - just secure execution:
// Create tagged environments for different users
const userRepl = await fvm.createMachine({
tags: { user: 'user123', project: 'data-analysis' },
memory_mb: 1024
})
// Execute code with streaming output
const execution = userRepl.exec('for i in range(1000000): print(f"Processing {i}")')
for await (const output of execution.output) {
console.log(output.data) // Stream results in real-time
}
Built on Rust with proper isolation primitives. Each sandbox runs in its own namespace with cgroup limits. No shared filesystem access, no network unless you enable it, no way for malicious code to escape.
The automatic disk swapping means you can run hundreds of user sessions cost-effectively - they only consume resources when actively computing.
ForeverVM solves the fundamental tension in AI code execution: you get Docker-level security with REPL-level interactivity. Your AI applications can finally execute generated code the way they should - safely, persistently, and without friction.
Time to stop compromising between security and user experience. Get started at forevervm.com.