← Back to blog
Engineering#agent-security

Microsoft agent-framework PyPI Compromise: How a .pth Startup Hook Stole Credentials Without an Import

Two malicious releases of Microsoft's agent-framework package (1.26.1 and 1.26.2) hid a credential stealer in a Python .pth file, so it ran every time Python started, even if nothing imported the framework. How the hook works, what it collected, what is known about the root cause, and how to check, clean up and rotate without setting it off again.

15 min readby the editors
Microsoft agent-framework PyPI Compromise: How a .pth Startup Hook Stole Credentials Without an Import cover illustration

On 17 November 2026, two malicious versions of Microsoft's agent-framework package, 1.26.1 and 1.26.2, were published to PyPI under the real project name. Both carried a credential stealer dressed up as runtime telemetry. The part that matters most for anyone triaging it: the stealer was launched from a .pth file in site-packages, and Python executes those at interpreter startup. You did not need to import agent_framework for it to run. Any Python process in that environment would do, including pytest, a build script, or pip itself. PyPI quarantined both versions within about 45 minutes, but lockfiles, caches, mirrors and container images built in that window can still hold them. This post explains how the hook works, what the stealer went after, what is and is not known about how the releases got published, and how to check and clean up without triggering it again. The last clean version is 1.26.0.

Before you start

System requirements

Who this is for

Anyone who installs agent-framework, and anyone running Python in CI

AI engineers, Python developers, DevSecOps and cloud security teams. Steps 06 to 09 are the incident response part. Step 10 applies to every Python dependency, not only this one.

Affected versions

agent-framework 1.26.1 and 1.26.2 only

GitHub advisory GHSA-764m-3ppc-5m73 lists exactly these two as malicious, with no patched version because the fix is to not have them. 1.26.0 (12 November 2026) is the last clean release and was still the latest on PyPI when we checked on 23 November.

Exposure window

17 Nov 2026, 20:35 to 21:16 UTC on PyPI

That is when the versions could be freshly resolved from PyPI. Anything that cached or vendored them (pip and uv caches, internal mirrors, Docker images, CI caches) can still install them after that.

Primary sources

Wiz, StepSecurity, JFrog, Elastic, CSA, the GitHub advisory and Python's docs

Wiz's post (17 Nov, updated 18 Nov 14:00 UTC), StepSecurity, JFrog and Elastic (18 Nov), the Cloud Security Alliance research note (19 Nov), GHSA-764m-3ppc-5m73 and the Python 3.15 site module docs. We read all of them on 23 November 2026.

01

What happened, in one paragraph

Two wheel-only releases with a .pth startup hook, live on PyPI for 41 minutes between them.

Microsoft Agent Framework is Microsoft's open-source framework for building AI agents and multi-agent workflows in Python and .NET. Its Python package, agent-framework, gets roughly 40,000 downloads a week (Wiz and JFrog) or about 196,000 a month (Elastic). The two numbers measure different windows and roughly agree.

At 20:35 UTC on 17 November, version 1.26.1 appeared on PyPI. It was a wheel only, where the clean 1.26.0 had shipped a wheel and a source distribution. Elastic's supply-chain monitor flagged it at 20:41, six minutes later. PyPI quarantined it at 21:06. Two minutes after that, at 21:08, version 1.26.2 appeared with the same stealer under new file names and a new GitHub Actions feature. PyPI quarantined that one at 21:16.

That second release is the lesson in miniature. Pulling a bad version does not take away whatever let the attacker publish it. JFrog put it plainly: quarantine does not revoke the publishing credential.

Timeline, all UTC. 12 November 18:25: clean 1.26.0 published as wheel and sdist. 17 November 20:26: wheel repacked locally, per JFrog. 20:35: malicious 1.26.1 published, wheel only. 20:41: Elastic flags it. 21:06: PyPI quarantines 1.26.1. 21:08: malicious 1.26.2 published with renamed files and GitHub OIDC collection. 21:16: PyPI quarantines 1.26.2. 18 November: GitHub advisory published and Wiz updates its root-cause analysis.
Times from StepSecurity, JFrog, Elastic and Wiz. Wiz's summary says both were gone by 21:30.Open full size →
02

Why a .pth file runs code without an import

Python's site module executes any .pth line that starts with "import" followed by a space or tab.

When Python starts, it imports the site module, which adds site-packages to the module search path and then reads every .pth file it finds there. Most lines in a .pth file are just extra directories to add to the path. But Python's documentation says that, for backward compatibility, "lines starting with import (followed by space or tab) are executed with exec()". Those lines run on every interpreter start, unless Python is launched with -S, which turns off site processing entirely.

Version 1.26.1 put a 28-byte file called agent_framework_meta.pth at the root of the wheel, containing one line: import agent_framework_meta. That module's __init__.py had a call appended to it that started the stealer in agent_framework_meta/_telemetry.py. Version 1.26.2 restored that __init__.py to the clean 1.26.0 file and used a new pair instead: af_runtime_diag.pth (23 bytes, import af_runtime_diag) and a top-level af_runtime_diag.py.

So the stealer ran when Python started, not when your code used the framework. python --version, pytest, a pre-commit hook, an unrelated automation script, and pip show agent-framework would all trigger it in an environment where the package was installed. Installing alone did not run it; the next Python start did. Wiz says it forked into a detached session, or fell back to a background thread where fork is not available, which includes Windows. It set _AF_TEL=1 in the environment so child processes would not run it twice.

.pth import lines are not malicious by themselves. Packaging tools, editable installs and coverage tooling use them, so do not delete every .pth file you find. Python 3.15 has deprecated them (PEP 829 replaces them with .start files that name an entry point), Python 3.18 and 3.19 are expected to ignore them silently, and later versions will warn. Until then, they are a quiet place to put code.

Two flows. Normal package: pip install, Python starts and site reads .pth files, nothing from the package runs, then your code imports agent_framework. Compromised package: pip install also drops af_runtime_diag.pth, any Python start including python --version, pytest or pip show triggers site to exec the line import af_runtime_diag, which sets _AF_TEL=1, collects secrets, compresses and base64-encodes them and posts them to webhook.site.
The hook runs at interpreter start, before any of your code.Open full size →
The two startup hooks, as published
# 1.26.1: site-packages/agent_framework_meta.pth
import agent_framework_meta

# 1.26.2: site-packages/af_runtime_diag.pth
import af_runtime_diag
03

What the stealer went after

Environment variables, other processes' environments, credential files, Azure managed identities and CI tokens.

Environment variables: it kept any variable whose name contained words such as TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB, OPENAI, HF_, FOUNDRY, NPM, PIP, NUGET, SYSTEM, BUILD or AGENT. 1.26.2 added ACTIONS, OIDC, RUNNER and ARM_. Broad matching is the point: KEY alone catches ANTHROPIC_API_KEY, GEMINI_API_KEY and most custom names without the attacker knowing them in advance.

Other processes: on Linux it read /proc/[pid]/environ for up to 300 processes, wherever permissions allowed. On a CI runner that can include the runner agent's own environment, not only the Python step's.

Credential files: up to 60 files in 1.26.1 and 80 in 1.26.2, matched by about 35 glob patterns. The list included ~/.azure (Azure CLI token caches), pip.conf, .npmrc, .netrc, .git-credentials, Docker's config.json, Hugging Face tokens, Azure AI Foundry configs, Azure DevOps agent .credentials files, and .env and JSON files under /app and /workspace. 1.26.2 added GitHub-hosted runner paths under /home/runner/work/_temp and /home/runner/.azure.

Azure managed identity: it asked the Instance Metadata Service at 169.254.169.254, or the App Service IDENTITY_ENDPOINT, for tokens covering about a dozen resources (Wiz, JFrog and Elastic all say 12), including Azure Resource Manager, Microsoft Graph, Key Vault, Storage, Azure AI services, Container Registry and Azure DevOps. A token from a managed identity carries whatever roles that identity has. Wiz says these tokens can be valid for up to 24 hours.

