Add documentation comment warning to only load trusted models#7611
Open
svick wants to merge 1 commit into
Open
Add documentation comment warning to only load trusted models#7611svick wants to merge 1 commit into
svick wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds explicit XML documentation warnings across ML.NET model-loading/apply APIs to clarify the security assumption that models must come from trusted sources.
Changes:
- Added
<remarks>warnings to TensorFlow model loading APIs. - Added trusted-model warnings to ONNX
ApplyOnnxModeloverloads. - Added trusted-model warnings to core
ModelOperationsCatalog.Load*andPredictionEnginePoolBuildermodel-source helpers.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Microsoft.ML.TensorFlow/TensorflowCatalog.cs | Adds security warning remarks to LoadTensorFlowModel overloads. |
| src/Microsoft.ML.OnnxTransformer/OnnxCatalog.cs | Adds security warning text in <remarks> across ApplyOnnxModel overloads. |
| src/Microsoft.ML.Data/Model/ModelOperationsCatalog.cs | Adds security warning remarks to Load / LoadWithDataLoader APIs. |
| src/Microsoft.Extensions.ML/Builder/BuilderExtensions.cs | Adds security warning remarks to builder methods that source models from URI/file. |
| /// The name/type of input columns must exactly match name/type of the ONNX model inputs. | ||
| /// The name/type of the produced output columns will match name/type of the ONNX model outputs. | ||
| /// If the gpuDeviceId value is <see langword="null" /> the <see cref="P:MLContext.GpuDeviceId"/> value will be used if it is not <see langword="null" />. | ||
| /// |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7611 +/- ##
=======================================
Coverage 69.59% 69.59%
=======================================
Files 1484 1484
Lines 273606 273606
Branches 27949 27949
=======================================
+ Hits 190408 190410 +2
+ Misses 75836 75833 -3
- Partials 7362 7363 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Open
3 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
ML.NET assumes that loaded models are trusted. We should explicitly document this assumption and warn users not to load untrusted models.
Companion PR to change conceptual docs: dotnet/docs#53999