
Company News
Jerod Santo Joins Socket as Head of Media
Allow myself to introduce... myself.
@agentkit-js/mastra-sandbox
Advanced tools
Mastra sandbox provider backed by agentkit-js kernels — WASM isolation with no external infrastructure (alternative to Blaxel/E2B providers)
A Mastra sandbox provider backed by agentkit-js kernels. WASM isolation with no external infrastructure — drop-in alternative to Blaxel / E2B / Daytona providers.
Mastra (mastra.ai) opened its sandbox-provider contract in 2026-02 so users can plug in a custom code-execution backend. The defaults are service-backed (Blaxel-hosted, E2B-hosted) — fine if you're already paying for one of those, awkward when you're not.
This package ships a Mastra sandbox provider that delegates to any agentkit
kernel. WASM kernels (QuickJSKernel, PyodideKernel, WasmtimeKernel) run
in-process, on every Workers edge, with sub-100ms cold start — no API key,
no account, no billing.
| agentkit kernel | Blaxel / E2B sandbox | |
|---|---|---|
| Cold start | ~50 ms | 200–800 ms |
| Cost / call | $0 (in-process) | per-second billing |
| Isolation | Language-level | Process / firecracker |
| Workers safe | ✅ | ❌ (server required) |
| Snapshots | ✅ (Wasmtime) | ✅ (image-level) |
Use a WASM kernel when "model wrote a snippet to do math / parse JSON / try something" is the workload. Use Blaxel/E2B when you need full POSIX, native binaries, or untrusted multi-tenant isolation across mutually-distrusting customers.
npm install @agentkit-js/mastra-sandbox @agentkit-js/kernel-quickjs \
quickjs-emscripten @jitl/quickjs-wasmfile-release-sync
import { Agent } from "@mastra/core";
import { QuickJSKernel } from "@agentkit-js/kernel-quickjs";
import { agentkitMastraSandbox } from "@agentkit-js/mastra-sandbox";
const sandbox = agentkitMastraSandbox({
kernel: new QuickJSKernel({ timeoutMs: 5_000 }),
capabilities: {
allowedHosts: ["api.example.com"],
cpuMs: 5_000,
memoryLimitBytes: 64 * 1024 * 1024,
env: { OPENAI_API_KEY: process.env.OPENAI_API_KEY ?? "" },
},
});
const agent = new Agent({
name: "my-agent",
// …whichever Mastra config wires sandboxes (e.g. tools.execute_code,
// workspace runtime, etc.). The provider implements the
// execute(code, options) -> { output, stderr, exitCode } contract Mastra
// calls into; consult Mastra's docs for the latest wiring path.
tools: { sandbox },
});
Every kernel honours the same CapabilityManifest:
| Field | What it gates |
|---|---|
allowedHosts | Outbound fetch() (glob host allow-list) |
allowedReadPaths | __fs__.readFile(path) |
allowedWritePaths | __fs__.writeFile(path, data) |
env | Frozen __env__ map exposed inside sandbox |
cpuMs | Per-call timeout (tightens kernel default) |
memoryLimitBytes | Hard runtime memory cap (where supported) |
The provider also accepts per-call timeout and env in
execute(code, options) — these tighten / merge into the provider-level
manifest at call time.
docs/guides/code-mode.md
— the same kernels behind a standalone MCP server.@agentkit-js/aisdk
— the same kernels as Vercel AI SDK tools.FAQs
Mastra sandbox provider backed by agentkit-js kernels — WASM isolation with no external infrastructure (alternative to Blaxel/E2B providers)
We found that @agentkit-js/mastra-sandbox demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Allow myself to introduce... myself.

Research
/Security News
A Twitch browser extension on Chrome and Firefox forwards users’ live OAuth session tokens through proxies controlled by a Russian bot service.

Security News
Anthropic found biased reasoning and recklessness drove Claude Mythos 5 to publish malware on PyPI and compromise a security vendor.