High 3 Hunt LeadsIOCsAikido

Poisoned Microsoft AI SDK on PyPI Stole Cloud Keys on Every Python Start

Aikido says two malicious releases of Microsoft's agent-framework PyPI package, published 33 minutes apart on Nov. 17, ran a credential stealer on every Python start, targeting Azure, Azure DevOps and GitHub Actions secrets. Pin 1.26.0 and rotate secrets.

Someone with valid publishing credentials pushed two poisoned releases of agent-framework, the PyPI meta-package for Microsoft’s Agent Framework AI SDK, on Nov. 17. Aikido says versions 1.26.1 and 1.26.2 went up 33 minutes apart and carried a credential stealer that fires every time Python starts, aimed at Azure, Azure DevOps and GitHub Actions secrets. Both were pulled by about 21:20 UTC, but the package gets roughly 190,000 downloads a month, and any CI job that resolved a fresh install in that window ran the stealer.

For defenders

What’s affected: agent-framework 1.26.1 (published 20:35 UTC) and 1.26.2 (21:08 UTC) on Nov. 17, 2026. 1.26.0 is clean; pin to it. No CVE. How the attacker got the publishing credentials isn’t known yet. Aikido’s tell: Microsoft ships a wheel and an sdist together, while both bad releases were a lone wheel repacked by hand, T1195.002 (Supply Chain Compromise: Compromise Software Supply Chain).

How it runs: a .pth file in site-packages (agent_framework_meta.pth, later af_runtime_diag.pth) holds an import line, so Python’s site module runs the payload on every interpreter launch, even pip or pytest, with nothing importing the package, T1546.018 (Event Triggered Execution: Python Startup Hooks). It forks into the background and sets _AF_TEL=1 so it runs once per process tree.

What it takes: secret-looking environment variables, including from up to 300 other processes via /proc/<pid>/environ; Azure CLI, pip, npm, git, Docker, Hugging Face and Azure DevOps agent credential files, T1552.001 (Unsecured Credentials: Credentials In Files); managed identity tokens for 12 Azure resources from IMDS or the App Service identity endpoint, T1552.005 (Unsecured Credentials: Cloud Instance Metadata API); and Azure DevOps and (in 1.26.2) GitHub Actions OIDC tokens that can be swapped for Azure access, T1528 (Steal Application Access Token). Everything goes out in one compressed POST to a webhook.site token, T1567.004 (Exfiltration Over Web Service: Exfiltration Over Webhook).

Network
hxxps://webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb?t=telemetry
User-Agent: af-runtime-diagnostics/1 (1.26.1) ; runtime-diagnostics/1 (1.26.2)

Host
agent_framework_meta.pth ; af_runtime_diag.pth ; af_runtime_diag.py (top level of site-packages)
Environment variable _AF_TEL=1 in Python processes

What it means for you

This one is aimed at software teams building AI tools on Microsoft’s cloud, not at home users. If nobody at your company writes Python or installs this package, there’s nothing to do. If they do, the risk is that the passwords and keys your build systems use to reach Azure or GitHub were copied out in a 45-minute window, and stolen keys keep working until someone changes them.

Do this now

  1. Run pip show agent-framework and search every environment, CI cache and container image built since Nov. 17 for the two .pth files above.
  2. Pin agent-framework==1.26.0 and rebuild anything that pulled 1.26.1 or 1.26.2.
  3. On any affected machine or pipeline, rotate every secret it could reach: Azure DevOps tokens and service connections, service principal credentials, GitHub, npm, PyPI, Hugging Face and Docker tokens, and .env contents.
  4. Review Entra ID sign-in logs for your pipeline service principals and federated credentials since Nov. 17.

Source article: Two malicious agent-framework releases hit PyPI in 33 minutes
Publisher: Aikido
Published: Nov. 17, 2026
URL: https://www.aikido.dev/blog/two-malicious-agent-framework-releases-hit-pypi-in-33-minutes

Executive Summary

On Nov. 17, 2026 an unknown attacker holding valid PyPI publishing credentials for agent-framework, the meta-package for Microsoft Agent Framework (Microsoft’s Python SDK for building AI agents), uploaded two malicious releases 33 minutes apart: 1.26.1 at 20:35 UTC and 1.26.2 at 21:08 UTC, both removed by about 21:20 UTC. No actor has been named and the credential theft behind it is unexplained. Each release was a hand-repacked wheel with no matching sdist that added a .pth startup hook, so the payload runs on every Python interpreter start in the environment, including pip and test runners, without the package ever being imported. The payload forks into the background, sweeps secret-like environment variables from its own and up to 300 other processes, reads well-known credential files (Azure CLI, pip, npm, git, Docker, Hugging Face and Azure DevOps agent credentials, container app .env files), requests managed identity tokens for 12 Azure resources from IMDS or the App Service identity endpoint, tries to mint Azure DevOps OIDC tokens and, in 1.26.2, GitHub Actions OIDC tokens usable for Entra ID workload identity federation, then posts everything compressed and base64-encoded to a webhook.site token. The objective is theft of cloud and CI/CD credentials from the build systems and AI developer machines most likely to install the SDK, for follow-on access to Azure tenants, source code and package registries; the same .pth technique was used in the March 2026 LiteLLM compromise. Hunt leads, false positive expectations and indicators are detailed below; no published detection rules accompany the source.

ATT&CK chain: Initial Access → Execution → Persistence → Credential Access → Exfiltration

Hunt Lead Grid