CI identities: 1.26.2 added GitHub Actions. In a job with id-token: write, it requested OIDC tokens for api://AzureADTokenExchange and https://management.azure.com/, the audiences used for workload identity federation into Azure. Both versions also tried to get an Azure DevOps OIDC token through SYSTEM_OIDCREQUESTURI. JFrog found that request was malformed (it omits the required serviceConnectionId) and would get an HTTP 400 from real Azure DevOps. SYSTEM_ACCESSTOKEN still leaked through the environment wherever a pipeline mapped it into the step.

The stealer in the centre, reaching six places: its own environment variables matched by keywords like TOKEN, SECRET and KEY; up to 300 other processes' environments through /proc on Linux; up to 60 or 80 credential files such as ~/.azure, .npmrc, .netrc, .git-credentials, Docker config and .env files; Azure managed-identity tokens for about 12 resources from IMDS or App Service; GitHub Actions OIDC tokens for Azure audiences in 1.26.2; and Azure DevOps, where the OIDC request was malformed but SYSTEM_ACCESSTOKEN still leaked through the environment.
Attempted collection. Researchers confirmed the requests, not that each token request succeeded.Open full size →
04

How the data left, and how much got out

One compressed, base64-encoded POST to a free webhook.site inbox. Wiz found three successful victim cases in what was retained.

The stealer packed everything into one JSON document, compressed it with zlib, base64-encoded it and sent it in a single HTTPS POST to a hardcoded webhook.site URL. There was no fallback channel; failures were silently ignored. The User-Agent was af-runtime-diagnostics/1 in 1.26.1 and runtime-diagnostics/1 in 1.26.2, chosen to look like SDK telemetry. Compression and base64 are not encryption. Anyone holding the inbox URL could read the contents.

The inbox was publicly reachable, which let Wiz look inside. It was on webhook.site's free tier, which accepts at most 100 requests and then answers HTTP 410 or 429 without logging anything. Wiz found 50 captured requests: 4 from the attacker's own machines and attack process, 29 from sandboxes, vendor scanners and tests, and 17 that represented three unique, successful cases of victim data being exfiltrated. JFrog saw HTTP 429 "Request limit exceeded" when it checked.

Read those numbers carefully. Three is the number of victims identifiable in the retained requests, not the number of exposed environments. Hosts that ran the payload after the cap was hit sent their data into a rejection, which is good for them, but hosts behind an egress block or a crashed request would also not appear. Use your own logs (step 07), not Wiz's count, to decide whether you were hit.

Top: the exfiltration pipeline. Secrets are collected, packed into one JSON document, zlib-compressed and base64-encoded, then sent once to a webhook.site inbox with the User-Agent runtime-diagnostics/1. Bottom: a bar of the 50 requests Wiz found in the free-tier inbox: 4 from the attacker's own machines, 29 from sandboxes, vendor scanners and tests, and 17 representing three unique successful cases of victim data exfiltration. The free tier accepts at most 100 requests, then returns 410 or 429 and logs nothing.
Encoding is not encryption, and three is what the capped inbox kept, not how many hosts ran it.Open full size →
05

What is known about the root cause

Evidence points to stolen Microsoft release-pipeline credentials. How they were obtained is not known.

In its 18 November update, Wiz reported that the attacker "appears to have compromised a client certificate and private key" for Microsoft's Engineering System Release Pipeline (ESRP), the internal system that signs and publishes Microsoft packages. The attacker's tooling reported its progress to the same public webhook it used for exfiltration, which is how Wiz could see part of the operation. The first publish attempt, from AWS, was rejected by ESRP's IP filtering. A second attempt from Microsoft-owned IP space succeeded. Wiz says how the credentials were obtained is not yet known.

The packages themselves back up that they did not come from the normal build. JFrog found zip 3.0 headers showing the wheel was repacked locally at 20:26 UTC, nine minutes before upload, while the WHEEL metadata still said it was generated by flit. StepSecurity found the uploads came through RestSharp/106.13.0.0, the same client recorded for the clean 1.26.0, and reports that a new maintainer account was added to the PyPI project on 17 November. Both malicious releases were wheel only.

Two things that do not tell you much: provenance and attribution. PyPI shows no provenance attestation for the malicious wheels, but it shows none for 1.26.0 either, and 1.26.0 was not uploaded through Trusted Publishing. A missing attestation could not have told you anything here. On attribution, Wiz says the tooling called itself Cairn, an open-source AI penetration-testing framework. That is the name of a tool, not an operator. Wiz, JFrog and the GitHub advisory all say they have not attributed the attack to a known group, and StepSecurity says the evidence does not establish the initial access vector, the credential used or the uploader's identity.

Wiz also notes that another Microsoft Python package, durabletask, was compromised earlier in 2026 after its PyPI token was stolen. Wiz has not linked the two incidents, and neither do we.

The suspected publishing path. An attacker who appears to hold an ESRP client certificate and private key, obtained by an unknown method, first tries to publish from AWS and is rejected by ESRP's IP filtering. A second attempt from Microsoft-owned IP space is accepted, passes through the ESRP release pipeline and reaches PyPI as agent-framework 1.26.1 and 1.26.2. Below, the evidence it skipped the normal build: wheel-only releases, a local repack at 20:26 UTC, and a maintainer added on 17 November. Missing provenance and the RestSharp uploader are marked as not a signal, because 1.26.0 had both too.
Based on Wiz's 18 November update, JFrog and StepSecurity. The initial access vector is not known.Open full size →

Tip
If you write about this incident, say "evidence suggests" and "has not been established". Naming a person, an account or a token as the cause goes further than any of the published research.

06

Check whether you installed it, without starting Python

Search lockfiles, the filesystem and images with shell tools. pip show starts Python, which runs the hook.

This is where the usual advice is wrong. Running pip show agent-framework or pip freeze starts a Python interpreter in that environment. If the bad .pth file is there, you have just run the stealer again. StepSecurity's advice is not to begin with pip uninstall, pip show or any Python-based inspection. Use grep, find, PowerShell and your image tooling instead.

Start with dependency files: requirements*.txt, pyproject.toml, poetry.lock, uv.lock, Pipfile.lock and pylock.toml. In uv.lock and poetry.lock the name and version sit on separate lines, so print the line after the name. Then check CI logs from 17 November, Renovate or Dependabot pull requests opened that evening (JFrog saw Renovate open PRs within six minutes of 1.26.1 landing), internal mirrors and container images built since.

Then search the filesystem for the hook files and for the installed version's metadata folder. A folder named agent_framework-1.26.1.dist-info or agent_framework-1.26.2.dist-info means that version was installed there, even if someone already deleted the .pth file. Only flag _telemetry.py when it sits inside an agent_framework_meta folder; plenty of legitimate packages have a file with that name.

For container images, run a shell instead of the default entrypoint, so the image's Python never starts.

