[agenticwork]
← blog

AI Supply Chain Attacks Are Here: PyTorch, Ultralytics, and What Comes Next

AI supply chain attacks are no longer theoretical. They are happening now, targeting the frameworks and model registries that enterprise AI teams depend on every day. In the past two years, three major incidents have demonstrated that the AI ecosystem is vulnerable to the same class of supply chain attacks that have plagued traditional software — but with amplified consequences because AI systems operate with broader permissions and less human oversight than traditional applications.

According to Sonatype's 2024 State of the Software Supply Chain Report, malicious package uploads to open-source repositories jumped 156% year-over-year, totaling over 512,000 malicious packages. The AI and machine learning ecosystem is increasingly in the crosshairs. Here are the three incidents that should be shaping your security posture right now.

Incident 1: The PyTorch torchtriton Attack (December 2022)

On December 30, 2022, the PyTorch team disclosed that a malicious package named torchtriton had been uploaded to PyPI, exploiting a dependency confusion vulnerability to target users of PyTorch nightly builds. Between December 25 and December 30, 2022, anyone who installed pytorch-nightly via pip received the compromised package instead of the legitimate triton dependency.

The malicious package executed on installation and stole sensitive data from infected systems: SSH private keys (~/.ssh/*), system hostname and username, contents of /etc/hosts and /etc/resolv.conf, the first 1,000 files in the user's home directory, and environment variables. All exfiltrated data was sent to a remote server via encrypted DNS queries. PyTorch confirmed that 2,717 downloads of the malicious package occurred, with 2,500 on December 26 alone.

The attack exploited a fundamental weakness in Python's package resolution: when a package exists on both a private index and the public PyPI, pip defaults to the public version. The PyTorch team was using a private torchtriton package, but the attacker registered the same name on PyPI with a higher version number, causing pip to install the malicious version instead.

Source: PyTorch official blog, “Compromised PyTorch-nightly dependency chain,” December 31, 2022. Confirmed by SentinelOne and ReversingLabs independent analyses.

Incident 2: The Ultralytics YOLO Compromise (December 2024)

In December 2024, the Ultralytics YOLO computer vision library — one of the most widely used AI libraries on PyPI with approximately 60 million downloads — was compromised in a sophisticated supply chain attack. Malicious versions 8.3.41, 8.3.42, 8.3.45, and 8.3.46 were uploaded to PyPI between December 4 and December 7, 2024.

The compromised versions contained a cryptocurrency mining payload (XMRig for Monero) that executed on installation. The attack vector was novel: the attackers exploited a vulnerability in GitHub Actions by crafting malicious branch names in pull requests submitted to the Ultralytics repository. These crafted branch names triggered the CI/CD pipeline to build and publish compromised packages directly to PyPI without the maintainers' knowledge or approval.

This attack is particularly significant for enterprise AI teams because it targeted the build pipeline itself, not the source code. Code review would not have caught it — the repository's source files were clean. The malicious payload was injected during the automated build and release process. As PyPI's official post-incident analysis noted, this represents an escalation in supply chain attack sophistication.

Source: PyPI official blog, “Supply-chain attack analysis: Ultralytics,” December 11, 2024. Additional analysis by Snyk, ReversingLabs, and GitGuardian.

Incident 3: NullifAI on Hugging Face (February 2025)

In February 2025, security researchers at ReversingLabs discovered malicious machine learning models on Hugging Face that used a novel technique to bypass the platform's security scanning. The attack, dubbed NullifAI, exploited broken Pickle file formats to evade Hugging Face's Picklescan security tool — the primary defense against malicious serialized objects in ML models.

The malicious models used 7z compression instead of ZIP (PyTorch's default serialization format), which caused Picklescan to silently pass the files as safe. Inside the compressed archives, the models contained reverse shell payloads that would execute when the model was loaded, giving attackers remote access to the machine running the model.

This is a fundamentally different attack vector than package-level supply chain attacks. It targets the model artifacts themselves — the weights and parameters that ML engineers download and load into GPU memory. For enterprise teams deploying models from public repositories, this means that even if your package dependencies are locked and verified, the models you load could contain executable payloads.

Source: ReversingLabs, “Malicious ML Models on Hugging Face Exploit Novel Attack Technique,” February 2025. Confirmed by Infosecurity Magazine and The Hacker News.

The Pattern: Why AI Is Uniquely Vulnerable

These three incidents illustrate a pattern that should concern every enterprise deploying AI in production. AI supply chain attacks are more dangerous than traditional software supply chain attacks for several compounding reasons:

  • Broader permissions. AI agents and ML pipelines typically operate with extensive system access — GPU resources, cloud credentials, database connections, API keys for multiple services. A compromised component in an AI pipeline has a larger blast radius than a compromised library in a web application.
  • Less visibility. Model artifacts are opaque binary blobs. Unlike source code, you cannot review a 7-billion-parameter model file for malicious content by reading it. Security scanning tools are in their infancy compared to static analysis tools for traditional code.
  • Automated execution. AI agents are designed to execute tools and make decisions autonomously. A compromised tool in an agent's toolchain does not wait for a human to invoke it — the agent calls it as part of its autonomous operation, potentially hours or days before anyone reviews the output.
  • Trust-by-default culture. The ML community's culture of sharing models, datasets, and tools through public registries optimizes for collaboration and speed. Security review processes are minimal compared to enterprise software development practices.

What Enterprise AI Teams Should Do Now

The response to AI supply chain risk is not to stop using open-source AI frameworks. That is neither practical nor desirable. The response is to apply the same security rigor to AI dependencies that mature engineering organizations apply to their software supply chain — and to add AI-specific controls that address the unique risks of autonomous agent execution.

1. Pin and Verify All Dependencies

Lock every AI dependency to a specific version with hash verification. Use private package indices with allow-lists instead of pulling directly from public registries. The PyTorch torchtriton attack would have been prevented by a private index that only served pre-approved packages.

2. Isolate AI Workloads

Run AI agents and ML pipelines in sandboxed environments with minimal permissions. Every tool invocation should execute in an isolated context with scoped credentials that expire after the task completes. This limits the blast radius of any compromise to the specific task, not the entire agent's permission set.

3. Require Human Approval for High-Risk Actions

Implement mandatory human-in-the-loop (HITL) gates for any agent action that touches sensitive systems. The OATS framework enforces this architecturally — every synthesized tool requires human approval before execution. The reviewer sees the generated code, the risk assessment (LOW/MEDIUM/HIGH/CRITICAL), the requested credential scopes, and a plain-language explanation before deciding.

4. Use Ephemeral Tool Synthesis Instead of Persistent Registries

The most fundamental defense against supply chain attacks on AI tool registries is to eliminate the registry. OATS synthesizes tools on demand from governed specifications and discards them after execution. There is no persistent tool binary that an attacker can trojanize. There is no shared marketplace where malicious packages accumulate trust over time. Every tool exists only for the duration of its task.

How OATS Addresses This Threat Class

Map any of these three attack patterns against the OATS architecture, and the attack chain breaks at multiple points:

  • Dependency confusion (torchtriton): OATS does not install packages from public registries at runtime. Tools are synthesized from intent descriptions using the LLM, not downloaded from PyPI or npm. There is no version resolution to confuse.
  • CI/CD pipeline compromise (Ultralytics): OATS tools do not have a build pipeline. They are generated, reviewed by a human, executed in a sandbox, and destroyed. There is no persistent build artifact to compromise.
  • Malicious model artifacts (NullifAI): OATS tool execution runs in isolated subprocesses with credential scoping and timeout enforcement. Even if a tool somehow contained a malicious payload, it would execute in a subprocess with only the specific credentials scoped to its task, bounded by a configurable timeout.
  • Credential exfiltration: OATS injects credentials as environment variables into sandboxed execution contexts. Each tool gets only the specific credentials it needs for its task. A tool that queries an API does not have access to database credentials, SSH keys, or cloud provider tokens.

The Bigger Picture

According to RAND Corporation's 2024 research, more than 80% of AI projects fail — twice the failure rate of non-AI IT projects. Security incidents like these will only increase that failure rate as enterprises face the choice between accepting unacceptable risk and abandoning AI initiatives that cannot meet their security requirements.

The organizations that succeed with enterprise AI will be the ones that treat AI security as an architectural concern from day one, not a compliance checkbox addressed after the first incident. The supply chain attacks against PyTorch, Ultralytics, and Hugging Face are not anomalies. They are the early chapters of a pattern that will intensify as AI systems become higher-value targets.

The choice is not between capable AI agents and secure AI agents. The choice is between architectures that make security possible by default — sandboxed execution, credential isolation, mandatory human approval, ephemeral tools — and architectures that leave security as an exercise for the reader. OATS exists because we believe the default should be secure.

How Our Platform Defends the Full Attack Surface

OATS eliminates the tool registry attack vector, but supply chain security requires defense across every layer. Our platform provides that depth. The DLP Scanner monitors all data flowing through agent execution in real time — detecting credential exfiltration, PII exposure, and anomalous data patterns across a configurable set of detection rules. The torchtriton-style DNS exfiltration and NullifAI reverse shells are caught at the data boundary, not just the network boundary.

The platform's Audit System records every agent action in immutable, cryptographically hashed logs, making post-incident forensics straightforward and providing the tamper-evident trail that regulated industries require. OBO (On-Behalf-Of) Authentication ensures agents never hold standing credentials — they act with scoped, time-limited tokens tied to specific user identities, so even a fully compromised agent cannot escalate privileges or move laterally. Combined with K8s-native sandboxed execution that enforces network policies and resource boundaries at the container level, our platform is designed to implement the defense-in-depth strategy this post describes natively, rather than leaving it as guidance for teams to build themselves.

Sources