Skip to content

WebMCP: 2/N Permissions policy and cross-origin iframe tool support#59599

Merged
chromium-wpt-export-bot merged 1 commit intomasterfrom
chromium-export-cl-7800264
May 2, 2026
Merged

WebMCP: 2/N Permissions policy and cross-origin iframe tool support#59599
chromium-wpt-export-bot merged 1 commit intomasterfrom
chromium-export-cl-7800264

Conversation

@chromium-wpt-export-bot
Copy link
Copy Markdown
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented May 1, 2026

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.

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}

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-7800264 branch 2 times, most recently from c87d05c to 537515b Compare May 2, 2026 01:54
@chromium-wpt-export-bot chromium-wpt-export-bot marked this pull request as ready for review May 2, 2026 03:08
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}
Copy link
Copy Markdown
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

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

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 1055323 into master May 2, 2026
23 checks passed
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-7800264 branch May 2, 2026 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants