-
Notifications
You must be signed in to change notification settings - Fork 25.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Complete security policy with mentions of remote code #29707
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,40 @@ | ||
# Security Policy | ||
|
||
## Hugging Face Hub, remote artefacts, and remote code | ||
|
||
Transformers is open-source software that is tightly coupled to the Hugging Face Hub. While you have the ability to use it | ||
offline with pre-downloaded model weights, it provides a very simple way to download, use, and manage models locally. | ||
|
||
When downloading artefacts that have been uploaded by others on any platform, you expose yourself to risks. Please | ||
read below for the security recommendations in order to keep your runtime and local environment safe. | ||
|
||
### Remote artefacts | ||
|
||
Models uploaded on the Hugging Face Hub come in different formats. We heavily recommend uploading and downloading | ||
models in the [`safetensors`](https://github.com/huggingface/safetensors) format (which is the default prioritized | ||
by the transformers library), as developed specifically to prevent arbitrary code execution on your system. | ||
|
||
To avoid loading models from unsafe formats(e.g. [pickle](https://docs.python.org/3/library/pickle.html), you should use the `use_safetenstors` parameter. If doing so, in the event that no .safetensors file is present, transformers will error when loading the model. | ||
|
||
### Remote code | ||
|
||
#### Modeling | ||
|
||
Transformers supports many model architectures, but is also the bridge between your Python runtime and models that | ||
are stored in model repositories on the Hugging Face Hub. | ||
|
||
These models require the `trust_remote_code=True` parameter to be set when using them; please **always** verify | ||
the content of the modeling files when using this argument. We recommend setting a revision in order to ensure you | ||
protect yourself from updates on the repository. | ||
|
||
#### Tools | ||
|
||
Through the `Agent` framework, remote tools can be downloaded to be used by the Agent. You're to specify these tools | ||
yourself, but please keep in mind that their code will be run on your machine if the Agent chooses to run them. | ||
|
||
Please inspect the code of the tools before passing them to the Agent to protect your runtime and local setup. | ||
|
||
## Reporting a Vulnerability | ||
|
||
馃 We have our bug bounty program set up with HackerOne. Please feel free to submit vulnerability reports to our private program at https://hackerone.com/hugging_face. | ||
馃 Please feel free to submit vulnerability reports to our private bug bounty program at https://hackerone.com/hugging_face. You'll need to request access to the program by emailing security@huggingface.co. | ||
Note that you'll need to be invited to our program, so send us a quick email at security@huggingface.co if you've found a vulnerability. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add a link to the function parameter that allows to pass a fixed revision
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All methods do :)