Tools and agents in a cloud sandbox
Run coding agents, browsers and developer tools inside a Runtime sandbox.
Coding agents
- How to give Cursor CLI a cloud sandboxAdd Runtime's MCP server to ~/.cursor/mcp.json; Cursor's agent then runs code in Linux microVMs instead of on your machine.
- How to run Aider in a cloud sandboxInstall aider-chat with uv in a Linux microVM, keep the model key as a secret, run aider --message --yes-always and take the diff.
- How to run Amp in a cloud sandboxInstall the Amp CLI with its script in a Linux microVM, store the Amp access token as a secret, then run amp -x "<task>".
- How to run Claude Code in a cloud sandboxInstall it with npm in a Linux microVM, store the API key as a secret, run claude -p on a cloned repo and copy the diff back.
- How to run Cline in a cloud sandboxInstall the cline CLI with npm in a Linux microVM, authenticate it with a secret's placeholder, and run cline --json "<task>".
- How to run Gemini CLI in a cloud sandboxInstall @google/gemini-cli with npm in a Linux microVM, keep the Gemini key as a secret, run gemini -p with --approval-mode yolo.
- How to run Goose in a cloud sandboxInstall the goose CLI with its download script in a Linux microVM, set provider and model by environment, and run goose run -t.
- How to run OpenAI Codex CLI in a cloud sandboxInstall @openai/codex with npm in a Linux microVM, store the API key as a secret, run codex exec on a cloned repo and copy the diff.
- How to run OpenCode in a cloud sandboxInstall opencode-ai with npm in a Linux microVM, store the provider key as a secret, then run opencode run --auto on a checkout.
- How to run OpenHands in a cloud sandboxInstall the OpenHands CLI with uv tool install openhands in a Linux microVM, pass the model by environment and run openhands --headless.
- How to run Qwen Code in a cloud sandboxInstall @qwen-code/qwen-code in a Linux microVM, point it at DashScope with a settings file, and run qwen -p --yolo on a checkout.
Agent frameworks
- AutoGen code executor alternative: run agent code in a microVMPass Runtime's sandbox functions to an AutoGen AssistantAgent as tools, and the agent's commands run in a remote Firecracker microVM.
- DSPy code execution: give ReAct a secure Linux sandboxPass Runtime's four sandbox functions to dspy.ReAct as tools, and the program's shell commands run in a Firecracker microVM.
- Google ADK code execution in a secure sandbox, with any modelGive an ADK agent Runtime's sandbox functions as tools; ADK wraps plain functions, and the code runs in a Firecracker microVM.
- How to add a code execution tool to the Vercel AI SDKPass runtimeTools(sbx) from withruntime/ai to generateText or streamText, and the model's commands run in a microVM.
- How to give a LangChain agent a code execution sandboxWrap Runtime's sandbox_tools(sbx) with LangChain's tool and pass them to create_agent; commands then run in a microVM.
- How to give a Mastra agent a code sandboxMastra agents take AI SDK tools as they are, so runtimeTools(sbx) from withruntime/ai gives one a Linux microVM to work in.
- How to give an Agno agent a secure sandbox for code executionPass Runtime's four sandbox functions to an Agno Agent; commands then run in a disposable microVM, with approval gates if you want them.
- How to give an OpenAI Agents SDK agent a code sandboxRun a SandboxAgent with Runtime's sandbox client, or give an ordinary Agent four function tools that act on one microVM.
- How to give CrewAI agents safe code executionCrewAI removed its CodeInterpreterTool; wrap Runtime's sandbox_tools(sbx) with CrewAI's tool and agents run code in a microVM.
- How to run Claude Agent SDK tools in a cloud sandboxGive the agent Runtime's in-process MCP server and turn off its local Bash, Read, Write and Edit tools, so its work runs in a microVM.
- How to run LangChain Deep Agents in a sandbox backendPass backend=RuntimeSandbox(sbx) to create_deep_agent, and its shell and file tools all run in one Runtime microVM.
- How to run smolagents code in a secure sandboxWrap Runtime's four sandbox functions with smolagents' @tool, and every command the agent runs executes in a disposable microVM.
- LangGraph code execution tool in a sandboxBind Runtime's sandbox_tools(sbx) to the model and put them in a ToolNode; every tool call then runs in a Linux microVM.
- LlamaIndex code interpreter tool in a secure sandboxTurn Runtime's sandbox functions into LlamaIndex FunctionTools, and the agent's code runs in a microVM instead of on your server.
- Pydantic AI code execution tool: run code in a sandbox with any modelPass sandbox_tools(sbx) to a Pydantic AI Agent and every command runs in a Runtime microVM, whichever model provider you use.
- Semantic Kernel code interpreter without Azure: a sandbox pluginWrap Runtime's sandbox functions with kernel_function into a KernelPlugin, and a Semantic Kernel agent runs code in a microVM.
Model APIs
- Claude tool use: how to run the code Claude writes in a sandboxGive Claude a run_command tool, run each tool_use block in a microVM, and reply with a tool_result holding the output and is_error.
- DeepSeek tool calls: how to run DeepSeek's code safelyPoint the OpenAI SDK at api.deepseek.com, give the model a run_python tool, and run each call in a microVM that installs from PyPI only.
- Gemini function calling: run Gemini's code in a sandboxDeclare a function tool, run each function_call step's code in an isolated microVM, and return a function_result with the output.
- Groq tool use: run model-generated code in a sandbox, not with evalReplace eval in Groq's tool-calling example with a sandbox: each tool call runs in its own microVM, in parallel, with no internet.
- How to run code from OpenAI function calling in a sandboxDefine a run_python function tool, run each call's code in a fresh microVM with no network, and return stdout, stderr and exit code.
- Mistral function calling: run code from Mistral models in a sandboxAdd a run_code tool to chat.complete, run each tool call in a microVM with no internet, and append a tool message with the result.
- OpenRouter tool calling: one code sandbox for every modelWrite the sandbox tool once in OpenAI's function format; OpenRouter passes it to any tool-capable model, and a microVM runs the code.
- Together AI function calling: run the model's code in a sandboxGive a Together model a run_python tool backed by a stateful sandbox interpreter, and return each cell's output as a tool message.
Tools
- How to clone a private Git repository into a sandbox without exposing the tokenStore the token as a Runtime secret that adds git's Authorization header, then clone and push over HTTPS; on paid accounts SSH works too.
- How to convert DOCX, XLSX and PPTX to PDF with LibreOffice in a sandboxInstall the LibreOffice -nogui packages in a microVM, run soffice --headless --convert-to pdf, and download the PDF from --outdir.
- How to convert Markdown to PDF or Word with Pandoc in a sandboxInstall pandoc and a PDF engine in a microVM, run pandoc in.md -o out.pdf or out.docx with --sandbox, and download the file.
- How to give a coding agent fast Vitest feedback in a sandboxKeep one sandbox per task, run vitest related on the files the agent changed, and hand the JSON report back to the model.
- How to host a Streamlit app from a sandbox and share the linkInstall Streamlit in the sandbox, start streamlit run app.py on port 8501 with spawn, and share that port as an HTTPS preview.
- How to let an AI agent open pull requests with the GitHub CLI from a sandboxInstall gh in the sandbox, store the token as a Runtime secret named GH_TOKEN, and the agent can push a branch and run gh pr create.
- How to preview a Next.js app an AI agent builtRun next dev in the agent's sandbox with spawn, allow *.runtimehost.com in allowedDevOrigins, and share port 3000 as a preview.
- How to preview a Vite dev server running in a cloud sandboxStart vite --port 5173 --strictPort with spawn, allow .runtimehost.com as a host, and open the port's private HTTPS preview.
- How to query large CSV and Parquet files with DuckDB in a sandboxInstall the duckdb Python package in the sandbox, upload the files or mount the bucket, run the SQL there and download the result.
- How to run a Gradio demo in a sandbox instead of a share linkBuild Gradio and your app into an image whose start command runs it on port 7860, create a sandbox from it, and share 7860 as a preview.
- How to run an agent's pytest suite in an isolated sandboxUpload the project to a microVM, install its requirements, run pytest there and download the JUnit XML and coverage report.
- How to run Docker Compose integration tests in a cloud sandboxUpload the repo, run sudo enable-docker, then docker compose up --wait and docker compose run your test service; copy the reports out.
- How to run FFmpeg in a cloud sandboxInstall Ubuntu's ffmpeg package in a microVM, upload the media, run ffmpeg or ffprobe, and download the output file.
- How to run headless Chrome in a sandbox without PuppeteerDownload chrome-headless-shell with npx @puppeteer/browsers, then call it with --print-to-pdf, --screenshot or --dump-dom and read the file.
- How to run Hugging Face Transformers models on CPU in a sandboxInstall PyTorch's CPU wheel and transformers, cache the model in an image, and run the pipeline with the internet off.
- How to run ImageMagick in a cloud sandboxInstall Ubuntu's imagemagick package in a microVM, run convert, mogrify or identify on the uploaded images, and download the results.
- How to run Jest tests in parallel cloud sandboxesInstall the project once, fork the sandbox into copies, give each copy one jest --shard=i/n, and merge the JUnit files afterwards.
- How to run MongoDB in a cloud sandboxAdd MongoDB's apt repository in an Ubuntu 24.04 microVM, install mongodb-org, start mongod with spawn, and load data with mongoimport.
- How to run MySQL in a cloud sandboxRun the official mysql image with Docker in a microVM, load your dump via /docker-entrypoint-initdb.d, query it, and mysqldump it back.
- How to run Playwright in a cloud sandboxInstall Playwright and Chromium in a Linux microVM, run your script there, and copy the screenshots or results back.
- How to run PostgreSQL in a sandbox for tests and agentsInstall Ubuntu's postgresql package in a microVM, start a server with initdb and postgres, load your schema, and query it with psql.
- How to run Puppeteer in a cloud sandboxInstall puppeteer from npm in an Ubuntu 24.04 microVM, add Chrome's system libraries with apt, run the script, and read the PDF back.
- How to run Redis in a cloud sandboxInstall redis-server with apt in an Ubuntu 24.04 microVM, check it with redis-cli ping, and connect to 127.0.0.1:6379 from the sandbox.
- How to run Selenium in a cloud sandboxPip-install selenium in an Ubuntu 24.04 microVM and let Selenium Manager fetch Chrome and chromedriver, or run a Grid container there.
- How to run Tesseract OCR in a cloud sandboxInstall tesseract-ocr and a language pack in a microVM, run tesseract or ocrmypdf on the scan, and read back text, TSV or a searchable PDF.
- How to run VS Code in the browser from a cloud sandbox with code-serverInstall code-server's .deb in the sandbox, start it on 127.0.0.1:8080 with spawn, and open it through a private HTTPS preview.
- How to test a SQLite migration on a copy of the database in a sandboxUpload a copy of the .db file, run the migration in one transaction, check integrity_check and foreign_key_check, then download it.
- Run Jupyter notebooks in a sandbox for an AI agentUpload the .ipynb, run it with papermill or nbconvert --execute inside a microVM, and download the executed notebook and its outputs.