Two columns. Starts Python and runs the hook: pip show agent-framework, pip freeze or pip list, pip uninstall without _AF_TEL=1, python -c import agent_framework, and pytest, pre-commit or any .py script. No Python and safe to run: grep over lockfiles and requirements, find or Get-ChildItem for the hook files, docker run with a shell entrypoint, sha256sum or Get-FileHash, and uv pip uninstall, which skips .pth hooks. A note says a 1.26.1 or 1.26.2 dist-info folder proves installation even if the .pth file was deleted.
Every check on the left is a fresh run of the stealer. Use the right-hand column.Open full size →
Linux / macOS: pinned versions in requirements and pyproject files
grep -rnE "agent[-_]framework[^0-9]*1\.26\.[12]([^0-9]|$)" --include="*.txt" --include="*.toml" --include="*.cfg" --include="Pipfile.lock" .
Linux / macOS: uv.lock, poetry.lock and pylock.toml (version is on the next line)
grep -rn -A1 'name = "agent-framework"' --include="uv.lock" --include="poetry.lock" --include="pylock*.toml" .
Linux / macOS: hook files and dist-info folders anywhere on the machine
find / \( -name 'agent_framework_meta.pth' -o -name 'af_runtime_diag.pth' -o -name 'af_runtime_diag.py' -o -path '*agent_framework_meta/_telemetry.py' -o -name 'agent_framework-1.26.[12].dist-info' \) 2>/dev/null
Windows PowerShell: hook files
Get-ChildItem -Path C:\ -Recurse -Force -File -ErrorAction SilentlyContinue -Include agent_framework_meta.pth,af_runtime_diag.pth,af_runtime_diag.py,_telemetry.py | Where-Object { $_.Name -ne '_telemetry.py' -or $_.DirectoryName -like '*agent_framework_meta' } | Select-Object FullName
Windows PowerShell: installed agent-framework versions (look for 1.26.1 or 1.26.2)
Get-ChildItem -Path C:\ -Recurse -Force -Directory -ErrorAction SilentlyContinue -Filter 'agent_framework-1.26.*.dist-info' | Select-Object FullName
Docker: search an image without starting its Python
docker run --rm --entrypoint sh IMAGE_NAME -c "find / \( -name 'agent_framework_meta.pth' -o -name 'af_runtime_diag.pth' -o -name 'agent_framework-1.26.[12].dist-info' \) 2>/dev/null"
Confirm a file against the published hashes (Linux / macOS, then Windows)
sha256sum PATH_TO_FILE
Get-FileHash PATH_TO_FILE -Algorithm SHA256

Tip
If you find nothing, also clear the pip and uv caches and check your mirror before closing the ticket. A cached 1.26.1 wheel will install the stealer the next time a build resolves it offline.

07

Check whether it ran and whether data left

Look for the webhook URL, the User-Agents and the response code in proxy, DNS and firewall logs.

Search egress logs from 20:35 UTC on 17 November onward. The strongest single indicator is the inbox path d381fd80-ec62-42ad-8f5c-d1b15103c9bb on webhook.site, usually with the query string ?t=telemetry. If your proxy decrypts TLS, the User-Agents af-runtime-diagnostics/1 and runtime-diagnostics/1 are also specific.

The response code is what tells you whether data was accepted. Wiz's guidance: HTTP 200 means that host's data was received. 410 or 429 means the inbox had hit its free-tier cap and rejected it. A DNS lookup for webhook.site or a blocked connection is evidence the payload ran, which is reason enough to rotate (step 09), but not proof that anything left.

On a host, a process running with _AF_TEL=1 in its environment is another sign the payload executed in that process tree.

A decision tree for egress log hits. Search from 17 November 20:35 UTC for the webhook.site inbox path and the two User-Agents. HTTP 200 means the inbox accepted the data, so treat it as exfiltrated. 410 or 429 means the free-tier inbox was full and rejected it, but the payload still ran and read secrets locally. A DNS lookup or blocked connection means the payload ran but nothing is proven to have left. All three paths end with rotating what the host could reach.
The response code decides how urgent rotation is, not whether you rotate.Open full size →
Proxy or firewall logs: the exfiltration inbox
grep -F "d381fd80-ec62-42ad-8f5c-d1b15103c9bb" /var/log/squid/access.log*
Any log: the two User-Agents
grep -rE "(af-)?runtime-diagnostics/1" /var/log/
Linux: running processes that carry the run-once marker
sudo grep -l "_AF_TEL=1" /proc/[0-9]*/environ 2>/dev/null

Tip
Swap the log paths for wherever your proxy, DNS resolver or cloud firewall writes. In a managed service, search the same strings in its log query tool.

08

Remove it without setting it off again

Contain, set _AF_TEL=1, remove with uv or rebuild from clean, and pin 1.26.0.

