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
JavaScriptdeepagentsindexFilesystemMiddlewareOptions
Interface●Since v1.4

FilesystemMiddlewareOptions

Copy
interface FilesystemMiddlewareOptions

Properties

View source on GitHub
property
backend: AnyBackendProtocol | BackendFactory

Backend instance or factory (default: StateBackend)

property
customToolDescriptions: Record<string, string> | null

Optional custom tool descriptions override

property
humanMessageTokenLimitBeforeEvict: number | null

Optional token limit before evicting a HumanMessage to the filesystem (default: 50000 tokens, ~200KB)

property
permissions: FilesystemPermission[]

Filesystem permission rules enforced on every tool call.

Rules are evaluated in declaration order; first match wins; permissive default. Applies to ls, read_file, write_file, edit_file, glob, and grep.

Note on execute: permissions are not enforced on execute because shell commands can access any path regardless of path-based rules. Using permissions with an execution-capable backend (one where isSandboxBackend returns true) throws a ConfigurationError unless the backend is a CompositeBackend and every permission path is scoped to a route prefix.

When omitted or empty, all filesystem operations are permitted.

property
systemPrompt: string | null

System prompt override. Set to null to disable. Defaults to ASYNC_TASK_SYSTEM_PROMPT.

property
toolTokenLimitBeforeEvict: number | null

Optional token limit before evicting a tool result to the filesystem (default: 20000 tokens, ~80KB)

Options for creating filesystem middleware.