Skip to content

Toolchange event and permissions policy#179

Merged
domfarolino merged 11 commits into
mainfrom
toolchange-event-and-permissions-policy
May 20, 2026
Merged

Toolchange event and permissions policy#179
domfarolino merged 11 commits into
mainfrom
toolchange-event-and-permissions-policy

Conversation

@domfarolino

@domfarolino domfarolino commented May 19, 2026

Copy link
Copy Markdown
Collaborator

This PR contributes to the following issues:

So far this PR only works on the registerTool() API, bringing it up to speed with the web platform tests in https://github.com/web-platform-tests/wpt/tree/master/webmcp/imperative. Subsequent PRs will introduce the getTools() and executeTool(), to fully close the above issues.

This PR introduces:

  • registerTool() changes:
    • The exposeTo origin list as a tool registration option
    • Scheme checks for https exposed origins; an exception is thrown otherwise
    • Permissions policy check
  • The toolchange event name
  • The "notify documents of a tool change" algorithm which fires toolchange in all documents in the tree that a tool changes in, in order
  • Renames the "tool calling task source" to "webmcp task source", to reflect the fact that the entire spec will use this not just for tool calling
    • Also adds an example of scheduling guarantees
  • The "tools" permissions policy
  • Notification of toolchange in unregistration algorithm.

This PR does not introduce the "*" or "native-agent" keywords that we've proposed, to control a tool's exposure to the built-in agent. That will also be considered in a follow-up.


Preview | Diff

@domfarolino domfarolino requested a review from bwalderman May 19, 2026 14:06
Comment thread index.bs Outdated
Comment thread index.bs Outdated
Comment thread index.bs Outdated
Comment thread index.bs Outdated
Comment thread index.bs Outdated
Comment thread index.bs
Comment thread index.bs
Comment thread index.bs
@domfarolino

Copy link
Copy Markdown
Collaborator Author

Since this PR matches the Chromium behavior and web platform tests I wrote, I'll go ahead and land this. Thanks for the review @beaufortfrancois.

@domfarolino domfarolino merged commit a816d2e into main May 20, 2026
2 checks passed
@domfarolino domfarolino deleted the toolchange-event-and-permissions-policy branch May 20, 2026 11:50
github-actions Bot added a commit that referenced this pull request May 20, 2026
…179)

SHA: a816d2e
Reason: push, by domfarolino

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
beckysiegel pushed a commit to chromium/chromium that referenced this pull request May 24, 2026
This CL brings Blink up to date with
webmachinelearning/webmcp#179, by:
 - Supporting potentially-trustworthy *origins* (not URLs) in
   `exposedTo`, closing https://crbug.com/509983801
 - Changing the ordering of `exposedTo` process with respect to
   `options.signal` processing
 - Using `NotAllowedError` instead of `SecurityError` when the `tools`
   permission is not present. (Subsequent spec PRs and impl CLs will do
   this for `getTools()` and `executeTool()`).

R=mfoltz

Bug: 489045948,509983801
Change-Id: I42d915412a7ef1881c4fa35fe63870979d739921
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7863576
Reviewed-by: Mark Foltz <mfoltz@chromium.org>
Commit-Queue: Dominic Farolino <dom@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Mark Pearson <mpearson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1635540}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request May 24, 2026
This CL brings Blink up to date with
webmachinelearning/webmcp#179, by:
 - Supporting potentially-trustworthy *origins* (not URLs) in
   `exposedTo`, closing https://crbug.com/509983801
 - Changing the ordering of `exposedTo` process with respect to
   `options.signal` processing
 - Using `NotAllowedError` instead of `SecurityError` when the `tools`
   permission is not present. (Subsequent spec PRs and impl CLs will do
   this for `getTools()` and `executeTool()`).

R=mfoltz

Bug: 489045948,509983801
Change-Id: I42d915412a7ef1881c4fa35fe63870979d739921
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7863576
Reviewed-by: Mark Foltz <mfoltz@chromium.org>
Commit-Queue: Dominic Farolino <dom@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Mark Pearson <mpearson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1635540}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request May 24, 2026
This CL brings Blink up to date with
webmachinelearning/webmcp#179, by:
 - Supporting potentially-trustworthy *origins* (not URLs) in
   `exposedTo`, closing https://crbug.com/509983801
 - Changing the ordering of `exposedTo` process with respect to
   `options.signal` processing
 - Using `NotAllowedError` instead of `SecurityError` when the `tools`
   permission is not present. (Subsequent spec PRs and impl CLs will do
   this for `getTools()` and `executeTool()`).

R=mfoltz

Bug: 489045948,509983801
Change-Id: I42d915412a7ef1881c4fa35fe63870979d739921
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7863576
Reviewed-by: Mark Foltz <mfoltz@chromium.org>
Commit-Queue: Dominic Farolino <dom@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Mark Pearson <mpearson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1635540}
lando-worker Bot pushed a commit to mozilla-firefox/firefox that referenced this pull request May 29, 2026
…he spec, a=testonly

Automatic update from web-platform-tests
WebMCP: Update registerTool() to match the spec

This CL brings Blink up to date with
webmachinelearning/webmcp#179, by:
 - Supporting potentially-trustworthy *origins* (not URLs) in
   `exposedTo`, closing https://crbug.com/509983801
 - Changing the ordering of `exposedTo` process with respect to
   `options.signal` processing
 - Using `NotAllowedError` instead of `SecurityError` when the `tools`
   permission is not present. (Subsequent spec PRs and impl CLs will do
   this for `getTools()` and `executeTool()`).

R=mfoltz

Bug: 489045948,509983801
Change-Id: I42d915412a7ef1881c4fa35fe63870979d739921
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7863576
Reviewed-by: Mark Foltz <mfoltz@chromium.org>
Commit-Queue: Dominic Farolino <dom@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Mark Pearson <mpearson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1635540}

--

wpt-commits: 2f79718126841d68bf361edc9318123d82013ed7
wpt-pr: 60095
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Jun 1, 2026
…he spec, a=testonly

Automatic update from web-platform-tests
WebMCP: Update registerTool() to match the spec

This CL brings Blink up to date with
webmachinelearning/webmcp#179, by:
 - Supporting potentially-trustworthy *origins* (not URLs) in
   `exposedTo`, closing https://crbug.com/509983801
 - Changing the ordering of `exposedTo` process with respect to
   `options.signal` processing
 - Using `NotAllowedError` instead of `SecurityError` when the `tools`
   permission is not present. (Subsequent spec PRs and impl CLs will do
   this for `getTools()` and `executeTool()`).

R=mfoltz

Bug: 489045948,509983801
Change-Id: I42d915412a7ef1881c4fa35fe63870979d739921
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7863576
Reviewed-by: Mark Foltz <mfoltzchromium.org>
Commit-Queue: Dominic Farolino <domchromium.org>
Reviewed-by: Alex Moshchuk <alexmoschromium.org>
Reviewed-by: Mark Pearson <mpearsonchromium.org>
Cr-Commit-Position: refs/heads/main{#1635540}

--

wpt-commits: 2f79718126841d68bf361edc9318123d82013ed7
wpt-pr: 60095

UltraBlame original commit: 23c843485bd210c6ddb843f94d99d3234b611de7
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Jun 1, 2026
…he spec, a=testonly

Automatic update from web-platform-tests
WebMCP: Update registerTool() to match the spec

This CL brings Blink up to date with
webmachinelearning/webmcp#179, by:
 - Supporting potentially-trustworthy *origins* (not URLs) in
   `exposedTo`, closing https://crbug.com/509983801
 - Changing the ordering of `exposedTo` process with respect to
   `options.signal` processing
 - Using `NotAllowedError` instead of `SecurityError` when the `tools`
   permission is not present. (Subsequent spec PRs and impl CLs will do
   this for `getTools()` and `executeTool()`).

R=mfoltz

Bug: 489045948,509983801
Change-Id: I42d915412a7ef1881c4fa35fe63870979d739921
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7863576
Reviewed-by: Mark Foltz <mfoltzchromium.org>
Commit-Queue: Dominic Farolino <domchromium.org>
Reviewed-by: Alex Moshchuk <alexmoschromium.org>
Reviewed-by: Mark Pearson <mpearsonchromium.org>
Cr-Commit-Position: refs/heads/main{#1635540}

--

wpt-commits: 2f79718126841d68bf361edc9318123d82013ed7
wpt-pr: 60095

UltraBlame original commit: 23c843485bd210c6ddb843f94d99d3234b611de7
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Jun 1, 2026
…he spec, a=testonly

Automatic update from web-platform-tests
WebMCP: Update registerTool() to match the spec

This CL brings Blink up to date with
webmachinelearning/webmcp#179, by:
 - Supporting potentially-trustworthy *origins* (not URLs) in
   `exposedTo`, closing https://crbug.com/509983801
 - Changing the ordering of `exposedTo` process with respect to
   `options.signal` processing
 - Using `NotAllowedError` instead of `SecurityError` when the `tools`
   permission is not present. (Subsequent spec PRs and impl CLs will do
   this for `getTools()` and `executeTool()`).

R=mfoltz

Bug: 489045948,509983801
Change-Id: I42d915412a7ef1881c4fa35fe63870979d739921
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7863576
Reviewed-by: Mark Foltz <mfoltzchromium.org>
Commit-Queue: Dominic Farolino <domchromium.org>
Reviewed-by: Alex Moshchuk <alexmoschromium.org>
Reviewed-by: Mark Pearson <mpearsonchromium.org>
Cr-Commit-Position: refs/heads/main{#1635540}

--

wpt-commits: 2f79718126841d68bf361edc9318123d82013ed7
wpt-pr: 60095

UltraBlame original commit: 23c843485bd210c6ddb843f94d99d3234b611de7
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.

2 participants