Does Grain rely on E2B?
Yes. Grain's paid cloud workspaces run on E2B microVM sandboxes. Grain adds the workspace, publication, data, sharing and feedback layer around that runtime.
Grain / Learn / Grain and E2B: the hub and the runtime
Relationship
E2B supplies isolated cloud sandboxes where agent code runs, while Grain supplies the persistent workspace where the result gets a URL, data and an audience. Grain uses E2B microVM sandboxes for paid cloud workspaces, but the two products solve different layers of the job.
E2B is runtime infrastructure and Grain is the artifact hub around the output. A sandbox gives an agent a machine, filesystem and process boundary for a session. A Grain workspace keeps the files the agent produced, publishes them at a durable address, and can add Postgres, logins, scheduled jobs and controlled sharing. In Grain's paid cloud mode, the runtime beneath that workspace is an E2B microVM. Using Grain does not turn E2B into a publishing product, and using E2B directly does not create Grain's workspace, sharing or comment loop.
| Concern | E2B | Grain |
|---|---|---|
| Primary job | Run untrusted or agent-written code in an isolated sandbox | Keep and publish what a coding agent builds |
| Unit you manage | A sandbox session created through a Python or JavaScript SDK | A workspace containing artifact files and optional app services |
| Agent | Bring your own agent or application | Bring Claude Code, Codex, Cursor or another MCP-capable CLI agent |
| Lifetime | Session-scoped compute with plan-dependent duration | Published artifacts stay published after the agent session and laptop close |
| Public output | Not positioned as a hosting or publishing product | A share URL shaped like https://<slug>.share.rungrain.com |
| Application data | Sandbox storage for execution | Optional Postgres database, logins and scheduled jobs in the workspace |
| Sharing | Infrastructure consumed through an SDK | Public, password-protected or invite-only access, plus reader comments |
| Pricing model | Usage infrastructure with Hobby, Pro and custom tiers | Free publishing with paid always-on compute and team features |
| Direct control | You write the sandbox lifecycle and execution integration | The Mac app and CLI own the publish, checkpoint and share workflow |
Use both when an agent-built app needs managed cloud execution and a lasting place for people to use the result. Consider an agent that builds a weekly support report. It reads source files, generates a small app, writes a scheduled refresh job and needs a database for reviewed items. E2B provides the isolated microVM where the cloud workspace runs. Grain provides the workspace identity, published URL, files, Postgres database, schedule, access mode and comments. The runtime can sleep or change while the artifact remains the thing your team recognizes. This is also the default relationship inside Grain's paid cloud workspaces: you work with the Grain surface while E2B supplies the underlying sandbox runtime.
Use E2B directly when you are building an agent platform and need programmable sandbox creation, execution and teardown. You may want to choose session limits, stream process output or build your own storage and publishing layer. In that case, Grain would add an opinionated artifact workflow you may not need. Use Grain without managing E2B when your job starts after a coding agent has made something useful. A local workspace can publish a static page or app without you writing sandbox lifecycle code. Choose this route when the desired result is a URL for teammates, not a sandbox API for developers. Grain is not a general substitute for E2B's SDK, and E2B is not a substitute for a persistent artifact hub.
Build a support-trends app from the sample tickets. Add a Postgres table for reviewed themes and a weekly refresh job. Keep the interface usable at mobile width. This describes the thing people need, not the infrastructure.grain init. Grain creates a workspace for the current folder and writes MCP configuration to .mcp.json, .codex/config.toml and .cursor/mcp.json. Your configured agent can now use the workspace tools.grain push to send the current workspace contents. Execution and publication are separate steps: the runtime proves the code can run, while the push establishes what belongs in the workspace.grain checkpoint -m "support report ready for review". The checkpoint gives the team a clear state to discuss before later agent changes.grain share --public for an open review link, or grain share --password <pw> for password access. Grain returns the share URL. Readers open the artifact rather than the sandbox session.Yes. Grain's paid cloud workspaces run on E2B microVM sandboxes. Grain adds the workspace, publication, data, sharing and feedback layer around that runtime.
Not for sandbox infrastructure. Use E2B directly when you are building execution into an agent product. Use Grain when you need the output of a coding agent to stay published and shareable.
Yes. E2B exposes sandbox infrastructure through Python and JavaScript SDKs. You own the surrounding lifecycle, storage and publishing workflow.
Yes. Grain's Mac app and CLI are the product surface. In paid cloud workspaces, E2B is an implementation layer rather than an SDK you need to operate.
Treat an E2B sandbox as session-scoped compute. In Grain, the published artifact belongs to the workspace and stays published after the coding session ends.
Download the free Mac app and publish with the coding agent you already use.
Free forever. No card. Bring your own agent.