Skip to content
AI.info

MLOps

ML Security and Supply-Chain Integrity

Threat-model ML systems across data, code, artifacts, runtime, interfaces, dependencies, and operational control planes.

By the end you can

The model can be unchanged while the decision is compromised

An attacker never modifies the weights. Instead they alter a feature source, exploit a permissive tool credential, or replace a preprocessing package in the build. The model behaves exactly as trained, on attacker-controlled inputs.

The plainest demonstration of that shape is not an ML incident at all. On 29 March 2024 Andres Freund posted to the oss-security mailing list under the subject "backdoor in upstream xz/liblzma leading to ssh server compromise". He wrote: “The upstream xz repository and the xz tarballs have been backdoored.” Versions 5.6.0 and 5.6.1 of xz/liblzma had been compromised by the project's own upstream release process. The malicious object was extracted from a disguised test file during the build and shipped inside the signed release tarballs, while being absent from the git build path. Anyone reading the source repository saw clean code. Anyone building the published release got the backdoor. CISA issued an alert the same day recommending a downgrade to XZ Utils 5.4.6 Stable. CVE-2024-3094 carries a CVSS v3.1 base score of 10.0 from both Red Hat and NVD, under CWE-506, embedded malicious code.

Nothing in that story required a compromised key, a failed signature, or an altered commit. The release was authentic and the artifact was still hostile. ML security must therefore protect the entire decision path, and the mechanisms that create, approve, distribute and invoke its assets — including the mechanisms whose output is signed, reproducible, and wrong.

Case

A matching package name was enough

PyTorch's own nightly build installed the wrong package, and PyTorch published the case. Between December 25, 2022 and December 30, 2022, PyTorch-nightly Linux packages installed via pip pulled a dependency named torchtriton from the Python Package Index rather than from the project's own nightly index. The incident notice gives the reason in five words: “the PyPI index takes precedence”.

The malicious copy read /etc/hosts, /etc/passwd, the first 1,000 files in $HOME and the contents of $HOME/.ssh. It uploaded them “via encrypted DNS queries” — a channel that leaves an ordinary egress filter looking at ordinary name resolution. No model was touched. No weight was altered. No signature failed. A matching name on a public index, and a resolver that preferred it, was the whole attack.

Visual

Attack surfaces across the ML lifecycle

Compromise can enter before training, during it, or after the artifact ships. Through evidence inputs: poisoned data, malicious labels, source tampering, hidden trigger patterns. Through build and dependencies: compromised code, packages, images, runners, secrets, provenance. Through artifacts and the registry: unauthorized replacement, alias movement, theft, downgrade. Through the serving interface: evasion, extraction, inversion, injection, denial, abuse. And through operational control: credential misuse, policy bypass, unsafe tools, incident suppression.

The first of those nodes is usually assumed to be the most expensive to attack. It has been priced. A web-scale dataset is distributed as a list of URLs, not as images, so whoever controls a domain controls what the trainer downloads years after the list was compiled. Carlini and eight colleagues attacked that trust assumption by buying expired domains that still served dataset URLs. They report: “By exploiting specific invalid trust assumptions, we show how we could have poisoned 0.01% of the LAION-400M or COYO-700M datasets for just $60 USD.” They describe the attacks as immediately practical against 10 popular datasets. Sixty dollars, split-view poisoning, no access to any pipeline.

The intuitive defence against that number is to assume a larger corpus dilutes the poison. That has been measured too, and it does not hold. In October 2025 Anthropic, the UK AI Security Institute and the Alan Turing Institute published a joint study. They pretrained models from 600M to 13B parameters on chinchilla-optimal datasets of 6B to 260B tokens: “We find that 250 poisoned documents similarly compromise models across all model and dataset sizes, despite the largest models training on more than 20 times more clean data.” Those 250 documents are roughly 420k tokens. That is 0.00016% of the largest model's training tokens. Percentage-of-corpus reasoning is the wrong defence model, because the attacker's budget does not scale with the victim's dataset.

FigureHierarchy · 5 levels
  • Evidence inputs

    Poisoned data, malicious labels, source tampering, and hidden trigger patterns.

    • Build and dependencies

      Compromised code, packages, images, runners, secrets, and provenance.

      • Artifacts and registry

        Unauthorized replacement, alias movement, theft, and downgrade.

        • Serving interface

          Evasion, extraction, inversion, injection, denial, and abuse.

          • Operational control

            Credential misuse, policy bypass, unsafe tools, and incident suppression.

Example

