Skip to main content
The GitHub connector gives the agent two independent ways to work with GitHub:
  • Tools — GitHub is a tool server integration like Gmail or Linear, so the connector can load LangChain-authored GitHub API tools through LangSmith’s gateway. The provider token stays in LangSmith’s vault.
  • Sandbox — the connector also prepares repositories, the gh CLI, and credentials inside a managed sandbox, so the agent can inspect or change checkouts directly.
The GitHub connector requires managed-deepagents>=0.4.0.
Managed Deep Agents is in private beta, available on LangSmith Cloud in the US region only. Join the waitlist to request access.
This connector is separate from the GitHub channel, which receives App webhooks, and Connect-with-GitHub under identity.

Add the connector

Create connectors/github.py or connectors/github.ts and export a named connector:
The connector clones each repository when the sandbox is created. On reuse, on_reuse / onReuse controls whether it keeps, resets, or fetches the checkout. The default is fetch.

Tools and the installCLI rule

The two halves meet in exactly one rule: installCLI decides the default tool surface. With gh in the sandbox (the default), the agent already reaches the GitHub API, so the integration’s tool definitions stay off—adding them would be a second route to the same endpoints. Naming tools with include_tools / includeTools, or setting installCLI: false, turns them on. An explicit selection always wins, exclude_tools / excludeTools on its own included. That means a checkout-only project needs no tool config and no connected GitHub integration in the workspace—the gateway is never called:
Tool names are provider-qualified (github_create_pull_request), not prefixed. For how the gateway resolves credentials, see Tool server integrations.

Configure options

Repository paths must be relative and unique. Set write to true on a checkout that needs write credentials. For private repositories, configure GitHub credentials through identity. The runtime injects the resolved token as GH_TOKEN and configures Git credentials without storing it in thread state.

Test and deploy

Test the project locally with mda dev, then deploy it with mda deploy. Open deployment traces in LangSmith to inspect model calls, tool calls, errors, and latency. The sandbox half runs only when the project declares a managed sandbox. After startup, ask the agent to inspect the configured path or run gh auth status.

Next steps

Tool server integrations

See how LangSmith-hosted integration tools reach the agent.

Connectors

Compare connector types.

GitHub channel

Receive GitHub App webhooks.

Identity

Scope callers and resolve credentials.

Configure a sandbox

Configure sandbox scope and lifecycle.