Backport of 'Pre-approve GitLab MCP server read tools in the token claim'

What does this MR do and why?

Backport of !247872 (merged), which fixes #607151: tools served by GitLab's own MCP server ask for approval on every call.

The Duo Workflow Service treats the tool_access_policies claim's allow list as a ceiling. Once the claim is present it replaces the pre-approved list Workhorse sent, so a tool missing from the claim prompts for approval even though Workhorse marked it pre-approved. 19.2 already carries the Orbit half via !247676 (merged), so Orbit tools are in the claim while GitLab's own MCP tools are not, and all of them prompt.

Names are emitted with the gitlab_ prefix because Workhorse addresses MCP server tools as gitlab_<tool>, the way Orbit tools are orbit_<tool>. A bare name does not match the tool the agent holds.

Adapted rather than cherry-picked. The claim list is derived (GITLAB_PREAPPROVED_TOOLS minus GITLAB_TOOL_ALIASES) rather than hardcoded, so it picks up this branch's Workhorse list rather than master's. That yields 14 names here where master has 15, because list_wiki_pages is not in 19.2's list. Two spec expectations also differ from master on purpose: AGENTIC_CHAT_DEFINITION is only 'chat' on this branch, so the agentic_chat/v1 definition does not enable the GitLab MCP server and contributes no gitlab_ names.

Verified on this branch: 106 examples, 0 failures. RuboCop clean.

Deliberately omitted: the ask_tools hunk from !247570 (merged). ResolutionService on this branch references Permissions:: zero times, so the constants that hunk relies on do not exist here, and nothing consumes ask_tools either. I also checked that none of the names we append collides with the governable names as they are emitted, so subtracting them would be a no-op regardless. Same call !247676 (merged) made.

Related to !247872 (merged), !247676 (merged)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

  • This MR is backporting a bug fix, documentation update, or spec fix, previously merged in the default branch.
  • The MR that fixed the bug on the default branch has been deployed to GitLab.com (not applicable for documentation or spec changes).
  • The MR title is descriptive (e.g. "Backport of 'title of default branch MR'"). This is important, since the title will be copied to the patch blog post.
  • Required labels have been applied to this merge request
  • This MR has been approved by a maintainer (only one approval is required).
  • Ensure the e2e:test-on-omnibus-ee job has succeeded, or if it has failed, investigate the failures. If you determine the failures are unrelated, you may proceed. If you need assistance investigating, request help in the #s_developer_experience Slack channel to confirm the failures are unrelated to the merge request.

Note to the merge request author and maintainer

If you have questions about the patch release process, please:

Edited by Huzaifa Iftikhar

Merge request reports

Loading