Skip to main content

A teammate wants to load a model file they downloaded from a public hub. What supply chain risks do you check?

AI security · Pro 1

Short answer

Some model formats, especially Python pickle files such as many .pt, .pkl and .bin files, can run code when loaded, so a malicious file can take over the machine. I would prefer safetensors, which holds only weights, check the publisher and scans, pin the version, sandbox untrusted files, and record the model in our AI inventory.

Deeper answer

Pickle rebuilds Python objects and can call functions while loading, so opening the file is enough to run an attacker's code. Hub platforms scan uploads, but scanning is not a guarantee. Safer options: safetensors for weights, and in PyTorch loading with weights_only=True where possible.

The wider AI supply chain also includes the training data, tokenizers, custom code that some models ask you to trust (for example trust_remote_code), Python packages, and the base model behind a fine-tune. Controls: an approved list of sources and publishers, pinned commit hashes, a private mirror for approved models, dependency scanning, model cards reviewed for licence and known limits, and an AI bill of materials so you know what you run when a new issue is announced.

What a strong answer covers

Answer it out loud in the mock interview about 1.5 min

Follow-ups to expect

Common mistakes

Learn it

Securing the AI supply chain

Practice AI security questions

More on this topic

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.