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
JavaScriptdeepagentsindexSandboxBackendProtocolV2
Interface●Since v1.9

SandboxBackendProtocolV2

Protocol for sandboxed backends with isolated runtime.

Key differences from SandboxBackendProtocol:

  • Extends BackendProtocolV2 instead of BackendProtocol
  • All methods return structured Result types for consistent error handling
Copy
interface SandboxBackendProtocolV2

Bases

BackendProtocolV2

Properties

property
downloadFiles: (paths: string[]) => MaybePromise<FileDownloadResponse[]>
property
id: string

Unique identifier for the sandbox backend instance

property
uploadFiles: (files: [string, Uint8Array<ArrayBufferLike>][]) => MaybePromise<FileUploadResponse[]>

Methods

method
delete→ MaybePromise<DeleteResult>

Delete a single file. Optional - backends that don't support file deletion can omit this.

method
edit→ MaybePromise<EditResult>

Edit a file by replacing string occurrences.

method
execute→ MaybePromise<ExecuteResponse>

Execute a command in the sandbox.

method
glob→ MaybePromise<GlobResult>

Structured glob matching returning FileInfo objects.

method
grep→ MaybePromise<GrepResult>

Search file contents for a literal text pattern.

Binary files (determined by MIME type) are skipped.

method
ls→ MaybePromise<LsResult>

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→ MaybePromise<ReadResult>

Read file content.

For text files, content is paginated by line offset/limit. For binary files, the full raw Uint8Array content is returned.

method
readRaw→ MaybePromise<ReadRawResult>

Read file content as raw FileData.

method
write→ MaybePromise<WriteResult>

Write content to a file, creating it or overwriting it if it already exists.

Inherited fromBackendProtocolV2

Properties

PdownloadFiles: (paths: string[])PuploadFiles: (files: [string, Uint8Array<ArrayBufferLike>][])

Methods

Mdelete→ MaybePromise<DeleteResult>
—

Delete a single file.

Medit→ MaybePromise<EditResult>
—

Edit a file by replacing string occurrences.

Mglob→ MaybePromise<GlobResult>
—

Structured glob matching returning FileInfo objects.

Mgrep→ MaybePromise<GrepResult>
—

Search file contents for a literal text pattern.

Mls→ MaybePromise<LsResult>
—

Structured listing with file metadata.

Mread→ MaybePromise<ReadResult>
—

Read file content.

MreadRaw→ MaybePromise<ReadRawResult>
—

Read file content as raw FileData.

Mwrite→ MaybePromise<WriteResult>
—

Write content to a file, creating it or overwriting it if it already exists.

View source on GitHub