✳ Field lesson AI1 / 17 min

Where a model and its data come from

A downloaded model is a dependency built from weights and training data you did not write. Some file formats run code when loaded, so use a format that holds only data. A signature proves who published the file, not that the model behaves well.

aisupply-chainmodel-provenanceml-bomCISSP D8Security+ (SY0-701) D2Security+ (SY0-801) D2

Helpful first: The code you inherit with one import · Prompt injection: when a document gives orders

Thirty days to Halcyon · Case 15: The model from outside · Episode 1 of 4

Monday, 10:00. Dax Mercer, Software Engineer on the operations tools team, wants a model running by lunch. pathfinder-7b is an open-weight model that a vendor fine-tuned to summarize anomaly reports for the pass planner.

The download is one checkpoint file and a README. Dax types the load command.

Vera Vance, your mentor, puts her cold coffee down on his keyboard. "Before that runs. What else came with the file?"

By the end you can

  • Explain why loading a model file can run code, and which formats avoid that
  • Verify a model's origin with a published hash or signature before using it
  • Record a model's source, format, data and evaluation in an inventory entry

A model is a dependency you did not write

pathfinder-7b is an open-weight model. Its publisher releases the weights, the billions of numbers the model learned in training, so anyone can download and run it. The vendor took a base model from another publisher and fine-tuned it. Fine-tuning means training an existing model further on new examples, here a set of anomaly reports.

So the download is a dependency, like a package in a build. It will run inside Meridian's pass planner. Two things make it harder to trust than code. You cannot read weights to see what they will do. And the model carries a second supply chain inside it: the data it learned from, chosen by people you have never met.

NIST makes the same point in its taxonomy of attacks on AI, NIST AI 100-2 E2025, published in March 2025. AI inherits the weaknesses of the software supply chain. It adds new dependencies: training data, models built by others, and plugins.

Vera's question has two parts, and they need different evidence. Is this the file its publisher released? That is provenance. Does the model do what Meridian needs, and nothing else? That is evaluation. A yes to the first says nothing about the second.

A package and a model, side by side
QuestionA software packageA downloaded model
What arrivesSource or compiled codeWeights, a config file, and sometimes code
Can you read what it will do?Yes, with effortNo. Weights are numbers
What it brings with itIts own dependenciesA base model and the data both were trained on
How you check the fileA hash in a lockfile, and a signatureA published hash, and a signature

Some model files run code when they load

Dax's download holds one checkpoint, pathfinder-7b.bin. A checkpoint is a file of saved weights. This one was saved with PyTorch's default format, which is built on Python's pickle.

Pickle stores Python objects, and loading them can call any function the file names. Python's own documentation warns that malicious pickle data can execute arbitrary code during unpickling. So opening an untrusted checkpoint is like running an untrusted program. It runs with your account, your files, and your network.

Safetensors is a format built to remove that risk. A tensor is a block of numbers, such as one layer's weights. A safetensors file holds a short header that lists each tensor's name, shape and position, then the raw numbers. Loading it reads data and runs nothing.

Two cautions remain. Some loaders now limit what a pickle may load, but PyTorch's documentation still says never to load data from an untrusted source. And a model folder can hold more than weights. If the loader imports a script from the folder, that script runs, whatever format the weights use. Converting a pickle to safetensors means opening the pickle, so ask the publisher for a safetensors release instead.

SORT IT OUT

Vera lists five files that could arrive with a model. Which ones can run code when they are loaded?

  1. A PyTorch checkpoint saved as a Python pickle

  2. A safetensors file holding the model's weights

  3. A JSON file that lists the number of layers

  4. A Python script the loader imports to build the model

  5. The optimizer state from training, saved as a pickle

Show the answers
  1. Can run code when loaded. Unpickling can call any function the file names. Python's documentation warns about exactly this.
  2. Read as data only. Loading reads a header and raw numbers. The weights could still be poisoned, but loading them runs no code.
  3. Read as data only. A JSON parser reads values. It does not run anything the file contains.
  4. Can run code when loaded. Importing a script runs it. This holds even when the weights beside it are safetensors.
  5. Can run code when loaded. Any pickle can run code when it is opened, whatever it was meant to hold.

A hash and a signature prove origin, not quality

The vendor also publishes a safetensors release with a signature. Before Dax uses it, he needs two answers. Are these the bytes the vendor released? And did the vendor release them?

A hash answers the first. SHA-256 turns a file into a short digest, and any changed byte changes the digest. A digest helps only if it comes from somewhere an attacker cannot also edit. A digest in a README from the same download proves only that the download agrees with itself.

A signature answers the second. The OpenSSF Model Signing (OMS) specification defines a signature file that ships in the model folder. It signs a list of every file in the folder with its hash. The signer can use a key, a certificate, or Sigstore, which ties the signature to an identity and records it in a public log.

