LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • MCP Adapters
    Standard Tests
    Text Splitters
    • Overview
    • Agents
    • Callbacks
    • Chains
    • Chat models
    • Embeddings
    • Evaluation
    • Globals
    • Hub
    • Memory
    • Output parsers
    • Retrievers
    • Runnables
    • LangSmith
    • Storage
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    MCP Adapters
    Standard Tests
    Text Splitters
    OverviewAgentsCallbacksChainsChat modelsEmbeddingsEvaluationGlobalsHubMemoryOutput parsersRetrieversRunnablesLangSmithStorage
    Language
    Theme
    Pythonlangchain-classichubpull
    Function●Since v1.0Deprecated

    pull

    Copy
    pull(
      owner_repo_commit: str,
      *,
      include_model: bool | None = None,
      api_url: str
    View source on GitHub
    |
    None
    =
    None
    ,
    api_key
    :
    str
    |
    None
    =
    None
    )
    ->
    Any

    Parameters

    NameTypeDescription
    owner_repo_commit*str

    The full name of the prompt to pull from in the format of owner/prompt_name:commit_hash or owner/prompt_name or just prompt_name if it's your own prompt.

    include_modelbool | None
    Default:None

    Whether to include the model configuration in the pulled prompt. When True, the model declared by the prompt is also deserialized.

    api_urlstr | None
    Default:None

    The URL of the LangChain Hub API. Defaults to the hosted API service if you have an API key set, or a localhost instance if not.

    api_keystr | None
    Default:None

    Pull an object from the hub and returns it as a LangChain object.

    Hub manifests are untrusted input

    Treat every prompt pulled from the hub as untrusted, regardless of the owner. Public prompts authored by other users are obviously external content, but prompts from your own account — or your organization's account — are also unsafe if that account, a teammate's account, or the upstream prompt has been compromised. A single malicious commit to a prompt your code pulls is enough to execute attacker-controlled configuration on every machine that runs pull().

    pull() deserializes the manifest via load(), so the langchain_core.load.load threat model applies — a manifest can intentionally configure a model with a custom base URL, headers, model name, or other constructor arguments. These are supported features, but they also mean the prompt contents are executable configuration rather than plain text: a compromised prompt can redirect API traffic, inject headers, or trigger arbitrary code paths in the classes it instantiates.

    Prefer the LangSmith SDK directly. If you must use pull(), pin the commit hash, audit the manifest before deserializing, and never run it against an account whose access controls you cannot vouch for.

    The API key to use to authenticate with the LangChain Hub API.