Skip to content

guard trust_remote_code#15065

Merged
dimapihtar merged 17 commits intomainfrom
dpykhtar/guard_trust_remote_code
Dec 3, 2025
Merged

guard trust_remote_code#15065
dimapihtar merged 17 commits intomainfrom
dpykhtar/guard_trust_remote_code

Conversation

@dimapihtar
Copy link
Collaborator

Important

The Update branch button must only be pressed in very rare occassions.
An outdated branch is never blocking the merge of a PR.
Please reach out to the automation team before pressing that button.

What does this PR do ?

Avoids direct usage of trust_remote_code=True for security reasons.
Introduces "safe list" of HF directories we can trust using trust_remote_code=True.
Introduces is_safe_repo function which handles trust_remote_code given by user & safe list of HF repos.

Collection: [Note which collection this PR will affect]

Changelog

  • Add specific line by line info of high level changes in this PR.

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to # (issue)

dimapihtar and others added 2 commits November 13, 2025 06:07
Signed-off-by: dimapihtar <dpihtar@gmail.com>
Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>
dimapihtar and others added 2 commits November 14, 2025 04:41
Signed-off-by: dimapihtar <dpihtar@gmail.com>
Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>
dimapihtar and others added 2 commits November 20, 2025 09:23
Signed-off-by: dimapihtar <dpihtar@gmail.com>
Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>
@github-actions github-actions bot removed the Run CICD label Nov 20, 2025
maanug-nv
maanug-nv previously approved these changes Nov 20, 2025
Signed-off-by: dimapihtar <dpihtar@gmail.com>
@dimapihtar
Copy link
Collaborator Author

/ok to test 0c6b4f7

ananthsub
ananthsub previously approved these changes Nov 21, 2025
dimapihtar and others added 2 commits November 26, 2025 13:57
dimapihtar and others added 3 commits December 2, 2025 06:05
Signed-off-by: dimapihtar <dpihtar@gmail.com>
Signed-off-by: dimapihtar <dpihtar@gmail.com>
Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>
maanug-nv
maanug-nv previously approved these changes Dec 3, 2025
Signed-off-by: dimapihtar <dpihtar@gmail.com>
@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

[🤖]: Hi @dimapihtar 👋,

We wanted to let you know that a CICD pipeline for this PR just finished successfully.

So it might be time to merge this PR or get some approvals.

//cc @chtruong814 @ko3n1g @pablo-garay @thomasdhc

@dimapihtar dimapihtar requested a review from maanug-nv December 3, 2025 18:38
@dimapihtar dimapihtar merged commit bdd08c8 into main Dec 3, 2025
996 of 1082 checks passed
@dimapihtar dimapihtar deleted the dpykhtar/guard_trust_remote_code branch December 3, 2025 18:39
quapham pushed a commit to quapham/NeMo that referenced this pull request Dec 16, 2025
* guard trust_remote_code

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* Apply isort and black reformatting

Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>

* fix import

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* Apply isort and black reformatting

Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>

* fix trust_remote_code logic

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* Apply isort and black reformatting

Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>

* fix unit tests

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* fix tests

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* fix multiple values issue

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* fix kwargs

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* revert changes

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* fix tests

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* revert changes

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* Apply isort and black reformatting

Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>

* fix tests

Signed-off-by: dimapihtar <dpihtar@gmail.com>

---------

Signed-off-by: dimapihtar <dpihtar@gmail.com>
Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>
Co-authored-by: dimapihtar <dimapihtar@users.noreply.github.com>
Signed-off-by: quanpham <youngkwan199@gmail.com>
@chtruong814 chtruong814 added the r2.6.0 Cherry-pick label for the r2.6.0 release branch label Jan 4, 2026
chtruong814 pushed a commit that referenced this pull request Jan 4, 2026
* guard trust_remote_code

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* Apply isort and black reformatting

Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>

* fix import

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* Apply isort and black reformatting

Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>

* fix trust_remote_code logic

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* Apply isort and black reformatting

Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>

* fix unit tests

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* fix tests

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* fix multiple values issue

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* fix kwargs

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* revert changes

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* fix tests

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* revert changes

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* Apply isort and black reformatting

Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>

* fix tests

Signed-off-by: dimapihtar <dpihtar@gmail.com>

---------

Signed-off-by: dimapihtar <dpihtar@gmail.com>
Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>
Co-authored-by: dimapihtar <dimapihtar@users.noreply.github.com>
Signed-off-by: Charlie Truong <chtruong@nvidia.com>
chtruong814 pushed a commit that referenced this pull request Jan 6, 2026
* guard trust_remote_code

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* Apply isort and black reformatting

Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>

* fix import

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* Apply isort and black reformatting

Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>

* fix trust_remote_code logic

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* Apply isort and black reformatting

Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>

* fix unit tests

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* fix tests

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* fix multiple values issue

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* fix kwargs

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* revert changes

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* fix tests

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* revert changes

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* Apply isort and black reformatting

Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>

* fix tests

Signed-off-by: dimapihtar <dpihtar@gmail.com>

---------

Signed-off-by: dimapihtar <dpihtar@gmail.com>
Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>
Co-authored-by: dimapihtar <dimapihtar@users.noreply.github.com>
Signed-off-by: Charlie Truong <chtruong@nvidia.com>
chtruong814 added a commit that referenced this pull request Jan 6, 2026
* guard trust_remote_code



* Apply isort and black reformatting



* fix import



* Apply isort and black reformatting



* fix trust_remote_code logic



* Apply isort and black reformatting



* fix unit tests



* fix tests



* fix multiple values issue



* fix kwargs



* revert changes



* fix tests



* revert changes



* Apply isort and black reformatting



* fix tests



---------

Signed-off-by: dimapihtar <dpihtar@gmail.com>
Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>
Signed-off-by: Charlie Truong <chtruong@nvidia.com>
Co-authored-by: Dmytro Pykhtar <37850217+dimapihtar@users.noreply.github.com>
Co-authored-by: dimapihtar <dimapihtar@users.noreply.github.com>
nune-tadevosyan pushed a commit to nune-tadevosyan/NeMo that referenced this pull request Mar 13, 2026
* guard trust_remote_code

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* Apply isort and black reformatting

Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>

* fix import

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* Apply isort and black reformatting

Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>

* fix trust_remote_code logic

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* Apply isort and black reformatting

Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>

* fix unit tests

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* fix tests

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* fix multiple values issue

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* fix kwargs

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* revert changes

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* fix tests

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* revert changes

Signed-off-by: dimapihtar <dpihtar@gmail.com>

* Apply isort and black reformatting

Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>

* fix tests

Signed-off-by: dimapihtar <dpihtar@gmail.com>

---------

Signed-off-by: dimapihtar <dpihtar@gmail.com>
Signed-off-by: dimapihtar <dimapihtar@users.noreply.github.com>
Co-authored-by: dimapihtar <dimapihtar@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

r2.6.0 Cherry-pick label for the r2.6.0 release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants