Skip to content

Add privacy and security mitigations to the Web Speech API - #165

Open
evanbliu wants to merge 3 commits into
WebAudio:mainfrom
evanbliu:Privacy
Open

Add privacy and security mitigations to the Web Speech API#165
evanbliu wants to merge 3 commits into
WebAudio:mainfrom
evanbliu:Privacy

Conversation

@evanbliu

@evanbliu evanbliu commented Jun 17, 2025

Copy link
Copy Markdown
Collaborator

This PR adds the privacy and security mitigations used by the Writing Assistance APIs to the on-device speech recognition part of the Web Speech API.

Closes #158


Preview | Diff

@evanbliu
evanbliu requested a review from padenot June 17, 2025 17:45
@evanbliu

evanbliu commented Mar 4, 2026

Copy link
Copy Markdown
Collaborator Author

@padenot - I just realized this PR was never merged. Can you please take a look when you get a chance?

Comment thread index.bs Outdated
Comment thread index.bs Outdated
Comment thread index.bs Outdated
Comment thread index.bs Outdated
@evanbliu
evanbliu requested a review from marcoscaceres March 5, 2026 00:21
@evanbliu
evanbliu requested a review from hoch August 25, 2026 17:59

@hoch hoch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Mostly nits. Looking good!

Comment thread index.bs

Evicting downloads in response to user-controlled actions (e.g., via a browser settings UI) is not problematic.

<h5 id="on-device-model-privacy-availability-alternatives">Alternate Options</h5>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps I am missing something, but:

In the "Download Masking" section above, partitioning availability by [=storage key=] was made a normative must requirement in the latest commit. However, this section still frames storage key partitioning as an alternative option with trade-offs.

Should we update or remove this subsection so it doesn't contradict the mandatory partitioning requirement in the masking section?

Comment thread index.bs

* The {{SpeechRecognition/install()}} method both requires and consumes [=user activation=], when it would initiate a download.
* The {{SpeechRecognition/install()}} method allows the user agent to prompt the user for permission, or to implicitly reject download attempts based on previous signals (such as an observed pattern of abuse).
* Access to {{SpeechRecognition/install()}} and {{SpeechRecognition/available()}} is gated on an per-API [=policy-controlled feature=], which means that only top-level origins and their delegates can use the API.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

typo: an per-API -> a per-API

Comment thread index.bs

To prevent cross-origin fingerprinting and site collusion, user agents <strong>must</strong> partition language pack availability by [=storage key=]. User agents <strong>must</strong> mask the current download status by returning {{"downloadable"}} from {{SpeechRecognition/available()}} by default, even if the actual underlying language pack is {{"available"}} or {{"downloading"}} on the user's device.

This masking state is established for each (API, options, [=storage key=]) tuple. The user agent <strong>must only</strong> set the state to "unmasked" for a specific [=storage key=] after a web page within that key explicitly calls {{SpeechRecognition/install()}} with a given set of options, and successfully starts a download or the promise resolves to <code>true</code> (indicating the language pack is ready).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

formatting nit: <code>true</code> -> `true`

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.

Apply privacy and security mitigations used by the Web Translation API to the Web Speech API

4 participants