Contain first. Cut unnecessary network access from the affected machine or runner, stop dependent workloads where you can, and keep logs and a copy of the environment for investigation. Do not keep launching Python processes while you work out what to do.

JFrog's stopgap is to export _AF_TEL=1 before anything else. The stealer checks that variable and skips collection if it is set, so it blocks both versions. It is specific to this malware, not a general defence, and it only helps in shells where you set it.

Then remove the package with a tool that does not run Python's startup hooks. JFrog notes that uv does not execute .pth files during removal. Better still, throw the environment away: delete the virtualenv or rebuild the container from a trusted base, install from a lockfile pinned to 1.26.0 with hashes, and clear the pip, uv and CI caches so the bad wheel cannot come back. Block 1.26.1 and 1.26.2 in your internal mirror or artifact proxy.

After removal, run the step 06 search again to confirm the .pth file, the .py file and any __pycache__ copies are gone.

Six clean-up steps in order. One, contain: cut unneeded egress, stop workloads, keep logs and a copy. Two, guard: export _AF_TEL=1 so the stealer skips collection, a malware-specific stopgap. Three, remove: uv pip uninstall, or delete the virtualenv or container outright. Four, purge: clear pip, uv and CI caches and block 1.26.1 and 1.26.2 in your mirror. Five, reinstall agent-framework 1.26.0 from a lockfile with hashes. Six, verify: rerun the file search until the .pth, .py and __pycache__ files are all gone.
Rebuilding from a clean base beats cleaning in place.Open full size →
Linux / macOS: neutralise the hook for this shell
export _AF_TEL=1
Windows PowerShell: neutralise the hook for this session
$env:_AF_TEL = "1"
uv: remove and purge the cache (run with the affected virtualenv active, or add --python PATH)
uv pip uninstall agent-framework && uv cache clean agent-framework
Reinstall the last clean version
uv pip install "agent-framework==1.26.0"
pip users: JFrog's sequence, with the guard set first
export _AF_TEL=1
"$PY_BIN" -m pip uninstall -y agent-framework
"$PY_BIN" -m pip cache remove agent_framework
"$PY_BIN" -m pip install --no-cache-dir "agent-framework==1.26.0"

Tip
In the pip sequence, PY_BIN is the affected environment's Python, for example .venv/bin/python. It still starts Python, which is why the guard has to be exported in the same shell first.

09

Rotate credentials and review cloud identities

Rotate everything the host and its processes could read, then check what issued tokens were used for.

Treat every secret reachable from an affected environment as exposed, not only the ones the agent app uses. That includes the CI runner's secrets, other processes' environments and every file in the step 03 list. Rotating a secret does not invalidate a token already issued from it, so rotation and log review are separate jobs.

For Azure, review Entra ID sign-in logs for the managed identities and service principals the host could use, Azure Resource Manager activity, Key Vault and Storage access, and federated identity credential activity, starting at 20:35 UTC on 17 November. Managed-identity and OIDC-exchanged tokens can stay valid for up to 24 hours, so look at the whole day after exposure. Recycle compute you cannot vouch for.

For GitHub Actions jobs that ran 1.26.2 with id-token: write, treat the OIDC tokens as exposed: review the Entra ID federated credentials that trust that repository, and rotate repository and organisation secrets the job could see. For Azure DevOps, rotate PATs and service connection credentials and review pipeline authentication logs.

10

Harden the next install

Cooldowns, hash-pinned lockfiles, watching for new .pth files, fewer secrets on build runners and controlled egress.

Add a dependency cooldown. Elastic flagged 1.26.1 in six minutes and PyPI pulled both versions within 45, but Renovate was already opening upgrade PRs inside those six minutes. A rule that holds new releases for a few days before automation can adopt them would have skipped this incident entirely. Renovate has minimumReleaseAge, Dependabot has a cooldown setting, and uv can resolve as of a fixed date with exclude-newer.

Pin with hashes. A version pin alone accepts whatever is published under that number. A lockfile with hashes means a rebuilt or repacked wheel fails to install. Flag wheel-only releases of packages that normally ship an sdist too, as CSA suggests; that was the first visible anomaly here.

