AI Dependencies Under Attack: What the LiteLLM Compromise Teaches Developers

The LiteLLM 1.107.0 compromise shows how malicious code can pass through legitimate software publishing systems, and what developers should verify beyond provenance.

Read in: English · తెలుగు · हिन्दी

Sign in to save

Flow diagram: an intended source repository and an attacker-chosen lookalike source both feed a release workflow, which publishes through an official package registry to a developer environment. Authenticity and provenance checks pass, but code trust is not proven.

A development team installs a package from the official registry. The package has the expected name, version and publisher. It came through the project’s normal release process, with provenance that identifies how it was built.

Those are meaningful trust signals. But they cannot establish that nobody with authority over the release changed the code being built.

On October 21, 2026, LiteLLM’s normal publishing process distributed malicious version 1.107.0 to PyPI and its official container registries. LiteLLM’s subsequent investigation described how an attacker obtained powerful GitHub credentials, changed a private release workflow and directed it to build code from a lookalike repository. Independent researchers examined the malicious package and found mechanisms to collect credentials when Python started. (LiteLLM’s incident investigation, Microsoft’s payload analysis and Datadog’s independent analysis)

The incident offers a practical lesson for developers who use AI gateways and other third-party software. Checking where a package came from is important. It is not the same as knowing that the code inside it is trustworthy.

The release looked legitimate because the process was legitimate

LiteLLM provides software that applications can use to connect to different language-model providers. In that position, it may handle API keys and other important configuration. It is also installed in development environments and automated builds.

According to LiteLLM’s October 23 investigation, the attack began well before the malicious release appeared. In May, an administrative key for an experimental internal Agent Platform was committed to a public repository. The file was removed after several hours, but the key remained valid. LiteLLM reported that an attacker used it on October 10 to access the Agent Platform and obtain a GitHub CLI OAuth token associated with an organization owner. (LiteLLM’s reported investigation)

This detail matters because a leaked secret is not necessarily harmless after its file is deleted. If the secret remains valid, the system accepting it can still grant access. The scope of that access determines how far a compromise can spread.

LiteLLM reported that the attacker used the owner-level token to run workflows that exposed additional secrets. On October 21, the attacker changed a private release workflow to accept a configurable source repository owner. A normal branch-protection rule rejected an initial push. The organization-owner credential allowed the change to go through anyway. (LiteLLM’s reported investigation)

The altered workflow then built from Berri-AI/litellm, a lookalike repository, rather than the legitimate BerriAI/litellm source. According to LiteLLM, a second maintainer’s stolen token approved the production release gate, while the organization-owner credential ran the staging dispatch. The resulting artifacts reached official distribution channels through the expected release infrastructure. (LiteLLM investigation and Datadog analysis)

How a legitimate release carried code from a lookalike sourceFive steps: a leaked key in May, a stolen owner token on October 10, a changed release workflow on October 21, a build from a lookalike source, and a release installed from the official registries.1Key leakedMayAdmin key committed to a public repo2Token takenOctober 10Key opens the Agent Platform, owner token3Workflow changedOctober 21Release workflow edited to take a source owner4Lookalike builtOctober 21Builds from Berri-AI/litellm, a lookalike5Release installedOctober 21Reaches PyPI and the container registries
Figure 1. The path reported by LiteLLM. Select a step to read what was reported. The sources differ on some details, and Microsoft did not independently determine how the first access happened.
Key leaked

In May, an administrative key for an experimental internal Agent Platform was committed to a public repository. The file was removed after several hours, but the key remained valid, according to LiteLLM.

Token taken

LiteLLM reported that an attacker used that key on October 10 to access the Agent Platform and obtain a GitHub CLI OAuth token associated with an organization owner.

Workflow changed

LiteLLM reported that the attacker used the owner-level token to run workflows that exposed additional secrets. On October 21, the attacker changed a private release workflow to accept a configurable source repository owner. Branch protection rejected an initial push, but the organization-owner credential allowed the change through.

Lookalike built

The altered workflow built from Berri-AI/litellm, a lookalike repository, rather than the legitimate BerriAI/litellm source. According to LiteLLM, a second maintainer’s stolen token approved the production release gate, while the organization-owner credential ran the staging dispatch.

Release installed

The artifacts reached official distribution channels through the expected release infrastructure. Datadog reported that they carried seemingly legitimate build provenance that accurately identified the malicious fork as their source. Installing the package could be enough, because Python can run startup files when it starts.

