Introducing Sandbox Computer Use for Mastra Agents

Give your agents a computer to use, just like you do.

Paul ScanlonPaul Scanlon·

Sep 2, 2026

·

2 min read

Your Mastra agents can now control a real Linux desktop with computer tools. Browse the web, fill in forms, download files, take screenshots, and run programs from a terminal — all from the safety of a sandbox.

We're launching today with two providers: E2B Desktop and Daytona. Both expose 11 computer_* tools your agents can use:

  • Screenshot: computer_screenshot
  • Mouse: computer_click, computer_double_click, computer_right_click, computer_move_mouse, computer_drag, computer_scroll
  • Keyboard: computer_type, computer_press_key
  • Environment: computer_get_screen_info, computer_wait

An alternative is to use Mastra’s browser capabilities so your agents navigate the web, extract data, and pass it back for processing. But with computer tools, you can extend an agent's capabilities by giving it access to the whole sandbox operating system.

Supported providers implement Mastra's SandboxComputer interface, which includes several helper methods: .getScreenSize(), .getCursorPosition(), and .streamUrl() — to watch your agent live at work.

Get started

Install the E2B Desktop provider:

GNU BashTerminal
npm install @mastra/e2b-desktop
note
Requires @mastra/core@1.62.0 or later, added in PR #21700.

Attach an E2BDesktopSandbox to your agent's Workspace:

TypeScriptsrc/mastra/agents/computer-tools-agent.ts
import { Agent } from "@mastra/core/agent";
import { Workspace } from "@mastra/core/workspace";
import { E2BDesktopSandbox } from "@mastra/e2b-desktop";
 
export const computerToolsAgent = new Agent({
  id: "computer-tools-agent",
  name: "Computer Tools Agent",
  instructions: /* ... */,
  model: "anthropic/claude-sonnet-5",
  workspace: new Workspace({
    id: "computer-tools-workspace",
    sandbox: new E2BDesktopSandbox({
      id: "computer-tools-desktop",
      apiKey: process.env.E2B_API_KEY,
    })
  }),
  defaultOptions: { maxSteps: 50 }
});

For more information and full configuration options, see:

Share:
Paul Scanlon
Paul ScanlonTechnical Product Marketing Manager

Paul Scanlon sits between Developer Education and Product Marketing at Mastra. Previously, he was a Technical Product Marketing Manager at Neon and worked in Developer Relations at Gatsby, where he created educational content and developer experiences.

All articles by Paul Scanlon