LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Agent
  • Middleware
  • Backends
  • Sandboxes
  • Skills
  • Subagents
  • Types
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
  • Vitest
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentsbackendsSandboxBackendProtocol
Interface●Since v1.4Deprecated

SandboxBackendProtocol

Copy
interface SandboxBackendProtocol

Bases

SandboxBackendProtocolV1

Properties

Methods

Inherited fromSandboxBackendProtocolV1

Properties

Pid: string
—

Unique identifier for the sandbox backend

Methods

MdownloadFiles→ MaybePromise<FileDownloadResponse[]>
—

Download multiple files from the sandbox.

Medit→ Promise<EditResult>
—

Edit a file by replacing string occurrences.

View source on GitHub
Mexecute→ MaybePromise<ExecuteResponse>
—

Execute a command in the sandbox.

MglobInfo→ MaybePromise<FileInfo[]>
—

Structured glob matching returning FileInfo objects.

MgrepRaw→ MaybePromise<string | GrepMatch[]>
—

Search file contents for a literal text pattern.

MlsInfo→ MaybePromise<FileInfo[]>
—

Structured listing with file metadata.

Mread→ Promise<ReadResult>
—

Read file content with line numbers.

MreadRaw→ Promise<ReadRawResult>
—

Read file content as raw FileData.

MuploadFiles→ MaybePromise<FileUploadResponse[]>
—

Upload multiple files to the sandbox.

Mwrite→ Promise<WriteResult>
—

Create a new file with content.

Inherited fromBackendProtocolV1

Methods

MdownloadFiles→ MaybePromise<FileDownloadResponse[]>
—

Download multiple files from the sandbox.

Medit→ Promise<EditResult>
—

Edit a file by replacing string occurrences.

MglobInfo→ MaybePromise<FileInfo[]>
—

Structured glob matching returning FileInfo objects.

MgrepRaw→ MaybePromise<string | GrepMatch[]>
—

Search file contents for a literal text pattern.

MlsInfo→ MaybePromise<FileInfo[]>
—

Structured listing with file metadata.

Mread→ Promise<ReadResult>
—

Read file content with line numbers.

MreadRaw→ Promise<ReadRawResult>
—

Read file content as raw FileData.

MuploadFiles→ MaybePromise<FileUploadResponse[]>
—

Upload multiple files to the sandbox.

Mwrite→ Promise<WriteResult>
—

Create a new file with content.

property
id: string

Unique identifier for the sandbox backend

method
downloadFiles→ MaybePromise<FileDownloadResponse[]>

Download multiple files from the sandbox. Implementations must support partial success.

method
edit→ Promise<EditResult>

Edit a file by replacing string occurrences.

Uses downloadFiles() to read, performs string replacement in TypeScript, then uploadFiles() to write back. No runtime needed on the sandbox host.

Memory-conscious: releases intermediate references early so the GC can reclaim buffers before the next large allocation is made.

method
execute→ MaybePromise<ExecuteResponse>

Execute a command in the sandbox. This is the only method concrete implementations must provide.

method
globInfo→ MaybePromise<FileInfo[]>

Structured glob matching returning FileInfo objects.

method
grepRaw→ MaybePromise<string | GrepMatch[]>

Search file contents for a literal text pattern.

Binary files (determined by MIME type) are skipped.

method
lsInfo→ MaybePromise<FileInfo[]>

Structured listing with file metadata.

Lists files and directories in the specified directory (non-recursive). Directories have a trailing / in their path and is_dir=true.

method
read→ Promise<ReadResult>

Read file content with line numbers.

Uses pure POSIX shell (awk) via execute() — only the requested slice is returned over the wire, making this efficient for large files. Works on any Linux including Alpine (no Python or Node.js needed).

method
readRaw→ Promise<ReadRawResult>

Read file content as raw FileData.

Uses downloadFiles() directly — no runtime needed on the sandbox host.

method
uploadFiles→ MaybePromise<FileUploadResponse[]>

Upload multiple files to the sandbox. Implementations must support partial success.

method
write→ Promise<WriteResult>

Create a new file with content.

Uses downloadFiles() to check existence and uploadFiles() to write. No runtime needed on the sandbox host.