Skip to main content
The GitHub channel lets a GitHub App send webhooks to your Managed Deep Agent. You declare handlers under channels/ (event filter + prompt), point the App webhook at your deployment, and the runtime verifies signatures, runs the agent, and can auto-reply as a pull request or issue comment.
Managed Deep Agents is in private beta, available on LangSmith Cloud in the US region only. Join the waitlist to request access.
For the channel model and current limits, see Channels. This page covers the channel (conversation ingress/egress). Use the GitHub connector for sandbox checkouts, or Connect-with-GitHub under identity for user OAuth.

Prerequisites

  • A Managed Deep Agents project with a root identity declaration (channels/ requires identity).
  • A GitHub App you control (customer-brought App), installed on the target org or repos.
  • Deploy or local Agent Server URL for the webhook (after first deploy, copy it from the LangSmith deployment dashboard).

Add a GitHub channel

Add channels/github.py or channels/github.ts next to your agent entry. The file name becomes the channel name (githubPOST /channels/github/events). Export a named channel created with define_github_channel / defineGitHubChannel. Handlers are ordered: the first match for a delivery wins. Each handler needs on and a prompt callback that builds the human message for that turn. The agent system prompt remains instructions.md.
Pair with a shared-bot (or equivalent) identity for channel-only installs. The channel actor is the installation/service principal github-app:<installationId>, not the pull request author. Replies use the App installation token—Connect-with-GitHub OAuth is not required for this path.

Event filters (on)

Any GitHub webhook event is accepted. Filter with on: Managed Deep Agents does not ship copies of GitHub webhook payload schemas. The envelope passes common routing fields (eventName / event_name, action, repository, issueOrPullNumber / issue_or_pull_number, …) and leaves the verified JSON on payload as untyped. In TypeScript, narrow with @octokit/webhooks-types. In Python, narrow with your own TypedDicts or runtime checks.

prompt vs instructions.md

How GitHub webhooks work

  1. GitHub POSTs to https://<agent-server>/channels/github/events (the file stem github becomes the path segment).
  2. The runtime verifies X-Hub-Signature-256 against GITHUB_WEBHOOK_SECRET, dedupes on X-GitHub-Delivery, and returns HTTP 202.
  3. It picks the first matching handler, calls prompt to build the inbound text, then invokes the graph over trusted loopback with actor and source-thread identity (source.provider: "github").
  4. When the matched handler has autoReply enabled and the conversation address is owner/repo#N, it posts the agent response as an issue/PR comment with the App installation token. Events without an issue/PR number skip the comment even when autoReply is true.
LangGraph auth is bypassed only on POST /channels/{name}/events so GitHub can deliver without an ingress secret; the loopback invoke still uses MDA_INGRESS_SECRET.

Channel options

Top-level option: Per-handler options (Python / TypeScript): Compile extracts only { on, repositories, autoReply } into the deploy manifest. Live prompt callbacks stay on the imported channel module.

Required secrets

Put these in the project .env (or LangSmith workspace secrets) before mda deploy. Deploy preflights each channel’s requiredEnv from the compiled manifest.

Configure the GitHub App

  1. Create a GitHub App (or reuse one you control) with permissions implied by your handlers (at minimum metadata:read; issues:write and pull_requests:read when any handler has autoReply enabled). Tighten App permissions in GitHub settings to match what you actually use.
  2. Subscribe the App to the webhook events your handlers need (for example Pull request for pull_request.opened, or broader events if you use "*" / event-level filters).
  3. Set the webhook URL to https://<agent-server>/channels/github/events and configure the webhook secret as GITHUB_WEBHOOK_SECRET.
  4. Install the App on the target org or repositories and copy the installation id into GITHUB_INSTALLATION_ID.
  5. Copy the App id and private key into GITHUB_APP_ID and GITHUB_APP_PRIVATE_KEY.

Deploy and smoke-test

  1. Put GitHub App secrets in .env and ensure identity is declared.
  2. Run mda deploy (or mda dev with a reachable webhook URL).
  3. Trigger a matching webhook (for example open a pull request on an allowed repository).
  4. Confirm the agent run appears in LangSmith and, when autoReply is true and the event has an issue/PR number, a comment appears.
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.

Troubleshooting

Next steps

Channels

See how channel discovery and Events ingress work.

Slack

Add a Slack Events channel alongside GitHub.

Identity

Choose identity presets for channel callers.

Deploy an agent

Route secrets and deploy the channel-enabled agent.