Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

domenic
Copy link
Collaborator

@domenic domenic commented Mar 19, 2025

See individual commits for details.

This is also intended to apply to the two specs in https://github.com/webmachinelearning/translation-api, so the language is somewhat generic (e.g. a lot of discussion of "these APIs"). As with many things in built-in AI, the split across 2-3 repositories is a bit awkward, and I'm choosing for now to centralize the shared stuff into the writing assistance APIs spec.

This won't build until I either eliminate some of the Storage Standard references or get them exported.I've worked around this for now.


Preview | Diff

@domenic domenic changed the title Add various privacy mitigations for download status Add privacy and security mitigations Mar 24, 2025
@domenic domenic force-pushed the user-activation branch 2 times, most recently from 5357735 to 1b85f8e Compare March 24, 2025 04:56
@domenic domenic force-pushed the user-activation branch 4 times, most recently from 112ac45 to 2f9c3bd Compare March 27, 2025 01:48
Copy link

@jyasskin jyasskin left a comment

Choose a reason for hiding this comment

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

Sorry that it took me so long to get to this. The privacy and security considerations look great! I left a bunch of small points, and I can't guarantee I'll have noticed everything, but this is a big improvement to the features' overall threat modeling.

domenic added a commit that referenced this pull request Apr 16, 2025
This reverts commit 6a198be.

This accidentally included a bunch of in-progress security and privacy work (#47) that had not yet been reviewed.
@nathanmemmott
Copy link

With the download masking, what are the possible states of after_create_availability:

// Assume we're in the "downloadable" state.
const before_create_availability = await AiAPI.availability();
assert_equals(before_create_availability, "downloadable");

const create_promise = AiAPI.create().then(()=>"model created first");
const after_create_availability_promise = AiAPI.availability();

const result = await Promise.race([create_promise, after_create_availability_promise]);

// Assume availability resolves first.
assert_not_equals(result, "model created first");
const after_create_availability = result;

Could it be "downloadable"? Or only "downloading"?

@domenic
Copy link
Collaborator Author

domenic commented Apr 21, 2025

I think it could be "downloadable". Once we go in-parallel, there's a race between determining the availability and starting the download. If starting the download loses that race, then compute AI model availability will get back "downloadable".

Additionally, even if the download has already started, download masking can censor "downloading" to "downloadable".

domenic added 6 commits April 23, 2025 10:53
* Require and consume user activation.
* Explicitly allow the user agent to show a prompt or download UI.
This includes a couple updates to the algorithms, for download status masking and avoiding actual download cancelation, plus extensive discussion of those mitigations and others in the new "Privacy considerations" section.

See webmachinelearning/translation-api#3 and webmachinelearning/translation-api#10.
@domenic domenic merged commit d921045 into main Apr 23, 2025
2 checks passed
@domenic domenic deleted the user-activation branch April 23, 2025 02:08
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.

3 participants