What Are Model Supply-Chain Risks?
What model supply-chain risks are, where they get into an AI app, and how teams reduce them, explained simply for your AI interview.
In short
Model supply-chain risks are the dangers from every outside part an AI app uses, such as downloaded models, adapters, datasets, packages and conversion tools. A tampered file can hide code or a backdoor, so teams check where each part came from and load it safely.
13 min readIntermediateOccasional ยท estimateFacts checked 27 November 2026
Say it out loud
Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.
A model supply chain is every outside part my AI system depends on: downloaded models, add-on adapters, datasets, Python packages and the tools that convert model files. Any of them can be tampered with. Some older model file formats run code the moment you load them. So I use trusted sources, safer file formats, exact version pins with checksums, and I test the exact file I ship.
An AI app is built from parts other people made. There is a base model, often downloaded from a public hub. There are adapters, which are small add-on files that tune a model for one job. There are datasets, Python packages, and the tools that convert a model into a smaller format. Each one is a supplier, and any of them can be swapped for a tampered copy. I would only notice if I checked where it came from.
The sharpest risk sits in the model file. Pickle is widely used for model files, and the Python docs warn that it is not secure, because a crafted file can run code when it loads. A safer format such as safetensors is built for storing tensors safely, as opposed to pickle. Even then, a backdoor can hide in a model's structure, so a safe format is no guarantee.
Other risks come from the process. An AI coding assistant can invent a package name that an attacker has already registered. An account name on a hub can be taken over after the original owner deletes it. A conversion step can change a model with no review. OWASP lists this as LLM04 in its 2026 Top 10 for LLM apps, and as LLM03 in 2025.
So I work in layers. I pin exact versions and file hashes, use signed files from sources I can verify, load unknown models in an isolated sandbox, keep an inventory of every model and dataset, and test the file that actually ships. I tell the interviewer that a signature proves where a file came from, not that it is safe.
What is a model supply chain, in plain words?
A supply chain is everything a maker takes in from others before the product reaches the customer. An AI app works the same way. Its base model may come from a public hub, its add-on adapters from a partner team, and its libraries from an open package index.
A hospital pharmacy is a good picture. It buys medicine from wholesalers and checks the seal and batch number on each delivery, because a fake box can arrive at the loading dock. The AI version is the same: a tampered model, a bad adapter or a look-alike package can arrive through a normal download.
A real case from OWASP's list: in December 2022 a malicious torchtriton package on PyPI, the public Python package index, shadowed the legitimate PyTorch-nightly dependency and exfiltrated data.
Key words
- Pre-trained model
- A model someone else trained, which you download and use or tune.
- Adapter
- A small add-on file, such as LoRA (a cheap way to tune a model), that changes how a model behaves for one job.
- Serialization
- Saving a model into a file so it can be shared and loaded again.
- Provenance
- Proof of where a file came from and who made it.
- Pinning
- Locking a component to one exact file, by its hash (a fingerprint of its bytes).
Where do the risks come from?
OWASP's 2026 entry says the weak points cover the integrity of training data, models, adapters, conversion pipelines and the platforms that deploy them. In ML the risk reaches past code flaws into third-party models and datasets.
I group the risks into three kinds: the model file itself, the process that moves and changes it, and the packages around it. OWASP gives an example of each.
- The model file
It can carry code or false answers
A pickle file can run code when it loads. A model with edited weights (the numbers inside it) can pass the usual benchmarks and still spread misinformation.
- The process
A swap in the middle
A conversion step (changing a model's file format) or a merge step (combining an adapter into a model) can change it with no review. A stolen build credential can ship a poisoned release, and because the company's own pipeline signs it, it passes the provenance checks.
- The packages
A look-alike name gets installed
AI coding assistants can suggest package names that do not exist. Attackers register those names first, so an install line pulls in their code.
Where a supply-chain risk gets in
Outside parts
Pre-trained model
weights from a public hub
LoRA adapter
a partner's add-on file
Python package
installed by name, not by hash
Our pipeline
Convert and merge
format change, adapter merge
Build server
builds and signs the release
Your app
loads the model when it starts
Checked before go-live
hashes, tests, sign-off
- 1The downloaded model goes into our conversion step.
- 2The partner's adapter is merged in the same step.
- 3The package is installed by name during the build.
- 4The converted model reaches the running app.
- 5The signed build ships to the app's servers.
- 6The app only goes live after the checks pass.
Adapters need the same care. OWASP describes an attacker who alters a partner's LoRA adapter, which is later merged into a deployed model through a model-merge workflow. The adapter then gives a hidden way into the system.
Shrinking a model, called quantising (storing each number with fewer bits), can change it too. OWASP notes that weights can be crafted so the full-precision model looks fine while the quantised version misbehaves. So test the file you ship, not the original.
Why is loading a model file dangerous?
Hugging Face's own docs say pickle is widely used in ML and is the default format for PyTorch model weights. Pickle stores instructions for rebuilding an object, and those instructions can import and run any code the file's author chose. The Python docs put the risk plainly:
โIt is possible to construct malicious pickle data which will execute arbitrary code during unpickling.โ
Python documentation, pickle
The demo below is harmless: its payload only prints a line. It shows the mechanism. A real payload could do far more, because it runs with the same rights as the app that loads it. The hash check is the part that protects you.
# Made-up demo: a model file is swapped on the way in. A pinned hash catches it before loading.
import hashlib
import pickle
class TamperedCheckpoint:
def __reduce__(self):
# pickle calls this to rebuild the object, so a file can name any function to run.
return (print, ("payload ran while the model file was loading",))
release = pickle.dumps({"weights": [0.1, 0.7]}) # what the publisher shipped
PINNED = hashlib.sha256(release).hexdigest() # stands in for the digest published with the signed release (computed here for the demo)
swapped = pickle.dumps(TamperedCheckpoint()) # what the mirror serves instead
for name, blob in [("publisher copy", release), ("mirror copy", swapped)]:
if hashlib.sha256(blob).hexdigest() != PINNED:
print(name, "refused: hash does not match the pin")
continue
print(name, "passed, loading")
pickle.loads(blob)Output
publisher copy passed, loading mirror copy refused: hash does not match the pin
A matching hash shows the file is byte-for-byte the copy you pinned. It does not show the file is safe. That is why the pinned hash and the sandbox work together. A sandbox is a sealed test space, cut off from real systems.
Safer formats cut the risk. Safetensors is described as a format for storing tensors, the numbers a model learns, safely and as an alternative to pickle. Moving format still does not end the risk. OWASP warns that a backdoor can be embedded in a model's computational graph and persist in formats widely considered safe, such as ONNX.
Two ways to load the same model
Pickle file (often .bin or .pkl)
Load the file
rebuilds objects from the file
Safetensors file
Load the file
reads the tensors it holds
Code can run here
hidden in the file, at load time
Tensors, stored safely
built for storing tensors safely
- 1A pickle file can run code while it loads.
- 2A safetensors file is built for storing tensors safely.
Here is a made-up case I would bring to an interview. An insurer's platform team pulls an open model by name, and the pipeline takes whatever file sits under that name today. The original account is deleted, an attacker registers the same name, and publishes a model that runs code on load. Nothing in the pipeline checks a hash, so the file reaches the claims servers in the overnight release.
The fix: pin the exact file by its digest from the signed release, load it first in an isolated sandbox, check the hash, and only then move it into production. The cost is a slower update, since each new model needs a manual hash change and a test run.
Tip
Asked how you'd load a third-party model? Say: from a verified source, in a safer format where possible, pinned by hash, and loaded first in an isolated sandbox. Never unpickle a file from an uploader you cannot verify.
How do teams reduce these risks?
Teams rely on a checklist more than on one trick. Most steps below follow OWASP's prevention advice. The sandbox step is our own practice, not OWASP's:
- 1
Know every part
Keep a signed inventory of every model, adapter, dataset and package: a software bill of materials, which is a list of every part in the build. OWASP suggests extending it to models with AI BOMs.
- 2
Trust, then verify
Only use models from verifiable sources, and add checks: integrity checks, signing and file hashes.
- 3
Pin the exact file
A name like latest can move to a new file without warning. Pin the digest, a fingerprint of one exact file.
- 4
Check packages before install
Confirm that any package an assistant suggests exists and is the one you meant, before you install it.
- 5
Load in isolation
Load unknown model files in a sandbox first. Treat scanners and safe-loader flags as one layer, not a guarantee.
- 6
Test the shipped file
A quantised or converted file needs its own tests, because a passing original says nothing certain about it.
โSigning proves integrity and origin, not safetyโ
OWASP, LLM04:2026
Signing gives you origin and integrity. It does not tell you the model is safe, so behaviour tests still matter.
How would you secure a team that pulls open models?
A made-up team at a mid-size bank wants an open model for a support assistant. The developers pull it by name in a script, and nobody records which file arrived. A new upload under that name could land in the next build without anyone noticing.
- Today
Pulled by name
The build grabs whatever sits under the name. Nobody records the file, and the server loads it when the app starts.
- Target
Pinned, checked, tested
The release names one hash, the file is checked and loaded in a sandbox, and the same tests run on the exact file that ships.
I would add a rule: each new model needs a named owner, a source on the team's verified list, and a test report before it reaches the bank's servers. Each update is slower.
What does the interviewer want to hear?
A strong answer covers
- A plain definition: every outside part an AI app takes in can carry a risk.
- The parts: models, adapters, datasets, packages and build or conversion steps.
- Why a model file can run code: pickle, and why safer formats help.
- Pin by hash, check the source, keep an inventory, and sign what ships.
- Test the exact file you deploy, after any conversion or quantisation.
- Signing proves origin, not safety. Said honestly.
Common traps
Trap"Our model came from a big lab, so it is safe."
BetterOrigin helps, but it proves only where a file came from. Check the hash and test its behaviour.
Trap"A safe format like ONNX means no risk."
BetterOWASP says a backdoor can persist in formats considered safe. Formats cut the risk; they do not end it.
Trap"Just use the newest version of the model."
BetterThe newest version can change under you. Pin an exact file and its hash.
Can you spot the safe step?
Spot the safe step
Which line is the safest way to bring a third-party model into the build?
Quick check
An agent merges a partner's LoRA adapter into your production model. Which change cuts this risk the most?
Can you answer these from memory?
Flash cards ยท tap a card to flip it
What will they ask next?
- Q215What is data and model poisoning?13 min
- Q206Name the OWASP LLM Top 10 (2026).10 min
- Q207What changed from the 2025 list to the 2026 list?10 min
- Q222Automated vs human red teaming?11 min
- Q213What is sensitive information disclosure?12 min
- Q223Guardrail tools (Llama Guard, NeMo Guardrails, cloud filters)?10 min
Learn it in depth
Last updated on 27 November 2026
Loading models from a hub or a partner?
I design and build AI products and agents with these checks in place: pinned versions, verified sources, safer file formats and tests on the file you ship. Book a short call and tell me which models and parts you load, and from where.