Hunt Lead Level Hunt Lead Name ATT&CK Risk of False Positives
1 (Junior) agent-framework 1.26.1 and 1.26.2 Install and Webhook Sweep T1195.002 (Supply Chain Compromise: Compromise Software Supply Chain), T1567.004 (Exfiltration Over Web Service: Exfiltration Over Webhook) Low. The package versions, file names, hashes, webhook token and both User-Agent strings are unique to this release pair; developers do use webhook.site for testing, which is why the hunt anchors on this exact token path and these User-Agents rather than the domain.
2 (Pro) Code-Executing .pth Files in site-packages T1546.018 (Event Triggered Execution: Python Startup Hooks) Medium. Legitimate packages ship .pth files, and a few (editable installs, coverage, setuptools’ distutils shim) contain import lines; the rule anchors on a new .pth with an import line that doesn’t match an allowlist of known package hooks.
3 (Elite) Python Process Harvesting CI and Cloud Identity Tokens T1552.005 (Unsecured Credentials: Cloud Instance Metadata API), T1528 (Steal Application Access Token), T1552.001 (Unsecured Credentials: Credentials In Files) Medium. Azure SDK code legitimately requests managed identity and OIDC tokens; the correlation anchors on one detached Python process doing all of it at once (many-resource token requests, bulk /proc/*/environ reads, credential file reads) followed by an outbound POST to a non-Azure host.

agent-framework 1.26.1 and 1.26.2 Install and Webhook Sweep

Between 20:35 and about 21:20 UTC on Nov. 17, 2026, any install that resolved agent-framework without a strict pin (for example agent-framework>=1.26, or a Dependabot or Renovate bump) received 1.26.1 or 1.26.2. 1.26.1 added agent_framework_meta.pth (one line, import agent_framework_meta), agent_framework_meta/_telemetry.py and a loader appended to agent_framework_meta/__init__.py; 1.26.2 restored the clean __init__.py and moved the payload to a top-level af_runtime_diag.py loaded by af_runtime_diag.pth. Both versions exfiltrate to the same token, hxxps://webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb with ?t=telemetry, using User-Agent af-runtime-diagnostics/1 (1.26.1) or runtime-diagnostics/1 (1.26.2), and set _AF_TEL=1 in the environment of Python processes. The detection is a retrospective sweep: lockfiles, pip logs, CI logs and SBOMs for agent-framework==1.26.1 or 1.26.2; file systems, CI caches and container image layers for the three file names and the SHA256 hashes in the appendix; and proxy, DNS and egress logs for the webhook token path and either User-Agent.

Use dependency inventories (SBOMs, lockfiles, artifact repository download logs if you proxy PyPI) first, because they cover ephemeral CI runners that no longer exist, then file-system scans of developer machines, self-hosted runners and image registries, then web proxy and egress firewall logs. Sweep from Nov. 17 onward and include container images built since then, since a cached layer can keep the stealer alive after the package was pulled from PyPI. Don’t block webhook.site outright on the strength of this one token if developers use it legitimately; alert on the token path and the two User-Agents instead, and consider whether build systems need to reach request-inspection services at all. Hash blocking is weak here because the attacker re-shipped within 33 minutes under new names. Any confirmed install on a machine with cloud or CI credentials goes straight to incident response with full secret rotation, because the data left in a single request the moment Python started; removing the package undoes nothing.

Hunt Lead Level: 1 (Junior Analyst)

ATT&CK: Initial Access → T1195.002 (Supply Chain Compromise: Compromise Software Supply Chain); Exfiltration → T1567.004 (Exfiltration Over Web Service: Exfiltration Over Webhook)

Sources: “Two malicious agent-framework releases hit PyPI in 33 minutes”, Aikido, Nov. 17, 2026, https://www.aikido.dev/blog/two-malicious-agent-framework-releases-hit-pypi-in-33-minutes (source article)

Code-Executing .pth Files in site-packages

Python’s site module reads every .pth file in site-packages at interpreter start and executes any line beginning with import. Because wheels can’t run code at install time, the attacker used this as an install-and-every-launch hook: the payload ran whenever any Python process started in the environment, so test runs, pip itself and unrelated scripts all triggered it, and it forked and called setsid() to keep running after the triggering command returned (a daemon thread on Windows). The technique isn’t tied to this package; Aikido notes the March 2026 LiteLLM compromise used the same hook, and an attacker who swaps file names between releases defeats name-based detection. The detection logic is any file creation of a *.pth file under a site-packages or dist-packages directory whose content includes a line starting with import, compared against an allowlist of known legitimate hooks, plus a periodic inventory of existing .pth files with import lines across developer machines, runners and images.

Collect file-creation events from EDR on developer workstations and self-hosted runners, and add a build-time step that lists every .pth file with an import line in each built image or virtual environment and diffs it against the last known-good build. Build the allowlist by package and content (editable-install finders, coverage, distutils precedence shims) rather than by file name, since the attacker chose names that look like part of the legitimate package. Scope first to build servers, CI images and developer machines of teams that use AI SDKs, which hold the most valuable credentials. A new, unexplained import-line .pth should be triaged by reading the module it imports; if that module touches the network or environment, escalate. Python offers no switch to disable .pth execution, so blocking the mechanism isn’t an option; detection and dependency pinning with hash checking (pip install --require-hashes) are the controls. This lead catches future PyPI compromises that use the same hook, whatever the package.

Hunt Lead Level: 2 (Pro)

ATT&CK: Persistence → T1546.018 (Event Triggered Execution: Python Startup Hooks); Execution → T1059.006 (Command and Scripting Interpreter: Python)

Sources: “Two malicious agent-framework releases hit PyPI in 33 minutes”, Aikido, Nov. 17, 2026 (source article)

Python Process Harvesting CI and Cloud Identity Tokens

Once running, the stealer did several things in quick succession from one detached Python process. It read /proc/[0-9]*/environ for up to 300 processes looking for strings such as SYSTEM_ACCESSTOKEN, IDENTITY_HEADER, TOKEN and SECRET; globbed up to 60 (1.26.1) or 80 (1.26.2) credential files including ~/.azure/*.json, .npmrc, .netrc, .git-credentials, Docker config.json, Azure DevOps agent .credentials files under _work and vss-agent, and .env files in /app and /workspace; requested managed identity tokens for 12 Azure resources (including Resource Manager, Graph, Key Vault, Storage, Azure ML, AI Foundry, Container Registry and Azure DevOps resource ID 499b84ac-1321-427f-aa17-267ca6975798) from IDENTITY_ENDPOINT or IMDS at 169.254.169.254; POSTed to SYSTEM_OIDCREQUESTURI with the pipeline’s SYSTEM_ACCESSTOKEN asking for the api://AzureADTokenExchange scope; and in 1.26.2 called ACTIONS_ID_TOKEN_REQUEST_URL with audiences api://AzureADTokenExchange and https://management.azure.com/. It then made one outbound POST of a zlib-compressed, base64-encoded JSON body. The correlation to build is a single Python process (or its forked child with a new session) that requests tokens for more than a handful of distinct Azure resources within seconds, or requests an OIDC token outside an Azure login step, and within the same minute either reads other processes’ environ files or makes an outbound POST to a host that isn’t an Azure, GitHub or approved package endpoint.

This needs joined telemetry: process and file-read events from EDR or auditd on Linux runners and VMs (auditd watches on /proc/*/environ are noisy, so prefer EDR file-access events filtered to Python images), local HTTP calls to 169.254.169.254 and the identity endpoint where your platform logs them, Azure DevOps and GitHub audit logs for OIDC token issuance, Entra ID service principal and workload identity sign-in logs, and egress proxy logs for the outbound POST. Baseline which pipelines legitimately request OIDC tokens and in which step (usually an AzureCLI task or azure/login action) and alert on requests outside those steps. On the identity side, a service principal or federated credential signing in from an IP outside your runners’ ranges after Nov. 17 is a strong signal on its own. Revoking the stolen OIDC tokens isn’t enough, as they’re short-lived and the attacker may already have exchanged them; rotate service connection credentials and review what the service principals did. The lead generalises to most CI credential stealers seen in 2026 supply-chain attacks, which follow the same harvest-then-single-POST pattern.

