DEV Community

Your first Sandscale sandbox from Codex: config.toml, login and a Go command in a microVM

Codex runs commands in your working copy. This walkthrough gives it a separate place to run them: a Sandscale sandbox, a Firecracker microVM with its own kernel.

You will create an account, add a few lines to config.toml, sign in with codex mcp login, and ask Codex to start a sandbox, run go version in it and stop it.

It is a first-run guide. For tool allow lists and approval modes in depth, read the longer Codex setup guide. If you want Codex itself to run on a cloud machine, see codex exec in a cloud workspace.

Sandscale facts are from the Quickstart, the Connect Claude or ChatGPT guide, which covers every remote MCP client, the plans reference and the CLI's sandscale help. Codex facts are from OpenAI's Codex MCP documentation, as of November 2026.

1. Sign up

Create a Sandscale account. You start on the Free plan: 100 awake vCPU-hours a month, 3 boxes at once and up to 2 vCPU per box, per the Quickstart. That is enough for this guide. Pro and up need a payment method; Free does not.

2. Add the server to config.toml

Codex keeps MCP servers in ~/.codex/config.toml, or in .codex/config.toml inside a trusted project. Add a table for the remote Sandscale server:

[mcp_servers.sandscale]
url = "https://mcp.sandscale.dev/mcp"
tool_timeout_sec = 600

The first line is the address from the Quickstart. The second is optional. Per the Codex docs, each MCP tool call has a time limit, tool_timeout_sec, which defaults to 60 (the value is in seconds). A sandbox command that runs longer would look like a timeout to the agent even though it may still be running. go version is quick, but you will want the higher limit for the first real task.

No token goes in the file. If you have the Sandscale CLI installed, sandscale mcp connect codex prints this same snippet.

3. Sign in

codex mcp login sandscale

Codex opens the authorization URL. Sandscale's sign-in page asks you to approve the app; the approval page names it and says it is not made by Sandscale. After that each tool call runs as you.

On a machine without a browser, use:

codex mcp login sandscale --no-browser

Codex prints the URL, you open it anywhere, sign in, and paste the full redirect URL back into the terminal even if the callback page does not load.

Check it:

codex mcp list

Inside the Codex TUI, /mcp shows the active servers.

4. Run your first sandbox command

Start Codex in any directory and give it this prompt:

Start a sandbox from the Go template that ends by itself after 10 minutes. Run go version in it and tell me the exit code and the exact output. Then stop the sandbox.

The Go template has the Go toolchain installed, along with Python 3, Node.js, git and curl, which is why this prompt needs no setup step.

Per the Connect guide, the remote server's tools for this are sandbox_create, sandbox_run and sandbox_stop. The list Codex shows may differ from the guide's, so check it.

Codex asks before calling a tool its settings do not already allow. Read the arguments:

  • sandbox_create should name the Go template and carry a time limit.
  • sandbox_run should run go version and nothing else.
  • sandbox_stop should name the id that sandbox_create returned.

The reference marks stop as not undoable: it deletes the sandbox's disk.

If you want every write-type tool to prompt while you are learning, add this line to the same table. Per the Codex docs, writes prompts for any tool not marked read-only:

default_tools_approval_mode = "writes"

When it finishes, Codex should report an exit code and the output of go version. That ran inside the sandbox. If Go is installed on your machine, compare the two lines.

What to check next

  • Nothing is left running. Ask Codex to list your sandboxes. The one from this run should be gone. A sandbox also ends on its own when its time limit passes.
  • The run is on the record. Open the audit log in the console. Per the Connect guide it records each remote MCP call's tool, region, outcome and app, not the arguments.
  • The network. A new sandbox has no network by default, and the modes you can start depend on your plan and your organization's policy. Until you start one with a network mode, a command that downloads modules or packages will not work, so plan your first real task around files you upload.
  • Region. The remote server answers for the United States and refuses another region with region_unavailable.
  • Signing out. Removing the server from config.toml stops Codex using it but does not revoke what was issued. The Connect guide describes revoking with DELETE /api/v1/me/mcp-connectors/{id}.
  • A real task. Try the longer first task in the Codex setup guide: upload go.mod, go.sum and the files under internal/, run go vet ./... && go test ./... and read the result.

If you have not created an account yet, sign up for Sandscale and start at step 2.

Originally published on the Sandscale blog.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.