LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Caches
    • Callbacks
    • Documents
    • Document loaders
    • Embeddings
    • Exceptions
    • Language models
    • Serialization
    • Output parsers
    • Prompts
    • Rate limiters
    • Retrievers
    • Runnables
    • Utilities
    • Vector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-core_security_ssrf_protectionis_safe_url
    Function●Since v1.2

    is_safe_url

    Check if a URL is safe (non-throwing version of validate_safe_url).

    Copy
    is_safe_url(
      url: str | AnyHttpUrl,
      *,
      allow_private: bool = False,
      allow_http: bool = True
    ) -> bool

    Parameters

    NameTypeDescription
    url*str | AnyHttpUrl

    The URL to check

    allow_privatebool
    Default:False

    If True, allows private IPs and localhost

    allow_httpbool
    Default:True

    If True, allows both HTTP and HTTPS

    View source on GitHub