E2BSandbox implements CloudSandbox. E2BSandboxToolkit exposes the same session through Agent tools. Import both from @agentium/core/toolkits.
Run code
This example creates a real remote sandbox when run. Save ase2b.ts, then use npx tsx e2b.ts.
e2b.ts
42. The SDK import and sandbox creation are lazy; the first operation starts the session. Leave template unset to use the interpreter SDK’s default language-capable template.
Configure ownership
lifetimeSeconds bounds the remote session lifetime independently of each operation’s timeout. Every sandbox created by this adapter is owned and killed during close(). Concurrent starts share one creation; close is terminal.
For Agent tools, create E2BSandboxToolkit, pass getTools() to your Agent, and close both the Agent and toolkit after active runs settle. Grant only the intended tool names in a harness.