Threat Research

Malicious Payload Delivery Discovered in Guardrails-AI PyPI Package

Malicious Payload Delivery Discovered in Guardrails-AI PyPI Package

Executive Summary:

During an investigation into recent AI-related software supply chain threats targeting the Python ecosystem, suspicious activity was identified involving the guardrails-ai PyPI package, specifically version 0.10.1. The package is a widely used AI validation framework designed to enforce structured outputs, safety controls, and policy validation for Large Language Model (LLM) applications.

Analysis of the malicious release revealed that unauthorized code had been injected directly into the package’s __init__.py file. The injected logic downloaded and executed a remote Python payload on Linux systems whenever the package was imported. The compromise was later confirmed through official advisories published by the project maintainers and security researchers.

This report analyzes the malicious guardrails-ai==0.10.1 release, associated GitHub activity, package metadata, and the payload delivery mechanism observed during the compromise. The analysis highlights how attackers abused trusted software distribution channels and Python import behavior to achieve remote code execution within developer and AI environments.

Malicious-Payload-Delivery-Discovered-in-Guardrails-AI-PyPI-Package-1

Affected Package

The investigation primarily focused on the following package:

  • guardrails-ai==0.10.1— malicious version
  • guardrails-ai==0.10.0— known clean baseline

The malicious package was later quarantined by PyPI, temporarily preventing installations and updates while the incident was investigated.

Malicious-Payload-Delivery-Discovered-in-Guardrails-AI-PyPI-Package-2

Affected Project

Guardrails-AI is an open-source Python framework used to add validation, safety checks, and structured output enforcement to LLM-based applications. The framework is commonly integrated into AI development environments, CI/CD pipelines, cloud infrastructure, and enterprise automation workflows.

The project is widely adopted by developers building applications with platforms including:

  • OpenAI
  • Anthropic
  • Hugging Face
  • Other LLM providers

Because the package often operates in high-trust environments containing API keys, cloud credentials, and development secrets, compromise of the package introduces significant supply chain risk.

Technical Analysis

Unlike several recent npm-focused supply chain attacks that relied on malicious installation scripts or dependency confusion techniques, the Guardrails-AI compromise used a different execution strategy.

The malicious logic was appended directly into the package’s __init__.py file, ensuring execution occurred automatically during package import rather than during installation.

A comparison between guardrails-ai==0.10.0 and guardrails-ai==0.10.1 identified approximately 15 additional lines of code added after the __all__ section. No other package files were modified.

Malicious Payload Delivery Discovered in Guardrails-AI PyPI Package

Malicious Code Behavior

The injected code executes automatically whenever the package is imported into a Python application.

The malicious execution flow performs the following actions:

  1. Verifies the target operating system
  2. Initiates an outbound connection to an external domain
  3. Downloads a remote Python archive payload named transformers.pyz
  4. Writes the payload into the /tmp directory
  5. Executes the downloaded payload using the local Python interpreter

This behavior strongly deviates from expected package initialization logic and is consistent with remote code execution tradecraft commonly observed in software supply chain compromises.

The payload delivery mechanism also demonstrates operational flexibility for the attacker because the final-stage payload is hosted remotely rather than embedded directly inside the package. This allows the threat actor to modify or replace the payload without publishing additional package updates.

Payload Delivery Flow

The observed execution chain can be summarized as follows:

Application Import




guardrails-ai __init__.py



Outbound Network Request



Download transformers.pyz



Write Payload to /tmp



Execute via Python Interpreter

Timeline

Event Date
Malicious package uploaded to PyPI May 11, 2026
Suspicious behavior identified by community May 11–12, 2026
Package quarantined by PyPI May 12, 2026
Official advisory published May 12, 2026

Official Advisory and Maintainer Response

The official GitHub security advisory later confirmed that guardrails-ai==0.10.1 was a malicious release associated with a software supply chain compromise.

According to the advisory, the malicious version was uploaded to PyPI on May 11, 2026, impacting users who installed the package during the exposure window. The maintainers subsequently quarantined the release, identified version 0.10.0 as the last known safe version, and advised affected users to immediately downgrade and review systems for possible compromise.

According to the project’s SECURITY_ADVISORY.md, the compromise originated after an employee’s GitHub Personal Access Token (PAT) was stolen. The attacker then leveraged the compromised token to trigger GitHub Actions workflows across multiple repositories within the Guardrails-AI organization.

This access exposed deployment secrets that were later abused to publish the malicious guardrails-ai==0.10.1 package to PyPI.

Malicious Payload Delivery Discovered in Guardrails-AI PyPI Package

Malicious Payload Delivery Discovered in Guardrails-AI PyPI Package

CVE Reference

The incident was tracked as:

  • CVE-2026-45758

According to the GitLab security advisory, the malicious guardrails-ai==0.10.1 package contained unauthorized functionality capable of downloading and executing a remote payload on Linux systems after package import.

The advisory classified the incident as a software supply chain compromise affecting users who installed the malicious package from PyPI.

Malicious Payload Delivery Discovered in Guardrails-AI PyPI Package

Gurucul SIEM Detection Coverage

Gurucul SIEM can assist security teams in identifying:

  • abnormal Python interpreter behavior,
  • suspicious outbound network activity from developer systems,
  • execution of temporary payloads,
  • and anomalous package execution behavior through behavioral analytics and threat correlation.

 

Indicators of Compromise (IOCs)

Malicious Package

  • guardrails-ai==0.10.1

Network Indicator

  • hxxps://git-tanstack[.]com/transformers[.]pyz

File Hashes

MD5

  • ccf3372c10c1092e4c8fdd8221b1db0e

SHA256

  • 8491b17dc16f31c27f290b3b1e0f2e8866cc775828590e90376ecfb0cc1f8d9c

Conclusion

The Guardrails-AI incident highlights the growing sophistication of software supply chain attacks targeting AI and developer ecosystems. Even trusted and widely adopted packages can become delivery mechanisms for malicious payloads when repository infrastructure, CI/CD workflows, or deployment credentials are compromised.

The compromise also demonstrates how attackers increasingly target high-trust AI frameworks integrated into developer pipelines, cloud infrastructure, and enterprise automation environments. Abuse of trusted dependencies provides adversaries with an effective path to remote code execution, credential theft, and downstream infrastructure compromise.

Organizations should implement stronger dependency governance practices, continuously monitor package integrity, validate dependency updates before deployment, and review CI/CD security controls to reduce exposure to future software supply chain attacks.

References

  • GitHub Security Advisory — GHSA-xmpw-2vmm-p4p6
  • Guardrails-AI SECURITY_ADVISORY.md
  • GitLab Advisory — CVE-2026-45758
  • PyPI Package Metadata

 

Contributors:

 

Siva Prasad Boddu

Siva Prasad Boddu

Rudra Pratap

Rudra Pratap

Advanced cyber security analytics platform visualizing real-time threat intelligence, network vulnerabilities, and data breach prevention metrics on an interactive dashboard for proactive risk management and incident response