@mastra/e2b
E2B cloud sandbox provider for Mastra workspaces. Provides secure, isolated code execution environments with support for mounting cloud storage.
Installation
npm install @mastra/e2b
Usage
import { Agent } from '@mastra/core/agent';
import { Workspace } from '@mastra/core/workspace';
import { E2BSandbox } from '@mastra/e2b';
const workspace = new Workspace({
sandbox: new E2BSandbox({
apiKey: 'my-api-key',
timeout: 60_000,
}),
});
const agent = new Agent({
name: 'my-agent',
model: 'anthropic/claude-opus-4-5',
workspace,
});
Documentation
Changelog
See the package changelog for version history and release notes.
Support
We have an open community Discord. Come and say hello and let us know if you have any questions or need any help getting things running.