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

Chat LangChain

What can I help with?

Enter to send·Shift+Enter new line

Menu

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentsnodeFilesystemBackendresolvePath
Method●Since v1.17

resolvePath

Resolve a file path with security checks.

When virtualMode=true, treat incoming paths as virtual absolute paths under this.cwd, disallow traversal (.., ~) and ensure resolved path stays within root. When virtualMode=false, preserve legacy behavior: absolute paths are allowed as-is; relative paths resolve under cwd.

Copy
resolvePath(key: string): string

Parameters

NameTypeDescription
key*string

File path (absolute, relative, or virtual when virtualMode=true)

View source on GitHub