-
Notifications
You must be signed in to change notification settings - Fork 12
Description
In his talk, @cynthia raises the possible desirability of requiring permission before making ML APIs to developers:
Additionally while it is possible to do a lot of this without a permission as of today, through capabilities already available in the platform such as WebGL and WebAssembly, at the point of standardization as a platform API, we would like to see this behind the permission if possible. The reasons for this is not only due to the potential privacy implications, but also due to the power requirements that these APIs may bring to the table. This can have negative effects on the battery life for users who get out of a single charge. So we believe that the users should have a choice to reject if they are in a situation where they would want to be conservative about power usage.
I don't see any existing discussion in WebNN on permissions.
There are a number of usual questions when it comes to managing permissions in Web APIs:
- asking for user permission (which is tied to whether the permission can be formulated in a way that users can interpret)
- tying into the permission model exposed to developers via the Permissions API (which is tied but distinct from the above - not all permissions need to be obtained via a prompt)
- tying into the permission model for embedded content via Permissions Policy - which enables a Web page to allow or forbid whether an embedded iframe can use the said feature
As @cynthia points out, given that a number of the features exposed either by WebNN or indirectly by the Model Loader API can be at least partially polyfilled with WebAssembly, WebGL, WebGPU, there would be a need to at least align with how these other APIs manage that question.
Given that WebAssembly for instance seems to have broad use for user-hostile purposes there may be indeed value in bringing that community in for this conversation. I haven't found direct discussion of this issue in the WebAssembly repos, although there is a somewhat old discussion of the intersection with Content-Security Policy. @lukewagner @ericprud , has this topic been discussed in WebAssembly land?
With all that said, I believe there may be other approaches worth exploring to address (at least partially) the risks that @cynthia raises:
- an awareness indicator that these power-intensive APIs are being used (as is being done e.g. for mic/cameras)
- linking access to these APIs to the battery status (as exposed e.g. in the Battery Status API)
- tying this to Page Visibility; the Chrome team has been exploring the topic of how to handle throttling in background tabs which is probably worth taking into account in this context - I wonder if this is something @altimin might comment on