Watch site-packages. A new .pth file containing an import line, from a package that did not ship one before, deserves a human look. Diff the list of .pth files between builds; it is a short list in most environments.

Give build runners less. Remove id-token: write from jobs that do not deploy, split build and deploy identities, prefer short-lived credentials over stored secrets, and restrict egress from runners to the registries and endpoints they need. Blocking webhook.site and similar paste and webhook services from CI costs little.

If you publish packages, use PyPI Trusted Publishing and publish attestations, retire long-lived API tokens, and audit who can add maintainers. Provenance only helps if consumers check it, and it does not protect a release pipeline whose own credentials are stolen, which is what the evidence here suggests.

A to-scale timeline of the first 45 minutes after 1.26.1 was published at 20:35 UTC: Renovate pull requests and Elastic's flag at about 6 minutes, 1.26.1 pulled at 31, 1.26.2 live at 33 and pulled at 41. Beside it, a 72-hour cooldown bar with an orange sliver showing the 41 minutes both bad versions existed. Below, the other layers: hash-pinned lockfiles, watching .pth files between builds, id-token write on deploy jobs only, restricted CI egress, and Trusted Publishing for package publishers.
A three-day hold on new releases would have kept both versions out of automated upgrades.Open full size →
GitHub Actions: grant OIDC only to the job that needs it
permissions:
  contents: read          # workflow default: no id-token

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: uv sync --locked && uv run pytest

  deploy:
    needs: test
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write     # only here, where Azure login happens
    steps:
      - uses: actions/checkout@v4
      # azure/login and deploy steps
uv: compile a lockfile with hashes
uv pip compile requirements.in --generate-hashes -o requirements.txt
pip: refuse anything that does not match the hashes
pip install --require-hashes -r requirements.txt
uv: resolve as if it were an earlier date (a manual cooldown)
uv pip compile requirements.in --exclude-newer 2026-11-16T00:00:00Z -o requirements.txt

Indicators of compromise

IndicatorValue
Malicious versionsagent-framework==1.26.1, agent-framework==1.26.2 (last clean: 1.26.0)
1.26.1 filesagent_framework_meta.pth, agent_framework_meta/_telemetry.py (plus an appended call in agent_framework_meta/__init__.py)
1.26.2 filesaf_runtime_diag.pth, af_runtime_diag.py
1.26.1 wheel SHA-256d27fa34414e6201d5e03e559ef634f020057554d7b3f4898dd5d7cd3e989e110
1.26.2 wheel SHA-2563d20a8bc91351a9a16b6db243b848ceca0206b7a8623b02d2af553a9c9f7e0a9
agent_framework_meta.pth SHA-25621f28e8517a10ffe431f8d68f5875c85eca4001ae6d118322b0a41873998eb5e
agent_framework_meta/_telemetry.py SHA-25639fa329f2a93f734b0bb8f5adb203ea3331d1ae479832a5015a54cb17aabd663
af_runtime_diag.pth SHA-256325e7e9f0ec94e41ad1a1b7a3f18a6b8b5bffece2e2b97b8d3369eb967452f93
af_runtime_diag.py SHA-25654d885b7d7161c9ed96489c66364c4bfbf635929166843bba10d97d46b5a2e1f
Exfiltration endpointhxxps://webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb?t=telemetry
User-Agentaf-runtime-diagnostics/1 (1.26.1), runtime-diagnostics/1 (1.26.2)
Environment marker_AF_TEL=1
Uploader clientRestSharp/106.13.0.0 (also used for the clean 1.26.0, so not malicious on its own)

From Wiz, StepSecurity and JFrog. Search for both versions' file names: the second release changed them on purpose.

What this says about AI framework dependencies

  • An agent framework gets installed exactly where the valuable credentials are: next to model API keys, cloud identities, vector database passwords and deploy tokens. Classify AI development and build environments as privileged infrastructure.
  • Exposure does not follow usage. A package you installed and never imported could still run code on every Python start. Inventory what is installed, not what is imported.
  • Removing a malicious version is half the response. The other half is whatever let it be published, which in this case the package's consumers cannot see or fix.
  • This was not the first AI-tooling package hit in 2026. CSA's note lists the LiteLLM PyPI package poisoned with a .pth-based stealer in March and a takeover of roughly 144 packages in the @mastra npm scope in June. The pattern is the AI stack's middleware, not any one vendor.
  • Python is closing this door slowly. PEP 829 deprecates .pth import lines from 3.15, but most environments will run older interpreters for years.

agent-framework response checklist

  • Lockfiles, CI logs, mirrors, caches and images have been searched for 1.26.1 and 1.26.2 without starting Python.
  • Filesystems and images have been searched for all four hook file names and the 1.26.1 and 1.26.2 dist-info folders.
  • Egress logs have been checked for the webhook path and both User-Agents, and the response codes noted.
  • Affected environments were contained, then rebuilt or cleaned with _AF_TEL=1 set and uv or a fresh environment.
  • agent-framework is pinned to 1.26.0 with hashes, and 1.26.1 and 1.26.2 are blocked in the mirror.
  • Every secret readable from an affected host has been rotated, and Azure, GitHub and Azure DevOps logs reviewed from 20:35 UTC on 17 November.
  • A dependency cooldown is in place for automated upgrades.
  • id-token: write is limited to deploy jobs, and CI egress is restricted.
Personal verdict

The malware here was ordinary. The delivery was not: a real package name, a release pushed through what looks like Microsoft's own pipeline credentials, and a .pth hook that made "we never import it" irrelevant. If you installed agent-framework between 20:35 and 21:16 UTC on 17 November, or built from a cache or mirror that did, assume the stealer ran, check your egress logs for a 200, and rotate what that machine could reach. Do the first check with grep, not pip. For everyone else, the cheap fix is a dependency cooldown: a few days' delay on new releases would have skipped this incident and most like it, and it costs almost nothing. We would add that before anything else on the step 10 list.

Frequently asked questions

Was I affected if I never imported agent_framework?+

Possibly. The stealer ran from a .pth file that Python executes at startup, so any Python process in an environment where 1.26.1 or 1.26.2 was installed could run it, whether or not your code imported the framework. What matters is whether the version was installed and Python was started afterwards.

Which versions are safe?+

1.26.0, published on 12 November 2026, is the last clean release and was still the latest on PyPI on 23 November. Only 1.26.1 and 1.26.2 were malicious. Earlier versions are not affected by this incident.

Can I just run pip uninstall agent-framework?+

Not as the first step. pip starts Python, which runs the hook again if the .pth file is still there. Set _AF_TEL=1 first and remove it with uv, or better, delete the environment and rebuild it from a lockfile pinned to 1.26.0.

Does this affect Windows and macOS, or only Linux?+

All three. The .pth hook works on any platform, and the stealer collected environment variables and credential files everywhere. Reading other processes' environments through /proc only works on Linux, and on Windows, which has no fork, it would have used its background-thread fallback.

Was Microsoft hacked?+

Evidence from Wiz suggests the attacker had a client certificate and private key for Microsoft's ESRP release pipeline and published from Microsoft-owned IP space. How those credentials were obtained has not been made public, and no researcher has named an account, person or initial access vector.

Is there a CVE?+

Not that we found. The incident is tracked as GitHub advisory GHSA-764m-3ppc-5m73, classed as malware (CWE-506), with 1.26.1 and 1.26.2 as the affected versions and no patched version.

If I rotate my secrets, am I done?+

No. Rotation stops future use of the stolen secrets, but tokens already issued from managed identities or OIDC exchange can stay valid for up to 24 hours. Review what those identities did after exposure, and rebuild the environment so the hook is gone.

Sources & further reading

Sources and further reading

More practical field notes from Agent Builders HQ are on the way.

Stay tuned →