WebMCP: 2/N Permissions policy and cross-origin iframe tool support#59599
Merged
chromium-wpt-export-bot merged 1 commit intomasterfrom May 2, 2026
Merged
WebMCP: 2/N Permissions policy and cross-origin iframe tool support#59599chromium-wpt-export-bot merged 1 commit intomasterfrom
chromium-wpt-export-bot merged 1 commit intomasterfrom
Conversation
c87d05c to
537515b
Compare
This CL implements ModelContext's `getTools()` method, and integrates it with the permission policy work from https://crrev.com/c/7764073. The list of tools that the `getTools()` Promise resolves to is dictated by the `exposedTo` origins array for each tool in the tree. See [1] for more information. This involves a new IPC on LocalFrameHost: `GetScriptTools()` which returns an appropriately filtered list of tools suitable for the caller. Additionally, this CL adds a TON of tests. This CL does not include tests for the declarative API, those will come in a follow-up CL, to avoid bloating this one too much. Follow-up CLs will: - Remove `ModelContextTesting::listTools()` and update each test to use `getTools()` instead. - Implement cross-origin iframe tool *execution*. - This will involve exposing `WindowProxy` and `origin` on the `RegisteredTool` dictionary, which this CL avoids for now. [1]: https://docs.google.com/document/d/1ycdzuXA-VE8lRDFSArh0Um3PChHV0Hq6Om1MSMG8qPE/edit?tab=t.0#heading=h.jf7ic73cjbv R=mfoltz Bug: 506393880,489045948 Change-Id: I8af48097f48aa38e3d1b885e4c6910157c82d854 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7800264 Commit-Queue: Dominic Farolino <dom@chromium.org> Reviewed-by: Mark Foltz <mfoltz@chromium.org> Reviewed-by: Alex Moshchuk <alexmos@chromium.org> Cr-Commit-Position: refs/heads/main@{#1624230}
537515b to
00023ee
Compare
wpt-pr-bot
approved these changes
May 2, 2026
Collaborator
wpt-pr-bot
left a comment
There was a problem hiding this comment.
The review process for this patch is being conducted in the Chromium project.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This CL implements ModelContext's
getTools()method, and integrates itwith the permission policy work from https://crrev.com/c/7764073. The
list of tools that the
getTools()Promise resolves to is dictated bythe
exposedToorigins array for each tool in the tree. See 1 formore information. This involves a new IPC on LocalFrameHost:
GetScriptTools()which returns an appropriately filtered list of toolssuitable for the caller.
Additionally, this CL adds a TON of tests. This CL does not include
tests for the declarative API, those will come in a follow-up CL, to
avoid bloating this one too much.
Follow-up CLs will:
ModelContextTesting::listTools()and update each test touse
getTools()instead.WindowProxyandoriginon theRegisteredTooldictionary, which this CL avoids for now.R=mfoltz
Bug: 506393880,489045948
Change-Id: I8af48097f48aa38e3d1b885e4c6910157c82d854
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7800264
Commit-Queue: Dominic Farolino <dom@chromium.org>
Reviewed-by: Mark Foltz <mfoltz@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1624230}