Safeguard
Developer Tools•

How do you review a pull request that adds a model file?

A binary model file cannot be read in a diff. A reviewer checklist covering format, hash, origin, license and loader code, with a gate to enforce it.

Safeguard Security Team
3 min read

A model file in a pull request is a binary the reviewer cannot read, so review the things around it: file format, hash, source and revision, license, the loader code, and who approved it. Block the merge unless each is recorded, and prefer formats that cannot run code on load.

Why a diff is not enough

A diff of a weights file shows only "binary file changed." The risk sits in properties you cannot see: whether the file is a pickle, where it came from, and whether the code that loads it enables something dangerous. Review the metadata, because the content is opaque.

The checklist

CheckWhat to look for
FormatSafetensors or similar data formats are preferred. Pickle based files such as pytorch_model.bin need a stronger reason
SourceOwner, repo name and full commit hash recorded in the pull request description
HashA file hash in a manifest committed beside the file
LicenseLicense tag recorded and checked against your use
SizeDoes it match what the source lists? An unexpected size is a prompt to ask
Loader codeAny call that loads with pickle, allows remote code, or loads from a path built from user input
StorageShould the file be in git at all, or in an artifact store with a pointer
ApprovalA named approver from the model intake process

Loader code deserves the closest read

The loader decides what happens when the file opens. In the Transformers documentation, custom model code requires an explicit trust_remote_code setting to load. Search the diff for that flag, for calls to pickle load, and for torch load. If you find one, ask why a safer path will not do. See what does trust_remote_code do in Transformers.

Git and large files

Large files are often tracked with pointer files rather than content. A reviewer then sees only a small text pointer. Make sure CI verifies the real file against the manifest hash, because a pointer proves nothing about the content. For more on this see Git LFS pointer files: what dependency scanners see.

Enforce it with a gate

Humans skip steps when tired. Add a pipeline check that fails when a new file with a model extension appears without a manifest entry, a license field and an approver. A rule that is checked automatically is applied every time.

Try it yourself

Click through it at your own pace, or open it full screen. Look at how a failed check blocks the merge and says why.

Safeguard's policies and gates can block pull requests on dependency findings, and its SBOM and dependency scanning cover the libraries around the model. Try the free scan.

Quick check

Can a reviewer judge a model file by opening it?

No. Review format, source, hash, license and the loader code instead.

Is a Git LFS pointer proof of the file content?

No. Verify the real file against a committed hash in CI.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.