Skip to main content
LangSmith Engine reads your source code to diagnose issues and opens pull requests with proposed fixes. It connects to GitHub through a GitHub App. This page covers connecting repositories in LangSmith Cloud and configuring your own GitHub App for a self-hosted deployment.

LangSmith Cloud

In LangSmith Cloud, Engine connects through a LangChain-managed GitHub App. You do not create or configure an app yourself. To connect your repositories:
  1. In the LangSmith console, open a tracing project and go to the Engine tab.
  2. Under Connect your agent’s code repository, click Connect GitHub and authorize the LangChain-managed GitHub App.
  3. Install the app on the repositories Engine should access. Installing the app on a GitHub organization may require approval from a GitHub organization owner. If you are not an owner, GitHub sends the owner an installation request to approve before the app becomes available.
  4. Select the connected repository in the GitHub Repository field on the Engine tab.
For the access and retention model of the managed app, see Engine security.

Self-hosted

In a self-hosted deployment, you create and manage your own GitHub App and pass its credentials to the LangSmith Helm chart.

Create a GitHub App

1

Create the app

Go to GitHub Settings > Developer settings > GitHub Apps and click New GitHub App.
  • GitHub App name: Any unique name, for example acme-langsmith-engine.
  • Homepage URL: Your LangSmith deployment URL, for example https://langsmith.example.com.
  • Where can this GitHub App be installed?: For most self-hosted deployments, select Only on this account. Select Any account only if you intend to distribute the app.
2

Set the callback URL

Add the following Callback URL, replacing <langsmith-host> with your LangSmith hostname:
3

Set the webhook URL and secret

Generate a random webhook secret of at least 32 bytes with your secret manager or another cryptographically secure generator. Use the same value in GitHub and your LangSmith secret store.Under Webhook, select Active and set the Webhook URL, replacing <langsmith-host> with your LangSmith hostname:
Paste the generated value into Webhook secret.
4

Set repository permissions

Under Permissions > Repository permissions, grant the following:
  • Contents: Read and write.
  • Pull requests: Read and write.
  • Metadata: Read-only (automatically selected).
Under Subscribe to events, select no events. Engine does not require any event subscriptions.
5

Create the app and gather its values

Click Create GitHub App. GitHub supplies the following values on the app settings page:
6

Generate a state JWT secret

LangSmith signs short-lived OAuth state tokens with an HMAC key. Generate a random secret of at least 32 bytes with your secret manager or another cryptographically secure generator. GitHub does not provide this value.This is FORGE_GITHUB_STATE_JWT_SECRET. Generate it separately, and do not reuse the webhook secret or any other credential.
7

Create a Kubernetes Secret

With your existing secret-management workflow, create a Kubernetes Secret named langsmith-forge-github with these keys:Do not put these values in Helm values or command-line arguments. For production deployments, use your existing secrets workflow, such as Sealed Secrets or External Secrets Operator. See Use an existing secret for more.
8

Add the configuration to your langsmith_config.yaml

Add the following to hostBackend.deployment.extraEnv in your langsmith_config.yaml. Reference the sensitive values with secretKeyRef; never set them through commonEnv or as inline values:
Then apply the updated chart:
9

Install the app on repositories

Once pods are healthy, install the GitHub App on the repositories Engine should access:
  1. Open the app’s public link (FORGE_GITHUB_APP_PUBLIC_LINK) and click Install, or open Settings > Applications > GitHub Apps in your GitHub organization.
  2. Select the repositories Engine should access. If the installation does not grant access to all repositories, explicitly select each private repository Engine needs.
  3. In LangSmith, open a tracing project, go to the Engine tab, and select the repository in the GitHub Repository field.

See also