DeepTask Sandbox Documentation

A secure, local-first sandbox that connects your AI assistant to your environment.
9 min read
Updated

DeepTask Sandbox is a cross-platform desktop application for executing automation tools in secure, isolated environments. Built with Electron and integrated with a Go-based MCP (Model Context Protocol) server, it gives your AI assistant a safe, toolable environment on your machine. Through natural conversation (via MCP), your assistant can run tools, access approved local capabilities, and orchestrate workflows reliably — with optional browser-backed execution (Puppeteer) when a task needs a real page.

Note: DeepTask Sandbox is free for personal and educational use. Commercial use requires a paid license with monthly subscription pricing based on the number of users.

Core Principles

  • Privacy First: All automation runs locally. Your data never leaves your machine.
  • Assistant Ready: Built natively for the Model Context Protocol (MCP). Works seamlessly with Claude, Cursor, and more.
  • Toolable Sandbox: Run Node tools for backend automation, and Puppeteer tools for browser automation and web scraping — each in isolated worker processes.
  • Built-in Guardrails: Scheduling (cron), task history, resource limits (memory 64–2048 MB, CPU thresholds), domain allowlists, and encrypted settings/credentials.

01. Quick Start

Getting up and running takes less than five minutes.

Step 1: Install the Desktop App

Download and run the installer for your operating system.

Download DeepTask Sandbox

Step 2: Connect Your Assistant

DeepTask uses the Model Context Protocol (MCP) to communicate with your AI. Follow the instructions for your favorite environment:

OSInstallation TypeCommand Path
WindowsSystem (Default)C:\Program Files\deeptask-sandbox\resources\mcp\deeptask-mcp.exe
WindowsUserC:\Users\<user>\AppData\Local\Programs\deeptask-sandbox\resources\mcp\deeptask-mcp.exe
macOSStandard/Applications/DeepTask Sandbox.app/Contents/Resources/mcp/deeptask-mcp
LinuxStandard/opt/deeptask-sandbox/resources/mcp/deeptask-mcp

Example Config Block (Claude Desktop):

{
  "mcpServers": {
    "deeptask": {
      "command": "PASTE_THE_COMMAND_PATH_HERE"
    }
  }
}

Step 3: Your First Tool

Once connected, simply ask your assistant to create and run a small tool inside the sandbox.

Try this prompt:

"Using DeepTask, write a small node tool that fetches the title of https://example.com and returns it as structured output."


02. Tool Guide

DeepTask tools are powerful, type-safe, and easy to build. Your AI can generate these for you, or you can write them yourself.

Anatomy of a Tool

Every tool consists of two parts: Metadata (the configuration) and the Main Function (the logic). Tool names must use snake_case (lowercase letters, numbers, underscores only; e.g. web_scraper). Tools must be ESM (.mjs) modules; Node.js 24+ is supported.

import { browser } from "@deeptask/sandbox";

export const metadata = {
    name: "web_scraper",
    type: "puppeteer", // "node" for pure logic, "puppeteer" when you need a real browser
    description: "Extracts basic info from a webpage",
    networkEnabled: true,
    domainsAllowed: ["example.com"],
    inputSchema: {
        type: "object",
        properties: {
            url: {type: "string", format: "uri"}
        },
        required: ["url"]
    }
};

export async function main({url}) {
    const page = browser.getPage();
    await page.goto(url, {waitUntil: "networkidle0"});

    const title = await page.title();
    return {
        content: [{type: "text", text: `Scraped: ${title}`}],
        structuredContent: {title},
        isError: false
    };
}

Advanced Features

File Uploads

You can define inputs that accept files (PDFs, images, etc.) using JSON Schema: contentEncoding: "base64", contentMediaType (e.g. application/pdf), and maxLength for size limits (base64 is ~33% larger; e.g. ~5MB → maxLength: 6990506).

inputSchema: {
    properties: {
        document: {
            type: "string",
            contentEncoding: "base64",
            contentMediaType: "application/pdf",
            maxLength: 6990506,  // ~5MB file
            description: "Upload a PDF for analysis"
        }
    }
}

In your tool, decode with atob(input.document) (or new Uint8Array(atob(input.document).split('').map(c=>c.charCodeAt(0))) for binary) and process as needed. For size limits: maxLength = Math.ceil(bytes/3)*4 (e.g. 1MB → 1398101, 5MB → 6990506).

Encrypted Settings

