LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Client
  • AsyncClient
  • Run Helpers
  • Run Trees
  • Evaluation
  • Schemas
  • Utilities
  • Wrappers
  • Anonymizer
  • Testing
  • Expect API
  • Middleware
  • Pytest Plugin
  • Deployment SDK
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDK
Language
Theme
Pythonlangsmithsandbox_verifySandboxTokenVerifierverify_user_token
Method●Since v0.14

verify_user_token

Copy
verify_user_token(
  self,
  token: str,
  *,
  audience: str,
  issuer: Optional[str
View source on GitHub
]
=
None
)
->
SandboxUser

Parameters

NameTypeDescription
token*str
audience*str
issuerOptional[str]
Default:None

Verify the X-Langsmith-User-Token header of a service URL request.

LangSmith sets this header only for service URLs that use LangSmith login. Code that knows it is running in a sandbox can instead trust the unsigned X-Langsmith-User-Id and X-Langsmith-User-Email headers, which the sandbox runtime strips from inbound requests and sets itself; verify this token when that is not guaranteed.

The header value.

The service URL host the request was sent to, such as request.headers["Host"]. A full service URL is also accepted.

If set, the LangSmith app URL the token must be issued by.