---
id: blog/en/agent-framework-pypi-pth-python-startup-2026
type: blog
language: en
title: "agent-framework: installed, never imported, yet its code still runs"
description: Two malicious Python package releases used .pth files to steal secrets whenever the interpreter started, even without an import.
summary: Two malicious Python package releases used .pth files to steal secrets whenever the interpreter started, even without an import.
url: https://rootzero.eu/en/research/agent-framework-pypi-pth-python-startup-2026/
markdown_url: https://rootzero.eu/en/research/agent-framework-pypi-pth-python-startup-2026/index.md
author: rootzero
published: 2026-11-23T00:00:00.000Z
updated: 2026-11-23T00:00:00.000Z
tags:
  - Python
  - Packages
  - Secrets
  - AI
topics:
  - id: supply-chain
    name: Supply chain
    url: https://rootzero.eu/en/research/topics/supply-chain/
  - id: ai-methods
    name: AI and methodology
    url: https://rootzero.eu/en/research/topics/ai-methods/
translations:
  en: https://rootzero.eu/en/research/agent-framework-pypi-pth-python-startup-2026/
  fr: https://rootzero.eu/research/agent-framework-pypi-pth-demarrage-python-2026/
reading_minutes: 3
content_origin: source-analysis
research_reference: null
research_status: null
vulnerabilities: []
references:
  - label: GitHub’s wheel analysis
    url: https://github.com/advisories/GHSA-764m-3ppc-5m73
  - label: Socket’s investigation
    url: https://www.socket.dev/blog/agent-framework-pypi-package-compromised-with-credential-stealer
  - label: Python’s documentation
    url: https://docs.python.org/3.14/library/site.html
sections:
  - title: Why interpreter startup is enough
    level: 2
    url: https://rootzero.eu/en/research/agent-framework-pypi-pth-python-startup-2026/#why-interpreter-startup-is-enough
  - title: Establishing which environments were exposed
    level: 2
    url: https://rootzero.eu/en/research/agent-framework-pypi-pth-python-startup-2026/#establishing-which-environments-were-exposed
---

# agent-framework: installed, never imported, yet its code still runs

> Two malicious Python package releases used .pth files to steal secrets whenever the interpreter started, even without an import.

**Malicious releases published on 17 November 2026.** Versions **1.26.1 and 1.26.2** of the legitimate PyPI package `agent-framework` added a credential stealer absent from the last examined clean release, **1.26.0**. [GitHub’s wheel analysis](https://github.com/advisories/GHSA-764m-3ppc-5m73) and [Socket’s investigation](https://www.socket.dev/blog/agent-framework-pypi-package-compromised-with-credential-stealer) agree on the decisive behavior: the code could run **without the application importing `agent_framework`**. A bad release in a cache does not prove execution. Installation in an environment that subsequently started Python changes the assessment.

## Why interpreter startup is enough

At ordinary startup, Python loads `site`, which processes certain `.pth` files in `site-packages`. [Python’s documentation](https://docs.python.org/3.14/library/site.html) says a line beginning with `import` runs at every interpreter startup, even if the package’s module will never be used. This long-standing feature can prepare import paths or hooks. It also creates an execution surface when a wheel is installed.

For 1.26.1, Socket identifies the chain `agent_framework_meta.pth` → `agent_framework_meta` initialization → `_telemetry.py`. Version 1.26.2 uses different names, `af_runtime_diag.pth` and `af_runtime_diag.py`. The code presented itself as diagnostics, started collection quietly and suppressed errors. Researchers describe reading environment variables, credential files and process data, plus requests for cloud and workflow identity tokens. Data was sent to an attacker-controlled destination. Those capabilities do not prove every targeted secret existed on every infected machine.

The difference between the wheels matters for hunting. According to [GitHub’s file analysis](https://github.com/advisories/GHSA-764m-3ppc-5m73), 1.26.1 also changes the initialization of `agent_framework_meta`; 1.26.2 restores that file to its clean form and moves the startup trigger to `af_runtime_diag.pth`. A search only for `_telemetry.py` therefore misses the second release. Application imports of the package reveal neither startup payload.

```text
install poisoned wheel
    -> .pth file placed in site-packages
    -> ordinary python or pip startup
    -> .pth import line executes
    -> collection runs with the process's permissions
```

`pip` itself is a Python application. A command used to inspect or remove the package can start the interpreter and process the `.pth` before doing its intended work. [Python’s documentation](https://docs.python.org/3.14/library/site.html) describes `python -S` as a startup without automatically importing `site`, useful for controlled inspection. That mechanism is not a complete clean-up procedure for an already compromised host.

## Establishing which environments were exposed

Investigation must distinguish **resolution**, **installation** and **execution**. A lockfile naming a malicious version identifies a rebuild risk. A wheel in a cache or mirror can contaminate a future installation. A virtual environment or image where the `.pth` was installed and Python then ran implies possible exposure of secrets available to that process. CI logs, image histories and package metadata help date these steps.

| Evidence | Supported conclusion | Remaining question |
| --- | --- | --- |
| 1.26.1 or 1.26.2 in a lockfile | A rebuild could request it | Was it downloaded and installed? |
| Wheel in a cache or mirror | A copy remains available | Was it installed in an executed environment? |
| Malicious `.pth` in `site-packages` | The environment is contaminated | Which Python processes started after installation? |
| Correlated Python starts and network access | The payload may have activated | Which secrets existed, and what actually left the host? |

Both releases were removed from PyPI, according to the [GitHub advisory](https://github.com/advisories/GHSA-764m-3ppc-5m73). `pip install --upgrade` alone does not repair existing images, internal caches or credentials that may already have been copied. The response should inventory those copies, rebuild affected environments from controlled sources and **revoke secrets accessible from them**. Rotation scope follows the job’s or workstation’s permissions: CI variables, cloud identities, publication tokens and repository credentials have different reach.

This case exposes a testable property of Python packages: reviewing only the APIs imported by an application cannot qualify a dependency. For sensitive versions, inspect the installed wheel, its startup files and its provenance.

**Primary sources:** [GitHub advisory and wheel analysis](https://github.com/advisories/GHSA-764m-3ppc-5m73), [Socket analysis](https://www.socket.dev/blog/agent-framework-pypi-package-compromised-with-credential-stealer), [Python `.pth` documentation](https://docs.python.org/3.14/library/site.html).
