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
JavaScriptdeepagentspermissionsvalidatePath
Function●Since v1.15

validatePath

Canonicalize and validate an absolute path before permission checking.

Throws for:

  • Empty or non-string input
  • Non-absolute paths (must start with /)
  • Paths containing ..
  • Paths containing ~

Empty and . segments are dropped (/a/./b and /a//b become /a/b).

Copy
validatePath(raw: string): string

Parameters

NameTypeDescription
raw*string
View source on GitHub