Neither proves the model is good. OWASP makes the same point in LLM04, the supply chain entry in its 2026 list for LLM applications. A signature shows who released a file and that it is intact. A signed model can still carry poisoned weights, put there by its publisher or by someone further upstream.

WORKED EXAMPLE

Dax checks the signed release

  1. Get the identity from outside the download. The vendor's website names the identity that signs its releases. Dax copies it from there, not from the README in the folder.
  2. Verify the signature. The model signing tool checks the signature file against that identity and the public log. It verifies.
  3. Check every file. The tool hashes each file in the folder and compares it with the signed list. model.safetensors has the digest that begins 5d2e91c4, as signed. No file is missing or extra.
  4. Write down what is now known. These are the vendor's files, unchanged. Nothing yet says what the weights will do.

Result: Origin and integrity are proven, and behavior is unknown. Dax loads the release in a sandbox with no network, so a surprise has nowhere to go.

Poisoned weights pass every file check

A signed file that holds only data can still be dangerous. Data poisoning means someone tampers with training data so the model learns a behavior they chose. Model poisoning changes the model itself. Both leave a file that loads cleanly and verifies.

The hardest kind to find is a backdoor. The model behaves normally until a trigger, such as a word or phrase, appears in its input. NIST AI 100-2 E2025 cites research in which backdoors survived later fine-tuning and safety training. OWASP lists data and model poisoning as LLM05 in its 2026 list.

pathfinder-7b has two chains of this kind: the base model's training data, and the vendor's fine-tuning set. Its model card describes both. A model card is the publisher's own statement about a model. It is useful, and Meridian has not checked it.

So Meridian tests the model before it goes near a decision. Run it on old reports whose correct summaries you already know, including awkward ones. Keep its power small: pathfinder-7b gets no tools and reads only what it summarizes. NIST's advice fits here: treat a model as an untrusted part of the system.

YOUR CALL

Dax wants it running today

Monday, 10:20. The pickle checkpoint sits on Dax's laptop. The signed safetensors release is still downloading.

  1. Dax suggests opening the pickle now, just to try one summary.

  2. The release verifies against the vendor's identity. Dax asks where to run it first.

Show the strong calls
  1. Hold it, and wait for the signed safetensors release. The release finishes 20 minutes later. Nothing from the unsigned file ever runs.
  2. In a sandbox with no network, on old reports with known summaries. It summarizes 30 old reports. Vera compares each one with what the engineers wrote at the time.

Write it down: the model's inventory record

Meridian records every build in a software bill of materials (SBOM). A model needs the same kind of record, with a few more fields. An AI bill of materials, sometimes called an ML-BOM, lists models and datasets the way an SBOM lists packages.

CycloneDX, one of the two common SBOM formats, has described models since version 1.5, released in June 2023. Version 1.7 is current. It has component types for a machine learning model and for data. Its model card section holds the datasets, the measured performance, and known limits.

Each field should say what it rests on. Either Meridian verified it, or the publisher claims it. The figure below fills the record for pathfinder-7b one field at a time.

The first four fields show where the file came from, that it arrived intact, and that loading it runs no code. The last two ask how the model behaves, and no hash or signature can answer them.

An honest record has open fields, and that is the point of keeping one. When an advisory later names a base model or a dataset, the record answers whether Meridian uses it. It does for a model what an SBOM does for a package.

SPOT THE PROBLEM

Another team sends Dax its draft record for a different download, an embedding model for searching old reports. Flag each field that rests on weak evidence.

Show the answers
  • Format: pickle checkpoint, converted to safetensors on a team laptop Converting means unpickling. Any code in the file could have run on that laptop before the safe copy existed.
  • Hash: matches the value printed in the README The README came in the same download. A matching digest there proves only that the download agrees with itself.
  • Evaluation: the model card says it is accurate on technical text That is the publisher grading its own work. Meridian has not tested it on Meridian's reports.

CHECK YOUR JUDGMENT

A month later the vendor sends pathfinder-7b-v2. It arrives as a pickle checkpoint, signed with the vendor's identity, with a note that a safetensors build will follow in two weeks. Dax asks if he may load it into the pass planner today. What do you tell him?

CASE FILE · CASE 15 · ENTRY 1 OF 4

Answer the closing question correctly to add this entry to your case file.

Loading a file can run code

The checkpoint was an unsigned pickle that could run code on load, so Dax loaded the vendor's signed safetensors release in a sandbox with no network.

Next episode: The model loads safely. By Wednesday, two reports say it has misbehaved in two different ways.

Open the case file ↗

Review sheet: exam notes and quick reference

Find your next idea.

Tip: press / to open search. Escape closes this window.