Store sensitive configuration securely. Users are prompted for these values in the UI, and they are encrypted at rest. Use format: "password" for password fields.

settingsSchema: {
    properties: {
        apiKey: {
            type: "string",
            format: "password",
            title: "API Key"
        }
    }
}

03. Security & Isolation

All plans include these safeguards. DeepTask is built for reliability and safety:

  • Domain allowlists: Tools cannot access the network unless you set networkEnabled: true and specify domainsAllowed (use ["*"] to allow all hosts). When a URL is blocked, fetch() throws before any request — wrap fetch() in try/catch.
  • Resource Limits: Configurable memory (64–2048 MB; default 256 MB for Node, 512 MB for Puppeteer) and CPU threshold (50–100%, default 95%). Tools exceeding limits are automatically terminated.
  • Timeout Protection: Configurable per tool via defaultTimeout (default 5 minutes).
  • Filesystem: Optional read/write access to a virtual filesystem (root /) with folders /Temp, /Documents, /Images, /Videos, /Audios, /Downloads. No host filesystem access; paths cannot escape the root. Use fsEnabled and fsWriteEnabled. Use fs/promises (sync methods like readFileSync are blocked). Files persist across tool invocations; /Temp is cleaned on app startup and every 24h (48h max age).

04. Pro Features

Smart Scheduling

Automate your workflows with built-in Cron support.

  • Daily Reports: 0 9 * * * (Every morning at 9 AM)
  • Weekly Cleanup: 0 0 * * 0 (Every Sunday at midnight)

05. API & Tool Reference

Sandbox API

Import from @deeptask/sandbox:

APIDescription
browser(Puppeteer only) browser.getPage() → primary Page; browser.getPages() → all pages. Use import { browser } from "@deeptask/sandbox";
tooltool.self.settings (encrypted at rest), tool.call(name, params, sandboxId?), tool.chain([{name, params, sandboxId?}, ...]). Use import { tool } from "@deeptask/sandbox";
document, image, audio, video, model, archiveBuilt-in APIs (see sections below). All return { files, data, isError, message }.
language, timeZoneSandbox locale and timezone.
fs / fs/promises(when fsEnabled) Virtual FS under / with /Temp, /Documents, /Images, etc. Use fs/promises — sync methods are blocked.

Puppeteer: page.goto() accepts http/https only. Wrap in try/catch. Use response.buffer() (not body()) for response bytes.

document

import { document } from "@deeptask/sandbox"

Document conversion, PDF manipulation, and full-text search. All methods return { files, data, isError, message }. Always check isError before using files or data.

MethodDescription
convertDocumentConvert between formats. Pairs: md↔html, pdf↔html, docx/pptx/epub↔html, html→docx/pdf/pptx/epub, csv↔xlsx. Options vary by pair (e.g. html→pdf: format, printBackground; pdf→html: startPage, endPage).
mergePdfMerge multiple PDFs into one.
splitPdfSplit PDF into pages. Omit pages for one file per page. Outputs go to /Temp/.
compressPdfCompress PDF. Options: quality (screen, ebook, printer, prepress).
fillPdfFormFill PDF form fields. Keys are raw PDF field names (case-sensitive).
getPdfInfoGet page count, title, author, etc.
getPdfFormList form fields in a PDF.
extractArticleExtract main article text (Readability). Supports md, pdf, docx, pptx, epub, html. Returns data.text; check for empty string.
extractPagesExtract page range from PDF (1-based inclusive).
searchFilesFull-text search across indexed files. Only /Documents is indexed. Returns data.hits, data.total. Use limit (default 20).
searchInFileSearch inside a single file. Supports text and office types. offset/limit paginate hits.

Note: protectPdf is not implemented — do not use.

image

import { image } from "@deeptask/sandbox"

Image processing with Sharp/libvips. All methods return { files, data, isError, message }.

MethodDescription
resizeImageResize. Options: fit (cover, contain, fill, inside, outside), withoutEnlargement.
compressImageRe-encode to reduce size; preserves metadata.
minifyImageStrip metadata only.
cropImageCrop by left, top, width, height.
rotateImageRotate by angle.
flipImage / flopImageMirror horizontally or vertically.
convertImageConvert format. Supports png, jpeg, gif, tiff, webp, ico, icns; SVG as source.
removeBackgroundSimple color-match (not AI). Output PNG. threshold 0–255 (default 10).
compositeImageOverlay images at left, top, optional opacity.
mergeImagesCombine images. Options: layout (horizontal, vertical, grid), gap, columns, maxWidth, maxHeight.
getImageInfoReturns data: { width, height, format, channels, hasAlpha, space }.
blurImage, sharpenImageBlur or sharpen; sigma controls strength.
grayscaleImage, trimImage, normalizeImage, extendImage, modulateImage, negateImage, tintImageColor and layout operations.