Signed provenance for a malicious dependency

A protected builder produces an artifact with valid attestation — and the framework that issues the attestation states in writing what it does not cover.

  • Trusted build: The builder identity and artifact digest are authentic, and the attestation verifies against the right key on any machine that checks it.
  • Compromised input: A dependency version was malicious before entering the build — as torchtriton was on PyPI in December 2022, and as xz/liblzma 5.6.0 was inside its own signed tarball.
  • Complete statement: Provenance accurately records the bad dependency. Nothing in the evidence is false. The evidence is about how the build ran, not about what the build consumed.
  • False conclusion: The team treats signed provenance as proof that the model is safe. The SLSA specification, published by OpenSSF, disclaims that inference itself. Its own "What SLSA doesn't cover" section says: “Transitive trust for dependencies: the SLSA level of an artifact is independent of the level of its dependencies.” There is no single level covering an artifact and its transitive dependencies together.
  • Required control: Combine provenance with dependency policy, vulnerability review, behavior tests, and runtime monitoring — each supporting one narrow claim, none of them standing in for the others.

Comparison

Integrity, confidentiality, availability, and misuse are distinct

One security control rarely covers all four. Integrity prevents or detects unauthorized changes to data, code, artifacts, policy and decisions: signing and digests, protected builders, access control and review, behavioral tamper checks. Confidentiality and privacy limit disclosure through artifacts, logs, interfaces and model behavior: least privilege, encryption and minimization, extraction and inversion assessment, controlled telemetry. Availability and abuse resistance maintain service under overload, adversarial queries and resource exhaustion: rate and quota policy, admission control, input bounds, cost-aware fallback. Authority control ensures outputs cannot exceed allowed actions or permissions: tool allowlists, scoped credentials, human approval for consequences, independent policy enforcement.

The confidentiality column is the one that gets priced wrongly, because it is defended as though it were the integrity column — keys, network boundaries, artifact storage. In March 2024 Carlini and colleagues reported what that misses: “For under $20 USD, our attack extracts the entire projection matrix of OpenAI's Ada and Babbage language models.” The attack confirmed hidden dimensions of 1024 and 2048, and the authors estimated under $2,000 to recover the same matrix for gpt-3.5-turbo. There was no access to weights and no breach of storage. The loss ran through the ordinary prediction interface. An access-control review that stops at the network boundary cannot see it. Only an extraction and inversion assessment against the interface as served will.

FigureComparison · 4 columns

Integrity

Prevent or detect unauthorized changes to data, code, artifacts, policy, and decisions.

  • Signing and digests
  • Protected builders
  • Access control and review
  • Behavioral tamper checks

Confidentiality and privacy

Limit disclosure through artifacts, logs, interfaces, and model behavior.

  • Least privilege
  • Encryption and minimization
  • Extraction and inversion assessment
  • Controlled telemetry

Availability and abuse resistance

Maintain service under overload, adversarial queries, and resource exhaustion.

  • Rate and quota policy
  • Admission control
  • Input bounds
  • Cost-aware fallback

Authority control

Ensure outputs cannot exceed allowed actions or permissions.

  • Tool allowlists
  • Scoped credentials
  • Human approval for consequences
  • Independent policy enforcement

Threat models need capability and objective

"Adversarial attack" is too broad for engineering. Ask what the attacker can access, change, observe, or query; what outcome they want; and which controls or costs limit them.

That is not a house convention, and there is a document number for it. NIST's adversarial machine learning taxonomy, NIST AI 100-2e2025, published 24 March 2025, states: “These attacks are classified according to the following dimensions: 1) learning method and stage of the learning process when the attack is mounted, 2) attacker goals and objectives, 3) attacker capabilities, and 4) attacker knowledge of the learning process.” Four dimensions, numbered. A threat model that fills in fewer than four is not yet a threat model. The same taxonomy declines to treat supply-chain compromise as an afterthought to the model-level attacks. It carries its own identifier: NISTAML.05.

A public prediction API creates different risks from an internal batch model, an on-device biometric system, or a tool-using language model. Fill in stage, goal, capability and knowledge for the interface you actually ship, and the control list stops being generic. A $20 query budget, a $60 domain purchase and a compromised release tarball land in three different cells.

Case

A loader default that changed in version 2.6

A checkpoint file can itself be the entry point, and PyTorch changed a default over it. The documentation for torch.load carries the warning in its own words: “torch.load() unless weights_only parameter is set to True, uses pickle module implicitly, which is known to be insecure”. Loading a checkpoint from an untrusted source was, for years, executing code from an untrusted source.

Version 2.6 flipped the flag. The release blog is explicit about both halves of the trade: “as an important security improvement measure we have changed the default value for `weights_only` parameter of `torch.load`. This is a backward compatibility-breaking change”. The default moved from False to True, and checkpoints that had loaded for years stopped loading. Issue #2681 in the MIC-DKFZ/nnU-Net repository on GitHub is titled “PyTorch 2.6 has changed the default value of `weights_only` to `True`, breaking the loading of some `nnunetv2` models”.

That breakage is the price of the control, paid in public, by people who did nothing wrong. A default is a security decision with a release number attached. The version you pin decides which decision you inherited.

Key idea

A model guardrail is not a security boundary

A classifier, system prompt, or output filter can reduce some unsafe behavior but remains probabilistic and can fail under adaptive input.

Microsoft ships exactly such a classifier in front of Microsoft 365 Copilot — XPIA, Cross Prompt Injection Attempt — and it was chained past. The flaw is CVE-2025-32711, known as EchoLeak, published 11 June 2025. Microsoft scored it 9.3 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:N) under CWE-74; the NVD's own score for the same record is 7.5. The description Microsoft filed is a single sentence: “Ai command injection in M365 Copilot allows an unauthorized attacker to disclose information over a network.” Reddy and Gujral describe four bypasses chained together: evading the XPIA classifier, defeating link redaction with reference-style Markdown, abusing auto-fetched images, and proxying the data out through a Microsoft Teams endpoint that the content security policy already permitted. One crafted email, zero clicks. The injected instructions arrived as ordinary retrieved content.

Note the shape of the chain. The model-based filter was only the first obstacle. The other three were redaction, image fetching and a content security policy allowance — deterministic controls that were nonetheless permissive. Treat model-based defenses as layered detectors, not the sole control over consequential actions. Enforce authorization, network policy, credential scope, sandboxing and transaction controls outside the model.

Probabilistic model behavior should not define the outer boundary of authority.

Steps

Threat-model an ML release

Use a concrete attacker and asset graph rather than a generic checklist. Inventory assets and authority: data, models, prompts, tools, secrets, routes, and external actions. Define attacker capabilities along the four NIST AI 100-2e2025 dimensions — stage of the learning process, goals and objectives, capabilities, knowledge. Trace attack paths from each entry point to the decision and consequence it reaches. Place independent controls: isolation, signing, least privilege, validation, quotas, monitoring. Then test and rehearse, with adversarial evaluation, dependency-compromise and credential-abuse drills, and an incident response run end to end.

Four concrete questions give those steps something to bite on, and each has a published price attached. Could a $60 expired-domain purchase reach anything in your training or fine-tuning corpus, and would you know? Would 250 documents inserted upstream be caught by a filter that reasons in percentages of the corpus? Would an extraction attempt running at under $20 through your served interface be visible in your telemetry, or does it look like a paying customer? And if your build were the xz build — reproducible, signed by the maintainer, and hostile — which control on your list catches it before the artifact ships?

FigureProcess · 5 steps
  1. 1. Inventory assets and authority

    List data, models, prompts, tools, secrets, routes, and external actions.

  2. 2. Define attacker capabilities

    State access, observation, query, modification, and persistence.

  3. 3. Trace attack paths

    Connect entry points to targeted decisions and consequences.

  4. 4. Place independent controls

    Use isolation, signing, least privilege, validation, quotas, and monitoring.

  5. 5. Test and rehearse

    Run adversarial evaluation, dependency compromise, credential abuse, and response drills.

Security evidence should be composable

Signed provenance, vulnerability results, data-access review, adversarial tests, runtime policy, and incident readiness can all travel with a release. Each artifact supports one specific claim and no more. The component inventory is the clearest case. NIST SP 800-204D, from February 2024, states the limit: “while SBOMs enable the identification of components and provenance, they do not provide enough information to address vulnerabilities nor content to address software defects. Hence, SBOMs alone cannot be used for vulnerability management.” An inventory is real evidence of what went into the build. It is not a verdict on whether what went into the build is safe — the same limit the SLSA specification states about its own levels.

Avoid the sentence "the model is secure." State which attack paths were tested, under what assumptions, and which risks remain. That the dependency set was policy-checked but the upstream release process was trusted. That extraction was rate-limited but not proven infeasible. That the injection classifier reduces attempts, while authorization — not the classifier — bounds what a successful one can do.

Key takeaways