跳到正文
DEV Community· Sandscale·· 44 分鐘前AI 評分61

Sandscale 與 Railway Sandboxes 比較:服務旁的 VM,還是每次智能體執行的受治理沙盒

Sandscale vs Railway Sandboxes: VMs next to your services, or a governed box per agent run

AI 導讀

Sandscale 的文章比較 Sandscale 與 Railway Sandboxes,指出兩者均以 VM 隔離執行環境,但在網絡預設、機密資料生命週期、狀態保留、計費及治理方面各有取捨。

正文

Railway added sandboxes to its platform: isolated Linux VMs you create on demand, run commands in and destroy, each scoped to a Railway environment so it can sit on the same private network as your services and databases. Sandscale is a standalone sandbox service for agent code. If your app already runs on Railway, its sandboxes are the closest thing to hand. This post compares them on the points that decide the choice.

Railway facts come from its Sandboxes docs, read in November 2026. Sandscale facts come from sandscale.dev.

Isolation

Railway describes each sandbox as "a programmatically controllable, fully isolated virtual machine". The page we read does not name the VMM. The standard image is Ubuntu with git, Node and common coding agents preinstalled.

Sandscale runs each agent run in its own Firecracker microVM with its own kernel; nothing is shared with the run next to it.

Both are VM boundaries.

Network: the biggest difference

Railway: "Every sandbox has outbound internet access through a NAT gateway." The default mode, ISOLATED, means outbound internet only: the sandbox cannot reach other services in the environment over private networking. A PRIVATE mode joins the environment's private network. Public domains can be configured at creation for previews and webhooks.

Sandscale: sandboxes start with network mode none. With allowlist, a sandbox can reach only your organization's egress allowlist and the package registry presets you turn on (npm, PyPI, Go, crates).

For agent code this matters. Open outbound internet means a prompt-injected run can send whatever it can read to any host. On Railway you would add that control yourself, for example with a proxy. On Sandscale, closed is the default and opening is a policy decision. Our post on egress allowlist design covers why.

The flip side: if your agent must talk to a database or service on Railway's private network, Railway's PRIVATE mode makes that one option. On Sandscale you would expose that service to an allowlisted host.

Secrets

Railway: env at create time "bakes environment variables into the sandbox, available to every command over both exec and SSH for the sandbox's lifetime", and the docs say this includes secrets. Values can reference other Railway variables.

Sandscale: Vault hands secrets to the sandbox in memory as environment variables, keeps the values out of prompts, logs, the API's answer and the audit log (the audit entry names the variables, not the values), and ends them with the run.

In both cases code in the box can read its environment. The difference is lifetime and records: a Vault secret stops working when the run ends, and its use is in the audit log.

Lifecycle and state

Railway destroys a sandbox after its idle timeout. On Hobby and Pro the default is 30 minutes, settable from 1 to 120, or disabled with idleTimeoutMinutes: 0; Trial and Free default to 5 minutes. Running commands, an active SSH session and sandbox.heartbeat() reset the timer. For reuse, checkpoints save a sandbox's disk by name and forks clone a running sandbox's filesystem into a new one. In both cases "files are preserved, running processes are not".

Sandscale gives each sandbox a lifetime (timeoutSeconds, server default one hour), hibernates an idle sandbox between calls and wakes it on the next call, and offers pause, which keeps memory and files, on every plan. Snapshots let new sandboxes start from a saved /workspace.

If your agent's state is mostly files, Railway's checkpoints and forks cover it, and forking a prepared box to try several attempts in parallel is a pattern Railway documents well. If you need processes and memory to survive a wait, Sandscale's pause does that.

Pricing

Railway bills sandboxes "at VM rates, metered per second, for CPU used, memory in use, and outbound traffic". As of November 2026: $50 per vCPU per month for CPU actually used, $50 per GB per month for memory in use (including the operating system and file system cache), and $0.05 per GB of egress. The docs are explicit that "waiting on a model or user may reduce CPU use, but memory, background CPU use, and outbound traffic remain billable". Sandbox usage draws from your plan's included usage.

Sandscale bills awake vCPU-hours with memory included at 4 GiB per vCPU. Paused time and idle time between tool calls do not count. Plans include 100 hours on Free, 1,500 on Pro ($25 a month billed monthly) and 2,000 per member pooled on Team ($48 per member a month billed monthly); beyond that, $0.05 per awake vCPU-hour if you turn it on, or a 500-hour pack for $10. See pricing.

Railway's meter is close to "pay for what the box actually consumes", which suits light, short tasks. Sandscale's meter counts whole vCPUs while awake and skips idle gaps. Model both against your own run shape.

Limits

Railway (Free / Hobby / Pro) Sandscale (Free / Pro / Team)
Running at once 10 / 50 / 100 per environment 3 / 30 / 30, more on request
Largest box 2 vCPU, 2 GB / 8 vCPU, 8 GB / 24 vCPU, 24 GB 2 / 16 / 16 vCPU (32 on request), 4 GiB per vCPU
Default region US West (us-west2), others selectable US (N. Virginia); Europe (Frankfurt) announced, not open yet

Governance

Railway's sandboxes inherit its project and environment model and project tokens scoped to one environment, which Railway recommends as least access. Sandscale adds agent-specific controls on every plan: human approvals with a named approver, a hash-chained audit log, DLP on prompts and MCP tool calls, and agent policy where Claude Code runs under your rules through its hooks. Team adds SSO, roles and audit export.

When to pick which

Pick Railway if your app and data already live on Railway, your agent needs the environment's private network, you want forks and checkpoints for parallel attempts, or you want a meter that follows actual CPU and memory use.

Pick Sandscale if you want the network closed by default with an allowlist, secrets that end with the run, pause with memory kept, and approvals and audit built in. Our service levels page says there is no availability commitment or service credit yet; weigh that too.

Originally published on the Sandscale blog.

來源:DEV Community · dev.to