Skip to content

Conversation

@omgitsads
Copy link
Member

Summary

Tools that return user generated content should have open world hints, to allow clients to inform users that the content may be untrusted and prompt them to approve the request before executing it.

Why

Addresses https://github.com/github/copilot-agent-services/issues/1103

What changed

  • Added openWorldHint annotations for tools with user generated content in the response.

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
  • New tool added

Adds annotations to pretty much all Read Only tools, since in some form they will have user generated content in the API result.

Security / limits

  • No security or limits impact
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

Tool renaming

  • I am renaming tools as part of this PR (e.g. a 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
  • Tested locally with ./script/test

Docs

  • Not needed
  • Updated (README / docs / examples)

Tools that return user generated content should have open world hints,
to allow clients to inform users that the content may be untrusted and
prompt them to approve the request before executing it.
@omgitsads omgitsads requested a review from a team as a code owner December 30, 2025 12:48
Copilot AI review requested due to automatic review settings December 30, 2025 12:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds openWorldHint annotations to read-only tools that return user-generated content, allowing MCP clients to inform users that the content may be untrusted and prompt them for approval before executing the tool.

Key Changes

  • Added OpenWorldHint: jsonschema.Ptr(true) to tool annotations for approximately 60+ read-only tools across the codebase
  • Updated tool snapshots to reflect the new annotation in the JSON schema
  • Reformatted annotations for consistent alignment (Title, ReadOnlyHint, OpenWorldHint fields)

Reviewed changes

Copilot reviewed 112 out of 112 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/github/actions.go Added openWorldHint to workflow, run, job, and artifact listing/retrieval tools (11 tools)
pkg/github/code_scanning.go Added openWorldHint to code scanning alert retrieval tools (2 tools)
pkg/github/context_tools.go Added openWorldHint to user profile and team retrieval tools (3 tools)
pkg/github/dependabot.go Added openWorldHint to dependabot alert retrieval tools (2 tools)
pkg/github/discussions.go Added openWorldHint to discussion and comment retrieval tools (4 tools)
pkg/github/gists.go Added openWorldHint to gist listing and retrieval tools (2 tools)
pkg/github/git.go Added openWorldHint to repository tree retrieval tool (1 tool)
pkg/github/issues.go Added openWorldHint to issue retrieval and listing tools (4 tools)
pkg/github/labels.go Added openWorldHint to label retrieval tools (2 tools)
pkg/github/notifications.go Added openWorldHint to notification listing and retrieval tools (2 tools)
pkg/github/projects.go Added openWorldHint to project, field, and item retrieval tools (6 tools)
pkg/github/pullrequests.go Added openWorldHint to pull request retrieval and search tools (3 tools)
pkg/github/repositories.go Added openWorldHint to commit, branch, tag, release, and file retrieval tools (10 tools)
pkg/github/search.go Added openWorldHint to repository, code, user, and organization search tools (4 tools)
pkg/github/secret_scanning.go Added openWorldHint to secret scanning alert retrieval tools (2 tools)
pkg/github/security_advisories.go Added openWorldHint to security advisory listing and retrieval tools (4 tools)
pkg/github/toolsnaps/*.snap Updated 80+ snapshot files to reflect the new openWorldHint annotation in JSON schemas and reordered required fields for consistency

Copy link
Collaborator

@SamMorrowDrums SamMorrowDrums left a comment

Choose a reason for hiding this comment

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

Awesome, shame about the churn. I think maybe that's from json schema lib update possibly.

Had a couple of questions but I think good to merge and follow up after if needed. Pretty important to get this out, so don't want to delay it.

ReadOnlyHint: true,
Title: t("TOOL_LIST_PROJECTS_USER_TITLE", "List projects"),
ReadOnlyHint: true,
OpenWorldHint: jsonschema.Ptr(true),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can projects be open world? I think they might only be available inside paying orgs or enterprises although I could be wrong there.

ReadOnlyHint: true,
Title: t("TOOL_GET_PROJECT_USER_TITLE", "Get project"),
ReadOnlyHint: true,
OpenWorldHint: jsonschema.Ptr(true),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same question as list projects

Annotations: &mcp.ToolAnnotations{
Title: t("TOOL_LIST_PROJECT_FIELDS_USER_TITLE", "List project fields"),
ReadOnlyHint: true,
Title: t("TOOL_LIST_PROJECT_FIELDS_USER_TITLE", "List project fields"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similar question I think fields also only created by project admins and not sure public projects exist

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.

4 participants