Hunt Lead Level: 3 (Elite)

ATT&CK: Credential Access → T1552.005 (Unsecured Credentials: Cloud Instance Metadata API), T1528 (Steal Application Access Token), T1552.001 (Unsecured Credentials: Credentials In Files); Defense Evasion → T1027 (Obfuscated Files or Information) for the base64-encoded exfiltration URL

Sources: “Two malicious agent-framework releases hit PyPI in 33 minutes”, Aikido, Nov. 17, 2026 (source article)

Hash Appendix

agent-framework 1.26.1

SHA256 hashes are from the source article. Aikido published no MD5 or SHA1 values, and none were looked up in OTX AlienVault or VirusTotal for this report.

MD5s

(not available)  # agent_framework-1.26.1-py3-none-any.whl -> malicious wheel
(not available)  # agent_framework_meta/_telemetry.py -> credential stealer payload
(not available)  # agent_framework_meta/__init__.py -> package init with loader appended
(not available)  # agent_framework_meta.pth -> startup hook in site-packages

SHA1s

(not available)  # agent_framework-1.26.1-py3-none-any.whl -> malicious wheel
(not available)  # agent_framework_meta/_telemetry.py -> credential stealer payload
(not available)  # agent_framework_meta/__init__.py -> package init with loader appended
(not available)  # agent_framework_meta.pth -> startup hook in site-packages

SHA256s

d27fa34414e6201d5e03e559ef634f020057554d7b3f4898dd5d7cd3e989e110  # agent_framework-1.26.1-py3-none-any.whl -> malicious wheel
39fa329f2a93f734b0bb8f5adb203ea3331d1ae479832a5015a54cb17aabd663  # agent_framework_meta/_telemetry.py -> credential stealer payload
c275ccbe520ef3c0f02dc6a35389e427f9f1b4e0b12e140cd7bf7179ce143f02  # agent_framework_meta/__init__.py -> package init with loader appended
21f28e8517a10ffe431f8d68f5875c85eca4001ae6d118322b0a41873998eb5e  # agent_framework_meta.pth -> startup hook in site-packages

agent-framework 1.26.2

SHA256 hashes are from the source article. Aikido published no MD5 or SHA1 values, and none were looked up in OTX AlienVault or VirusTotal for this report.

MD5s

(not available)  # agent_framework-1.26.2-py3-none-any.whl -> malicious wheel
(not available)  # af_runtime_diag.py -> credential stealer payload, top level of site-packages
(not available)  # af_runtime_diag.pth -> startup hook in site-packages

SHA1s

(not available)  # agent_framework-1.26.2-py3-none-any.whl -> malicious wheel
(not available)  # af_runtime_diag.py -> credential stealer payload, top level of site-packages
(not available)  # af_runtime_diag.pth -> startup hook in site-packages

SHA256s

3d20a8bc91351a9a16b6db243b848ceca0206b7a8623b02d2af553a9c9f7e0a9  # agent_framework-1.26.2-py3-none-any.whl -> malicious wheel
54d885b7d7161c9ed96489c66364c4bfbf635929166843bba10d97d46b5a2e1f  # af_runtime_diag.py -> credential stealer payload, top level of site-packages
325e7e9f0ec94e41ad1a1b7a3f18a6b8b5bffece2e2b97b8d3369eb967452f93  # af_runtime_diag.pth -> startup hook in site-packages

References Appendix

  • “Two malicious agent-framework releases hit PyPI in 33 minutes”, Aikido, Nov. 17, 2026, https://www.aikido.dev/blog/two-malicious-agent-framework-releases-hit-pypi-in-33-minutes

More from the Roundup