Microsoft’s independent payload investigation supports the release-compromise narrative, but explicitly states that it did not independently determine how the initial upstream access and credential theft occurred. That part of the sequence should therefore be understood as LiteLLM’s reported forensic finding. (Microsoft Security Research)

LiteLLM’s timeline puts the malicious release online at about 11:39 UTC on October 21. A public issue reported a problem at about 12:06, PyPI quarantined the release by about 13:23 and the container registries followed by about 13:51, a window LiteLLM describes as roughly two hours. Datadog reports the PyPI quarantine at about 13:20 and the container images removed at about 13:53, also roughly two hours, and gives no detection time. The two accounts differ by minutes, not in the overall picture. (LiteLLM’s reported investigation and Datadog analysis)

October 21 timeline, UTCLiteLLM published the malicious release at about 11:39 UTC, a public issue reported a problem at about 12:06, PyPI quarantined it by about 13:23 and the container registries followed by about 13:51, roughly two hours. Datadog gives 13:20 and 13:53.11:39Malicious 1.107.0 published (LiteLLM)12:06A public issue reports a problem (LiteLLM)13:23PyPI quarantine (Datadog: 13:20)13:51Container registries (Datadog: 13:53)about 2 hours
Figure 3. October 21, 2026, times in UTC, as reported by LiteLLM. Datadog’s times differ by a few minutes and it gives no detection time.

A trusted publishing route does not guarantee trusted source code

It is useful to separate three questions.

Authenticity asks whether an artifact came from the expected publisher. Provenance describes the process and recorded source that produced it. Code trustworthiness asks whether the resulting software is safe to execute.

Three different questions about a releaseAuthenticity and provenance can be checked and pass in the incident, code trustworthiness is not settled by them.Authenticity✓Provenance✓Code trust?
Figure 2. Three separate questions. In the LiteLLM incident the first two could look right while the third was not settled.
Authenticity: Did it come from the expected publisher?

Authenticity asks whether an artifact came from the expected publisher.

In the LiteLLM incident, the malicious version came from the project’s normal publishing process, to PyPI and its official container registries.

Provenance: Which process and source built it?

Provenance describes the process and recorded source that produced an artifact. A provenance record can identify the workflow and source repository, without deciding whether that source was authorized or safe.

Datadog reported that the published artifacts carried seemingly legitimate build provenance that accurately identified the malicious fork as their source.

Code trustworthiness: Is the code safe to run?

Code trustworthiness asks whether the resulting software is safe to execute.

These properties are related, but they are not interchangeable. The malicious release used Python startup behavior, so installing it could be enough to run the payload.

These properties are related, but they are not interchangeable.

A build record or provenance attestation can identify the workflow and source repository used to create an artifact, without deciding whether that source was authorized or safe. In the LiteLLM incident, the attacker influenced which source the legitimate workflow built. Datadog reported that the published artifacts carried seemingly legitimate build provenance that accurately identified the malicious fork as their source. (Datadog Security Labs)

This is not a reason to abandon signing, provenance verification or Trusted Publishing. These controls can help verify an artifact’s origin or reduce reliance on long-lived publisher credentials. They do not by themselves determine whether a privileged publisher identity was compromised or whether the build selected the intended source. LiteLLM’s October 30 follow-up reports that its own pipeline signed the artifacts and that they carried valid Trusted Publishing provenance. (LiteLLM’s follow-up)

For a development team, the distinction changes how a dependency should be evaluated. Trust does not end at the package registry. It also depends on publisher identities, approved source repositories, build permissions and the environment where the package runs.

Why installing this package could be enough

The malicious LiteLLM release did not depend on a developer asking an AI model the wrong question. It used ordinary Python startup behavior.

Microsoft and Datadog found three malicious files delivered by the affected wheel: cook.pth, cook.py and sitecustomize.py. Python can process certain .pth instructions and load sitecustomize during interpreter initialization. In an affected environment, starting Python could activate malicious code even if the application never imported LiteLLM. (Microsoft analysis and Datadog analysis)

That widened the potential exposure beyond systems actively using LiteLLM as a gateway. A developer laptop, test container or build agent could run Python for an unrelated task after the compromised package was installed.

The recovered payload targeted accessible cloud credentials, developer and source-control credentials, AI-provider keys, browser data, SSH material and some LiteLLM database records. It also included a mechanism that could retrieve additional code. Researchers did not observe a second stage being delivered, although Microsoft noted that the loader could be re-armed. (Microsoft analysis and Datadog analysis)

Targeting a credential is not proof that the attacker obtained it. The impact on any specific environment depends on which files and identities were accessible, whether the payload executed long enough, whether transmission succeeded and whether the credentials remained valid.