audio

import { audio } from "@deeptask/sandbox"

Audio conversion and processing. All methods return { files, data, isError, message }.

MethodDescription
convertAudioConvert format. Supports mp3, wav, aac, ogg, flac, m4a, wma, opus.
trimAudioTrim by start, end or duration (seconds).
concatAudioConcatenate audio files.
setAudioVolumeSet volume (number).
setAudioTempoTempo 0.5–2.0 (FFmpeg limit).
fadeAudioFade in/out. Options: type, start, duration.
normalizeAudioLoudness normalize. target LUFS (default -16).
removeAudioSilenceRemove silence. threshold dB (default -50), duration seconds (default 0.5).
mixAudioMix multiple audio files. Optional volumes.
getAudioInfoReturns data: { duration, sampleRate, channels, bitrate, format, codec }.
textToSpeechText-to-speech. macOS/Windows only. format: mp3, wav, ogg.

Note: voiceToText is not implemented — do not use.

video

import { video } from "@deeptask/sandbox"

Video conversion, trimming, and effects. All methods return { files, data, isError, message }.

MethodDescription
convertVideoConvert format. Supports mp4, webm, avi, mov, mkv, m4v, flv, wmv.
compressVideoCompress. Options: crf (18–28, default 23), maxWidth, maxHeight, videoBitrate, audioBitrate.
trimVideoTrim by start, end or duration.
concatVideosConcatenate video files.
extractAudioTrackExtract audio to mp3, wav, aac, m4a, ogg, flac.
extractFrameExtract a single frame at timestamp.
screenshotVideoExtract frames at multiple timestamps. Returns one image per timestamp in order.
videoToGifConvert video to GIF. Options: start, duration, fps, width, height.
generateGifCreate GIF from image sequence. Options: fps, width, height, loop.
burnSubtitlesBurn subtitle file into video.
extractSubtitlesExtract subtitles to srt or vtt.
cropVideo, rotateVideoCrop or rotate (90, 180, 270).
setVideoSpeed, setVideoVolume, fadeVideoSpeed, volume, fade effects.
getVideoInfoReturns data: { duration, width, height, fps, videoBitrate, audioBitrate, format, ... }.

model

import { model } from "@deeptask/sandbox"

LLM text generation, image generation, and video generation. Requires networkEnabled and API keys. Store apiKey in settingsSchema with format: "password"; access via tool.self.settings.apiKey. Never hardcode keys.

MethodDescription
generateTextChat completion. messages, optional system, options: { provider, apiKey, baseURL }. Providers: openai, anthropic, google, cohere, mistral, openrouter, grok, deepseek, groq. Default: openai (gpt-4o-mini).
generateImageImage generation. prompt, optional image (image-to-image). Providers: openai, stability, replicate, fal, together, nano-banana, ideogram. Image-to-image only with fal, nano-banana.
generateVideoVideo generation. prompt, optional image. Providers: runway, replicate, luma, kling, minimax, seedance, veo3. Resolution is provider-specific (e.g. ratio, resolution).

archive

import { archive } from "@deeptask/sandbox"

Zip and unzip files. All methods return { files, data, isError, message }.

MethodDescription
zipFilesZip files into one archive. Output: archive-{timestamp}.zip in /Temp/. Files at zip root (no directory structure preserved).
unzipFileUnzip. filter: filename substrings to include. files[] contains virtual paths for extracted files; directory structure preserved.

MCP Tools for Assistants

Your AI assistant interacts with DeepTask via these MCP tools:

  • install_tool — Install a tool for reuse. Run with call_tool after.
  • uninstall_tool — Remove an installed tool.
  • call_tool — Run an installed tool. Sync/async based on tool defaultTimeout (>60s = async).
  • get_call_tool_result — Poll result for async call_tool (by taskId).
  • eval_tool_script — Run tool once without installing (one-off). Params: type, content, optional sandboxId.
  • batch_call_tools — Call multiple tools in one request.
  • list_more_tools — List installed tools. Use get_tool_script_syntax for tool syntax (sections: document, image, audio, video, model, archive).

Support & Resources