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.
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
Addchannels/github.py or channels/github.ts next to your agent entry. The file name becomes the channel name (github → POST /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.
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
- GitHub POSTs to
https://<agent-server>/channels/github/events(the file stemgithubbecomes the path segment). - The runtime verifies
X-Hub-Signature-256againstGITHUB_WEBHOOK_SECRET, dedupes onX-GitHub-Delivery, and returns HTTP 202. - It picks the first matching handler, calls
promptto build the inbound text, then invokes the graph over trusted loopback with actor and source-thread identity (source.provider: "github"). - When the matched handler has
autoReplyenabled and the conversation address isowner/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 whenautoReplyistrue.
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
- Create a GitHub App (or reuse one you control) with permissions implied by your handlers (at minimum
metadata:read;issues:writeandpull_requests:readwhen any handler hasautoReplyenabled). Tighten App permissions in GitHub settings to match what you actually use. - Subscribe the App to the webhook events your handlers need (for example
Pull requestforpull_request.opened, or broader events if you use"*"/ event-level filters). - Set the webhook URL to
https://<agent-server>/channels/github/eventsand configure the webhook secret asGITHUB_WEBHOOK_SECRET. - Install the App on the target org or repositories and copy the installation id into
GITHUB_INSTALLATION_ID. - Copy the App id and private key into
GITHUB_APP_IDandGITHUB_APP_PRIVATE_KEY.
Deploy and smoke-test
- Put GitHub App secrets in
.envand ensure identity is declared. - Run
mda deploy(ormda devwith a reachable webhook URL). - Trigger a matching webhook (for example open a pull request on an allowed repository).
- Confirm the agent run appears in LangSmith and, when
autoReplyistrueand the event has an issue/PR number, a comment appears.
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.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