That distinction should shape both security reporting and incident response. The affected release was dangerous. It does not follow that every download caused a confirmed breach.

Why removing the package may not restore trust

The malicious startup files could be installed outside LiteLLM’s ordinary application directory. Removing that directory alone could leave the Python environment able to execute the payload again. Both Microsoft and Datadog warned against treating normal package removal as complete recovery. (Microsoft analysis and Datadog analysis)

There is also a practical investigation trap. Running the affected environment’s Python or pip to inspect it can trigger the same startup behavior. Teams investigating a potentially compromised machine should use clean tools and an isolated workflow rather than executing the suspect environment.

For organizations that may have installed version 1.107.0, the response should be guided by the authoritative advisories and their own security team. Identify affected hosts, workstations, containers and build environments. Isolate or rebuild suspect environments, investigate possible execution and outbound activity, and rotate credentials that the compromised process could access from a clean environment. Review relevant audit logs for subsequent misuse. (Microsoft analysis and Datadog analysis)

A rebuild and credential review can be more work than removing one package. That work addresses the actual risk, which is not limited to the continued presence of LiteLLM itself.

What this incident changes for developers

The immediate lesson is to make dependency trust more specific.

For teams consuming packages, version pinning and controlled dependency updates reduce unplanned exposure. They do not make a pinned malicious version safe. Package scanning and provenance checks add useful evidence, but the team still needs a way to identify affected deployments quickly, rebuild environments and rotate the credentials that those environments can reach.

For teams publishing software, source selection must be constrained independently from the authority to run a release. Release workflows should not be able to build from arbitrary lookalike repositories merely because a privileged account supplies an input. Publisher credentials, owner-level accounts and CI secrets should have the minimum necessary scope and lifetime. Where a leaked key is discovered, removing it from source control must be followed by revocation and exposure assessment.

For platform and security teams, the most important question is often how far a compromised dependency can reach. An AI gateway may sit beside provider keys, cloud workload credentials and database access. Those permissions should be bounded so that compromise of one process does not automatically expose an organization’s wider infrastructure.

None of these steps guarantees immunity. Together they reduce the opportunity for one compromised release to become a larger identity and infrastructure incident.

How this differs from an attack on a running AI server

TechiesJournal’s separate PoeLLM coverage examines attackers exploiting vulnerable AI and developer services, including a LiteLLM MCP authorization flaw. That is a runtime exposure problem: an attacker reaches software already deployed.

The October 21 incident crossed a different boundary. Malicious code arrived through the software delivery process itself. A team could install the compromised version from an official source without first exposing a vulnerable public endpoint.

The distinction matters when deciding what to inspect. Runtime hardening and patching address exposed-service weaknesses. Dependency provenance, source restrictions, publisher identity, credential isolation and recovery readiness address different parts of software supply-chain risk. Organizations need both.

QuestionAttack on a running AI serverCompromised release
How the malicious code arrivesAn attacker reaches software that is already deployed.It arrives through the software delivery process itself.
What a team could do to be exposedRun a vulnerable public endpoint.Install the compromised version from an official source.
What to inspectRuntime hardening and patching.Dependency provenance, source restrictions, publisher identity, credential isolation and recovery readiness.

What a trustworthy release can and cannot tell you

A legitimate release process is valuable, and the October incident does not change that. It shows that a release process inherits the security of the identities and sources it trusts.

Developers should continue to use official channels, controlled updates, verified provenance and signatures where supported. They should also recognize what each signal proves. A genuine publishing record can identify the release process while leaving unanswered whether the authority controlling that process was compromised.

The practical next step is not to distrust every AI tool. It is to review where AI dependencies run, what credentials they can access, how their updates are approved and how quickly a compromised version can be removed without leaving the environment or its secrets exposed.

Go deeper

  1. LiteLLM: The attack chain behind the v1.107.0 LiteLLM release (October 23, 2026). Maintainer investigation of the credential chain, workflow manipulation and release timeline.
  2. Microsoft Security Research: Inside the LiteLLM 1.107.0 supply chain compromise (October 23, 2026). Independent research on Python startup execution, credential collection and response.
  3. Datadog Security Labs, LiteLLM supply chain compromise: What you need to know (October 21, 2026). Independent artifact analysis, distribution tags and remediation guidance.
  4. LiteLLM: What we are changing after October 21 (October 30, 2026). Maintainer follow-up on signing and planned security controls. The controls are plans, not completed work.
Report a correction

Corrections go to the editor and are never published automatically. No account needed.