Sitelet https://github.com/github/github-mcp-server/pull/3719
Skip to content

Add public agent automation tools - #3719

Merged
A-Georgiou merged 19 commits into
mainfrom
shaikhul-public-automation-mcp-stack
Nov 16, 2026
Merged

A-Georgiou merged 19 commits into
mainfrom
shaikhul-public-automation-mcp-stack

Conversation

@shaikhul

@shaikhul shaikhul commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds the Copilot Automation tools to the public MCP server, backed by GitHub's public REST API: seven read tools, create_automation, update_automation, delete_automation and run_automation. All eleven tools live in the non-default copilot_automations toolset and require the explicit agent_automations opt-in flag.

Why

Ports the hosted Copilot Automation tools to the open-source server so local and hosted users share one implementation (github/sweagentd#16692). This PR now contains the whole change in one place and supersedes #3723 (write tools) and #3724 (run tool). Automation group tools and the Copilot task status tool follow in separate PRs.

What changed

  • Read tools: automation list/get, revision list/get, available-tools and available-triggers catalogs, and repository configuration. Every repository-scoped tool requires explicit owner and repo.
  • Write tools: create_automation, partial update_automation (keeps explicit false values and empty arrays) and delete_automation, handling the API's 201 and 204 responses.
  • run_automation: manual-only event, optional context limited to 10,000 characters, handles 202 Accepted.
  • Mutations (create, update, delete, run) request MCP form acceptance bound to the exact request, expire after ten minutes and fail closed without request-state protection. Confirmation text shows the escaped target and field names, not request values. HTTP mode hides mutation tools when the multi-round-trip request-state key is unavailable, and read-only mode excludes them.
  • Rejects dot path segments and reserved automation route names before building requests, and sanitizes automation name display fields in text and structured responses.
  • Adds the non-default copilot_automations toolset and the agent_automations flag (allowlisted, not enabled by Insiders mode).
  • Adds the tools to the skills catalog coverage exemptions, since no bundled skill covers automation management yet.
  • Regenerated tool snapshots and documentation.

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed: with agent_automations off the tools are absent from listings and direct calls fail; mutations require an accepted MCP form bound to their exact arguments.
  • New tool added: eleven automation tools in the copilot_automations toolset, available only with agent_automations enabled.

Prompts tested (tool changes only)

  • Mocked tool-handler tests, not live model prompts: TestAgentAutomationReadTools, TestAgentAutomationWriteTools, and TestRunAutomation assert methods, paths, query strings, the API-version header, request bodies and responses.
  • Confirmation and safety: TestDeleteAutomationRequiresMatchingConfirmation, TestRunAutomationConfirmationBindsRequest, TestAutomationMutationsRequireFormElicitation, the request-state tests and the path-validation tests verify that declined, changed or unprotected requests send nothing.
  • TestAgentAutomationFeatureFlagAvailability verifies the tools stay hidden by default, in Insiders mode and outside the copilot_automations toolset, appear with the flag, and that read-only mode keeps only read tools.
  • No live GitHub write or automation run was performed; owner and repo were supplied explicitly.

Security / limits

  • No security or limits impact
  • Auth / permissions considered: requests use the authenticated GitHub REST client and repository scope; enabling the MCP flag grants no API access.
  • Data exposure, filtering, or token/size limits considered: confirmation messages never echo request values; run context is capped at 10,000 characters and forwarded unchanged (this is not prompt-injection sanitization). The server cannot attest that a human answered the MCP form, so clients must present elicitation to the user.

Tool renaming

  • I am renaming tools as part of this PR (e.g. as part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Note: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.

Lint & tests

  • Linted locally with ./script/lint: passed.
  • Tested locally with ./script/test: passed (go test -race ./...).
  • script/generate-docs leaves no drift.

Docs

  • Not needed
  • Updated (README / docs / examples): generated toolset and feature-flag documentation.

Comment thread pkg/github/agent_automations.go Outdated
return utils.NewToolResultError(fmt.Sprintf("GitHub agent automations returned unexpected status %d", httpResponse.StatusCode)), nil, nil
}

result := utils.NewToolResultText(string(response))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't make the suggested constructor swap. This tool already returns json.RawMessage as typed output, so modern MCP clients receive structured content; the inventory layer also renders JSON text for compatibility. There is no NewToolResultJSON helper here, and changing the result constructor alone would not turn attacker-controlled fields into trusted data or remove the text representation. I haven't added a robust output-trust boundary, so I'm leaving this thread open rather than claiming it's fixed.

@shaikhul
shaikhul marked this pull request as ready for review November 6, 2026 22:07
@shaikhul
shaikhul requested a review from a team as a code owner November 6, 2026 22:07
Copilot AI adaptive review requested due to automatic review settings November 6, 2026 22:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Reserved automation IDs can bypass configured tool exclusions, and automation names reach clients without display-text sanitization.

2 open issues
What changed in this PR

Adds seven read-only automation tools to the GitHub MCP Server’s copilot toolset, available only through explicit agent_automations opt-in.

Changes:

  • Adds repository automation, revision, catalog, and configuration reads.
  • Registers the tools behind a feature flag that Insiders mode does not enable automatically.
  • Adds handler tests, schema snapshots, and opt-in documentation.
File Description
README.md Links to feature-flag documentation.
pkg/​github/​tools.go Registers seven automation tools.
pkg/​github/​feature_flags.go Adds the public opt-in flag.
pkg/​github/​feature_flags_test.go Tests explicit opt-in and Insiders exclusion.
pkg/​github/​agent_automations.go Implements automation read tools and shared request handling.
pkg/​github/​agent_automations_test.go Tests handlers, availability, schemas, errors, and uncached configuration reads.
pkg/​github/​__toolsnaps__/​list_available_automation_triggers.snap Records the trigger catalog schema.
pkg/​github/​__toolsnaps__/​list_available_automation_tools.snap Records the tool catalog schema.
pkg/​github/​__toolsnaps__/​list_automations.snap Records listing inputs and output schema.
pkg/​github/​__toolsnaps__/​list_automation_revisions.snap Records revision pagination and output schema.
pkg/​github/​__toolsnaps__/​get_automations_configuration_for_repository.snap Records required configuration booleans.
pkg/​github/​__toolsnaps__/​get_automation.snap Records automation retrieval schema.
pkg/​github/​__toolsnaps__/​get_automation_revision.snap Records revision retrieval schema.
docs/​feature-flags.md Documents opt-in behavior and tool parameters.

Review effort: Balanced (auto)

Comment thread pkg/github/agent_automations.go Resolved
Comment thread pkg/github/agent_automations.go Resolved
if err != nil {
return utils.NewToolResultErrorFromErr("failed to sanitize GitHub agent automation response", err), nil, nil
}
return utils.NewToolResultText(string(sanitizedResponse)), sanitizedResponse, nil

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept the JSON text representation for clients that consume Content and the structured output for clients that consume typed data. Replacing the text with a fixed message would break the former, while attacker-controlled structured fields could still reach a model through clients that include structuredContent; changing the result constructor alone would not establish a trust boundary. The display-name sanitization is not content sanitization, and automation prompts/descriptions remain untrusted. I have not solved that broader client/data-boundary issue, so this stays open rather than claiming the suggested change would make the payload safe.

@omgitsads
omgitsads added this pull request to stack #3820 November 11, 2026 10:52
omgitsads
omgitsads previously approved these changes Nov 11, 2026
shaikhul and others added 5 commits November 15, 2026 23:35
Expose repository automation and revision reads plus the repository-scoped tool and trigger catalogs through the public REST API. Pin requests to the documented API version so these preview endpoints receive their published schemas.

Co-authored-by: Copilot App <[email protected]>
Keep the repository automation tool surface hidden unless users explicitly enable agent_automations, including in Insiders mode.

Co-authored-by: Copilot App <[email protected]>
Expose the repository's automation and trigger policies through the existing opt-in automation tool surface. Keep the read caller-specific by requesting it for every invocation.

Co-authored-by: Copilot App <[email protected]>
Reject path dot segments and reserved automation subroutes before building requests, and sanitize automation display names in the shared read response. Preserve identifiers, cursors, and prompt content.

Co-authored-by: Copilot App <[email protected]>
Register the repository automation tools in a dedicated, non-default
copilot_automations toolset instead of the default copilot toolset, matching
the toolset the remote server already uses for these tools. Using them now
requires --toolsets=copilot_automations (or all) alongside
--features=agent_automations.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: f921ed41-2ec0-4075-a572-7692f9529b7e
@A-Georgiou
A-Georgiou force-pushed the shaikhul-public-automation-mcp-stack branch from 4f0a5bd to 86c5186 Compare November 15, 2026 23:35
A-Georgiou and others added 14 commits November 15, 2026 23:38
The skills catalog now requires every registered tool to map to a bundled skill or carry an explicit exemption.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: f921ed41-2ec0-4075-a572-7692f9529b7e
Expose create, partial update, and delete operations for repository automations using GitHub's published REST fields and status codes.

Co-authored-by: Copilot App <[email protected]>
Bind the confirmation to the exact API request and reject missing, declined, mismatched, expired, or changed confirmations before sending a delete request.

Co-authored-by: Copilot App <[email protected]>
Show the exact create/update request details for explicit approval and bind confirmation to the request before sending mutations.

Co-authored-by: Copilot App <[email protected]>
Keep request values out of MCP confirmation messages so untrusted prompt text cannot steer the confirmation step. Show only escaped targets and field names, while preserving the original REST payload.

Co-authored-by: Copilot App <[email protected]>
Apply shared automation ID and repository path checks before confirming create, update, and delete requests so dot segments and reserved API routes cannot retarget writes.

Co-authored-by: Copilot App <[email protected]>
HTTP mode now excludes repository automation writes when the multi-round-trip request-state key is unavailable, matching the protected confirmation flow. Document the key requirement and cover inventory filtering.

Co-authored-by: Copilot App <[email protected]>
The skills catalog now requires every registered tool to map to a bundled skill or carry an explicit exemption.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: f921ed41-2ec0-4075-a572-7692f9529b7e
Starts a manual automation task through the repository-scoped REST endpoint and returns GitHub's accepted task response.

Co-authored-by: Copilot App <[email protected]>
Show the target and supplied context in MCP form elicitation, bind approval to the exact run request, and enforce the public API context length limit before submitting the task.

Co-authored-by: Copilot App <[email protected]>
Keep caller-controlled run context out of the MCP confirmation message while preserving the original task request. Show only its character count so untrusted instructions are not echoed into the approval prompt.

Co-authored-by: Copilot App <[email protected]>
Reject invalid and reserved path segments before requesting run confirmation. If the task endpoint accepts a request but returns no task body, report the HTTP status and advise verifying the outcome before retrying.

Co-authored-by: Copilot App <[email protected]>
Hide run_automation in HTTP mode when multi-round-trip request-state protection is unavailable, alongside the automation management mutations.

Co-authored-by: Copilot App <[email protected]>
The skills catalog now requires every registered tool to map to a bundled skill or carry an explicit exemption.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: f921ed41-2ec0-4075-a572-7692f9529b7e
@A-Georgiou
A-Georgiou removed this pull request from stack #3820 November 16, 2026 01:01
@A-Georgiou A-Georgiou changed the title Add public agent automation read tools Add public agent automation tools Nov 16, 2026
Comment thread pkg/github/copilot_task_status.go Dismissed
Comment thread pkg/github/agent_automations.go Dismissed
@A-Georgiou
A-Georgiou force-pushed the shaikhul-public-automation-mcp-stack branch from 197f417 to 5361370 Compare November 16, 2026 01:04
Comment thread pkg/github/agent_automations.go Dismissed
@A-Georgiou
A-Georgiou merged commit 67d4dc4 into main Nov 16, 2026
40 checks passed
@A-Georgiou
A-Georgiou deleted the shaikhul-public-automation-mcp-stack branch November 16, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants