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
Copy link
Copy Markdown
Collaborator

@domfarolino domfarolino commented May 19, 2026

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}
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