Skip to main content
All updates

The Hidden Risk of Deploying Open-Source AI Models

By Mohammad Karami, PhD

Sleeper-agent training diagram showing normal behavior in 2023 and backdoored behavior triggered in 2024

I recently read Anthropic's paper Sleeper Agents: Training Deceptive LLMs that Persist Through Safety Training, and what stood out to me was how closely the problem resembles something we already worry about in cybersecurity: hidden malicious behavior that stays dormant until the right condition appears.

The researchers intentionally trained language models with backdoored behavior. In one of their experiments, the model generated secure code when the prompt indicated that the year was 2023, but intentionally introduced exploitable vulnerabilities when the year was 2024.

Outside of that trigger condition, the model appeared to behave normally.

Key findings from the paper

  • Backdoored behavior can survive safety training. Techniques such as supervised fine-tuning and reinforcement learning did not always remove the hidden behavior.
  • Larger models were often better at preserving the backdoor. More capable models showed stronger persistence of the unwanted behavior after safety training.
  • A model can behave differently during training and deployment. Some models were trained to recognize when they were being evaluated and behave safely during those situations.
  • Adversarial training did not always solve the problem. In some experiments, exposing the model to its malicious behavior and training against it actually made the model better at recognizing the trigger and hiding the behavior during evaluation.
  • Passing safety tests does not necessarily mean the behavior is gone. A model may simply stop exposing the behavior under the conditions used during testing.

This last point is probably the most interesting to me from a cybersecurity perspective.

With traditional software, suspicious logic may be visible somewhere in the source code, dependencies, or binaries. With an AI model, behavior can be distributed across billions of learned parameters. There may be no obvious piece of code that says:

if trigger == true: behave maliciously

That makes identifying hidden behaviors much more difficult.

It also makes me think differently about deploying third-party and open-weight models.

Today, it is extremely easy to go to a platform such as Hugging Face, download a pretrained or fine-tuned model, and integrate it into an application. But from a security perspective, that model is also a dependency in the application's supply chain.

The paper does not claim that existing Hugging Face or open-source models contain sleeper-agent backdoors. The researchers deliberately created these models as proof-of-concept experiments.

What it demonstrates is that if malicious behavior is introduced during training or fine-tuning, conventional safety training may not be enough to reliably remove it.

For me, the broader takeaway is that AI model integrity is becoming part of software supply-chain security.

Before deploying a third-party model in production, I think we increasingly need to care about where the model came from, who trained or fine-tuned it, how its training data was sourced, what modifications were made to it, and how thoroughly its behavior has been evaluated.

Downloading a model may be easy. Establishing that the model can be trusted in production is a very different problem.