Skip to content

feat: add sandbox callback verifier#2849

Draft
Ramon Nogueira (ramon-langchain) wants to merge 4 commits into
mainfrom
ramonn/sandbox-callback-verifier
Draft

feat: add sandbox callback verifier#2849
Ramon Nogueira (ramon-langchain) wants to merge 4 commits into
mainfrom
ramonn/sandbox-callback-verifier

Conversation

@ramon-langchain
Copy link
Copy Markdown
Member

@ramon-langchain Ramon Nogueira (ramon-langchain) commented May 5, 2026

Summary

Adds a Python SDK verifier for JWKS-signed LangSmith sandbox callback requests. The verifier resolves the LangSmith API URL and API key using normal SDK defaults, fetches and caches JWKS internally, fetches and caches the tenant ID when not supplied, and validates the JWT against the exact raw callback body.

The returned claims expose identity, parsed from the signed body hash, including tenant ID, organization ID, sandbox ID, and optional LangSmith user ID. The verifier requires an expected sandbox ID unless callers explicitly opt into unsafely_allow_any_sandbox_id=True.

Related PR:

Release Note

Add a sandbox callback verifier utility for Python applications receiving signed LangSmith sandbox callbacks.

Test Plan

  • uv run ruff format langsmith/sandbox/_callback_verifier.py langsmith/sandbox/__init__.py tests/unit_tests/sandbox/test_callback_verifier.py
  • uv run ruff check langsmith/sandbox/_callback_verifier.py tests/unit_tests/sandbox/test_callback_verifier.py langsmith/sandbox/__init__.py --fix
  • uv run mypy langsmith/sandbox/_callback_verifier.py
  • TEST=tests/unit_tests/sandbox/test_callback_verifier.py make tests

@ramon-langchain Ramon Nogueira (ramon-langchain) force-pushed the ramonn/sandbox-callback-verifier branch from 1e26e68 to 264f474 Compare May 5, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant