Tool Gateway is in beta.
Who needs a verify page
Only OAuth connect links for the following users can use a verify page:- Users identified by your backend: Your backend calls with a service key and identifies the user in
X-LangSmith-Identity. - Users of your identity provider: The call carries the user’s access token from the identity provider linked to the workspace.
How a connect link works
An eligible OAuth connect link opens a LangSmith page that shows the provider and the intended user. Opening the page does not use the link, so chat previews do not consume it. Only the first browser to click Continue can finish the sign-in. What happens next depends on whether the workspace has a verify page:- Without a verify page: The browser goes straight to the provider. If someone else uses the link and signs in, LangSmith links their provider account to the intended user. Tool calls for that user then use the wrong account.
- With a verify page: The browser goes to your verify page. Your app identifies the signed-in user and asks LangSmith to confirm that they are the intended user. Only after confirmation does the browser continue to the provider.
Set the verify page
Each workspace has one verify page URL. Viewing the setting in the UI requires theworkspaces:read and workspaces:credentials:read-metadata permissions. Changing or removing the URL also requires the workspaces:credentials:manage permission.
The URL must be an absolute https URL of up to 2048 bytes. It cannot contain user info, a fragment, or a session_id query parameter. LangSmith preserves any other query parameters when it redirects to your page.
- UI
- API
To configure the verify page in LangSmith:
- Go to Settings > Workspace, and select Agent Connections under Integrations.
- Open the Connect Links tab.
- In the Verify Page row, click Set up.
- In the Set Up Verify Page dialog, enter the Verify Page URL, then click Save verify page.
Build the verify page
When the user clicks Continue, LangSmith sends a303 redirect to your verify page with session_id=<uuid> in the query string. In your verify page handler:
- Read
session_idand reject it if it is not a UUID. - Identify the user signed in to your app. If no one is signed in, prompt the user to sign in, then return them to the verify page with the original query string.
- From your backend, confirm the user with LangSmith.
- Act on the response: redirect the browser to the LangSmith resume URL or show an error.
409, and the user needs a new link.
Confirm the signed-in user
SendPOST /v1/agent-auth/oauth-authorization-sessions/<session-id>/confirmation with no body and these headers:
X-Api-Key: A service key with theworkspaces:credentials:useoragent-auth-credentials:usepermission.X-Tenant-Id: The workspace ID.- The signed-in user:
X-LangSmith-IdentityorX-Agent-Auth-Principal-Authorization, as the following examples show.
X-LangSmith-Identity with the same value your backend sends on Tool Gateway calls for that user, or the user’s principal ID:
X-Agent-Auth-Principal-Authorization instead:
Authorization header that carries the same token on Tool Gateway calls.
Act on the response
The confirmation status determines what your page does next:
The returned
url is a single-use LangSmith resume URL, not the provider sign-in URL. It starts provider sign-in only in the browser that clicked Continue. Error responses use problem details JSON. The detail field describes the error.
Example
Add the verify route to your app server using Starlette for Python or Hono for TypeScript. Both examples read these environment variables:LANGSMITH_ENDPOINT: The LangSmith API URL for your region, such ashttps://api.smith.langchain.com. See Base URL.LANGSMITH_API_KEY: The service key for the confirmation request.LANGSMITH_WORKSPACE_ID: The workspace ID.
myapp:<user-id>. Replace myapp with the prefix your backend sends on Tool Gateway calls. For users of your identity provider, send X-Agent-Auth-Principal-Authorization with the user’s access token instead of X-LangSmith-Identity.
Handle a user mismatch
If the signed-in user does not match the intended user, or Agent Auth does not recognize the identity you sent, the confirmation request returns403. The detail is the user is not the session's owner. LangSmith stops the flow before provider sign-in and marks the session as failed with error_code set to user_mismatch.
Tell the user that the link belongs to someone else. Do not offer to retry the failed session. Get a new connect link for the intended user the same way your app got the first one.
To check for a mismatch from your backend, send GET /v1/agent-auth/oauth-authorization-sessions/<session-id> using the session_id from the verify page. Reading a user-owned session requires workspaces:read or workspaces:credentials:read-metadata. If you send an identity provider token, it must match the session owner. Check whether error_code is user_mismatch.
Troubleshoot
The confirmation request returns these errors:
LangSmith also shows errors on its own pages:
- The link does not work (
404): Check that the user opened the full link. If it still does not work, ask for a new link. - The link expired or was already used (
410): The user needs a new link. - The link was continued in another browser (
409): Finish in the browser that clicked Continue, or ask for a new link.
See also
Connect these docs to your agent of choice via MCP for real-time answers.

