Training Data Poisoning and Model Supply Chain Risks in Self-Hosted Models
Self-hosting moves the servers in-house, but not the trust in upstream data, weights, and code.

With self-hosted models, the risks of training data poisoning and the supply chain reach inside an operator’s own infrastructure. Hosting changes who runs the system while leaving its behavior shaped by the same upstream contributors. To defend it, operators need to know where outside data, model artifacts, and software enter trusted parts of the system, including layers that ordinary security tools cannot check.
Why self-hosting a model does not eliminate third-party trust
An operator controls the servers, chooses how to deploy the model, and decides who has access. That feels like control over the whole system. Yet the downloaded model contains decisions and data from upstream contributors, and its inference framework brings dependencies of its own. Running those components locally does not make their origins or behavior known.
The difference from ordinary software is important. An attacker can alter model weights and change application decisions without touching any code that security tooling monitors. Standard software composition analysis, or SCA, and software bills of materials, or SBOMs, document code dependencies, leaving training data integrity and behavioral guarantees outside their scope. Most security programs have no process for reviewing model provenance, fine-tuning sources, or inference framework behavior. The blind spot sits inside an otherwise monitored stack, so the central question is where outside influence becomes trusted.
The five layers where trust boundaries actually sit
The dependency chain begins with the data layer. Training sets, validation data, and fine-tuning corpora often come from web scraping, third-party datasets, or user interactions, with little documentation of their origins. Above that data is the model layer, made up of base weights and fine-tuned checkpoints downloaded from public repositories. Operators downloading those models inherit whatever pretraining built into them, with data and model layers remaining distinct boundaries even when one team handles both.
The library layer turns those artifacts into a running service through inference engines, serving frameworks, quantization tools, and packages from PyPI and conda. Traditional security tools have useful coverage here. Beneath it, cloud GPUs, model registries, and serving platforms form the infrastructure layer, with medium risk and more familiar security concerns. MLOps platforms, experiment tracking, and monitoring form the tooling layer, the lowest-risk part of this map but still a dependency chain. Different owners and risks prevent any one control from covering all five.
NIST AI 100-2 E2025 distinguishes data poisoning, where an attacker controls some training data, from model poisoning, where the attacker controls the model and its parameters. The distinction identifies which boundary was crossed. MITRE ATLAS names techniques used in these threats, including training data poisoning, model manipulation, and publishing poisoned AI artifacts. OWASP Top 10 for LLM Applications 2025 covers the same threats in its entries for Data and Model Poisoning and Supply Chain.
How backdoors enter model weights and what makes them persist
Mithril Security’s PoisonGPT demonstration modified GPT-J to spread disinformation on specific factual questions while still passing standard benchmarks. The model looked capable under ordinary performance tests. Its malicious behavior appeared only on selected inputs, showing why a good benchmark result is not evidence that an artifact is clean.
A backdoor encodes attacker-controlled behavior in the weights and activates when a trigger appears. Without that trigger, evaluation can miss it entirely. Because the behavior belongs to the model rather than a session, it persists across users and requests until replacement or retraining. Researchers have also demonstrated backdoors in computer vision models that survived downstream fine-tuning. Fine-tuning a compromised base model therefore cannot be assumed to remove the compromise.
The IARPA TrojAI Final Report, published in January 2026, found that researchers still have no reliable, general-purpose way to detect trojans in neural networks. No certified defense exists for that task. Its findings cover weight manipulation and architecture backdoors that require access only to the saved artifact. Remediation is consequently different from patching software or rotating a credential. Repository reputation cannot settle the question either, as recurring malicious uploads to Hugging Face show that platform trust is not per-artifact verification.
Why training data poisoning is effective even at small scale
A large dataset is not a reliable dilution defense. The 2025 International AI Safety Report cites research showing that poisoning efficacy depends on the absolute number of poisoned examples. A small number of malicious examples can therefore embed a backdoor even when the overall corpus looks overwhelmingly legitimate.
That finding lands directly on fine-tuning pipelines using user feedback, third-party datasets, or reinforcement learning from human feedback, known as RLHF. Human ratings and implicit interaction signals become continuing ingestion channels whose contributors are rarely verified. OWASP’s Data and Model Poisoning entry identifies adversarial manipulation of fine-tuning data as a pre-deployment attack that runtime monitoring alone cannot detect.
Compliance frameworks are beginning to address that missing history. ISO/IEC 42001:2023 includes data provenance controls in Annex A. ISO/IEC 27001:2022 maps the risk to ICT supply chain security and the secure development life cycle. Those requirements call for documentation that most AI teams cannot produce, exposing a gap between having a dataset and knowing how its contents became trusted.
How the inference framework becomes its own attack surface
The serving stack can be compromised without a behavioral backdoor in the weights. Loading a model is itself an execution boundary. CVE-2026-41523 in vLLM involved an assert statement serving as the only security check for activation-function loading. A malicious artifact could execute code at load time when vLLM ran in Python optimized mode, which strips assert statements. That condition is essential to understanding the vulnerability.
CVE-2026-47155 exposed a different weakness in the same framework. Revision pins were not consistently applied to every loaded artifact, so pinning the base model still left components open to substitution. The surrounding files also shape what a deployment does. An adapter can change behavior without changing base weights, a tokenizer can change how dangerous strings are segmented, and repository code can execute during loading.
Serialization gives attackers another way into that execution environment. JFrog’s 2024 analysis found that the vast majority of malicious models on Hugging Face were PyTorch pickle files, whose deserialization can execute arbitrary code. SafeTensors offers a safer format, but adoption is incomplete. SCA and SBOM practices can expose vulnerabilities in serving libraries, while leaving behavioral compromise in weights or training data untouched.
The LiteLLM compromise as a case study in AI supply chain attack sequencing
The March 2026 LiteLLM compromise began in a security tool. TeamPCP compromised Trivy, and the compromised Trivy GitHub Action ran inside LiteLLM’s CI/CD pipeline. It stole the library’s PyPI publishing token. The attacker then used that token to publish backdoored versions 1.82.7 and 1.82.8, with malicious code injected into distributed wheels.
LiteLLM routes requests across LLM providers, placing it near valuable credentials. The first-stage payload harvested OpenAI, Anthropic, and Azure secrets from environment variables, cloud metadata credentials for AWS, GCP, and Azure, and local files including.kube/config and.aws/credentials. AI pipelines that used the library had a great deal exposed in a short time. The attack reached further because the library was treated as ordinary infrastructure without checks at its trust boundary.
No step required compromising a model artifact directly. Mandiant responded to numerous incidents in 2026 linked to supply chain compromises attributed to UNC6780, also known as TeamPCP, indicating repeated, organized targeting. ReversingLabs’ discovery of malicious model uploads on Hugging Face in 2025 provides a parallel at the artifact layer. The entry points differ, but both put hostile content into components that AI operators obtain from upstream.
How agentic and RAG pipelines extend the poisoning surface into runtime
Deployment does not freeze the sources that influence a model. Retrieval-augmented generation, or RAG, brings outside knowledge into the model’s context, and agents also take in tool outputs and environment observations. RAG poisoning attacks the retrieval source. A poisoned source can supply false evidence for an answer that still appears coherent and well-supported. The trusted input is no longer just the user’s request.
Agents can turn that influence into action. Research from Queen’s University and University of Waterloo in May 2026 describes how model outputs become steps along the way to planning, tool use, API interaction, and execution. A poisoned reasoning step can therefore propagate into operations. Plug-ins, tool manifests, browser extensions, tool-integration servers, and agent skills extend the dependency chain into the capabilities an agent can use.
ServiceNow Research and Mila’s “Malice in Agentland” from 2025 shows how these environments can also contaminate future training. An attacker places prompt-injection instructions in environments where a teacher agent collects training trajectories. Those poisoned trajectories then enter a student model’s fine-tuning dataset. The study embedded a backdoor with a small number of demonstrations, causing confidential user information leakage with over 80% success, while four guardrail models and one weight-based defense failed to detect or prevent it.
Why current defenses leave systematic gaps across these layers
Watching inference traffic alone misses poisoning that happened before deployment. Offline defenses that filter or clean a corpus before indexing also miss poisoned content that comes in later through retrieval or agent tools. The timing of a control is as important as the component it inspects.
Robust training methods have limits of their own. Data sanitization and differentially private training can reduce individual samples’ influence, usually at a cost to accuracy. Neither guarantees protection against many coordinated malicious samples. The TrojAI findings and the failed defenses in “Malice in Agentland” show why broader claims would overstate the field’s capabilities. A defense that works for ordinary model inference may still fail to protect an agentic pipeline.
Organizational gaps make that technical problem harder to contain. A large majority of enterprise AI usage happens outside IT and security visibility, with developers downloading unvetted models when official processes are too slow. Centralized review cannot cover dependencies it never sees. CISA’s Guidelines for Secure AI System Development, co-authored with the UK’s NCSC, provides a structured response through foundation model provenance assessment, dataset integrity verification, and lifecycle monitoring of third-party AI components. That guidance recognizes the gap without claiming a complete technical solution.
What a security program needs to do differently to get visibility into these layers
The practical response is to match controls to each boundary. At data ingestion, establish provenance requirements that document each training or fine-tuning example’s origin, labeler, transformations, and collection time. For the high-risk systems it covers, the EU AI Act requires data-governance practices that address where data comes from, and the ISO data controls support the same work. This lets security review and compliance documentation help each other.
At the model boundary, treat downloaded artifacts as untrusted third-party dependencies. Apply ATLAS mitigation AML.M0014, Verify AI Artifacts, and build toward an AI Bill of Materials under AML.M0023 that records origins, versions, and known evaluation conditions. Choose SafeTensors when it is available and require safe-loading flags. Artifact review should become an acceptance criterion before production deployment, rather than an assumption attached to a familiar repository.
For libraries, use existing SBOM and SCA practices on inference engines, serving frameworks, and ML-specific packages. Pin dependency versions and audit transitive dependencies. The LiteLLM sequence shows why that review must include CI/CD dependencies, while the vLLM vulnerabilities show why revision pins must cover every loaded artifact, including the base model.
For RAG and agents, extend integrity controls to retrieved documents, APIs, tool outputs, and environment observations entering the context window. Add checkpoints for behavioral evaluation after fine-tuning runs and after updates to the model or framework. Standard performance benchmarks are insufficient for this purpose. Comprehensive review also requires whitebox access to source code, cloud configurations, loading and serving code, and fine-tuning pipelines. An application-only review leaves the security program unable to see where its most consequential trust decisions are made.
Sources
- Trojans in Artificial Intelligence (TrojAI) Final Report
- From AI-Generated Content to Agentic Action: Security and Safety Threats in Generative AI
- Malice in Agentland: Down the Rabbit Hole of Backdoors in the AI Supply Chain
- Surveying the Operational Cybersecurity and Supply Chain Threat Landscape when Developing and Deploying AI Systems
- AI risk and resilience in 2026: A Mandiant special report


