Skip to content
All posts

Microsoft agent-framework PyPI Hijack: What to Do Now

November 19, 2026 · Team PlayCISO
TL;DR · the short version

On 17 November 2026 two malicious versions of agent-framework, the Python package for Microsoft Agent Framework, were published to PyPI: 1.26.1 at 20:35 UTC and 1.26.2 at about 21:08 UTC. Wiz Research says both dropped a .pth file that runs a credential stealer every time Python starts, collecting cloud, CI and registry secrets and Azure tokens. Wiz assesses that the attacker used a compromised client certificate and private key for Microsoft's ESRP release service; how they were obtained is not yet known. JFrog says PyPI quarantined 1.26.1 at 21:06 and removed both by 21:16 UTC. The last clean version is 1.26.0. Microsoft has published no account of how it happened; a spokesperson told The Register on 18 November that it has "made some repositories private while we investigate malicious content".

Put it into practice
Stop a fresh malicious release reaching your builds
Generate pip, uv and Poetry settings that refuse packages younger than a set age, so a release live for 40 minutes never lands.
Generate a minimum-age config

On 17 November 2026, two malicious versions of agent-framework, the Python package for Microsoft Agent Framework, were published to PyPI: 1.26.1 at 20:35 UTC and 1.26.2 at about 21:08 UTC. Wiz Research says both carried a credential stealer that runs every time Python starts and collects cloud, CI and package-registry secrets. Wiz assesses that the attacker published through Microsoft's ESRP (Engineering System Release Pipeline) service with a compromised client certificate and private key; how they were obtained "is not yet known". JFrog says PyPI removed both versions by 21:16 UTC. The last clean version is 1.26.0. Microsoft has not said how it happened; it told The Register it has made some repositories private while it investigates.

Update, 19 November 2026: more researcher write-ups and Microsoft's first comment. Each point is attributed to the source that states it.

  • Microsoft: a spokesperson told The Register on 18 November: "We have made some repositories private while we investigate malicious content." Microsoft has not said how the releases were published.
  • Publisher account vs ESRP: The Register, citing OX Security, says 1.26.2 was uploaded "through Microsoft's official PyPI publisher account". How that access was obtained is not confirmed: Endor Labs says the uploads "came from an account or token with publishing rights", SafeDep says "How the account got maintainer access is not known", and StepSecurity says the evidence does not establish "the specific account or credential used". Wiz's account below, a stolen ESRP client certificate and key, is Wiz's assessment and is not confirmed by Microsoft. The two are compatible: a release pushed through Microsoft's own publishing service appears on PyPI under Microsoft's project. Endor adds that PyPI shows no provenance attestation for either malicious wheel.
  • 1.26.1 pulled, then 1.26.2: The Register, citing OX Security, says 1.26.1 "was reverted to a safe version" before the attacker uploaded 1.26.2. StepSecurity says 1.26.2 came "after 1.26.1 was already quarantined", and BleepingComputer puts it about 2.5 minutes after the quarantine, noting that 1.26.2 "restored the original package initializer" and moved the malicious code into af_runtime_diag.pth. Either way the attacker still had publishing access after the first version was pulled. We could not open OX Security's own post.
  • The real framework still installs: Endor Labs says "Both malicious versions pin agent-framework-core[all]==1.26.0", the genuine core package, so applications kept working and the compromise was easy to miss; BleepingComputer says the same, and The Register describes it as pulling "the genuine 1.26.0 version". The genuine code arrives as an ordinary dependency: StepSecurity says the payload has "no remote-code-loading second stage".
  • Exfiltration: Endor Labs says the collector "serializes its results as JSON, compresses them with zlib at level 9, base64-encodes the result" and posts it to a URL on a free public webhook-capture service hard-coded in the package; Socket and StepSecurity describe the same.
  • Not persistent beyond the package: StepSecurity says "no separate scheduled task or system service is installed"; repeated execution comes from the .pth hook. The Register, citing researcher accounts, says "the malware isn't persistent" and runs only while the package remains in a site-packages directory. Removing it stops new runs; it does not undo what was already sent.
  • Detected in six minutes: Elastic Security Labs (18 November) says its supply-chain monitor flagged 1.26.1 as malicious at 20:41 UTC, six minutes after it went live at 20:35, and that 1.26.2 followed at 21:08 "with the same stealer under new filenames". Elastic puts the package's usage at about 196,000 downloads a month across all versions (Wiz: about 41,000 a week). Elastic adds that the stealer read the environment of up to 300 running processes, that on Windows it ran in a background thread instead of a forked child, and that exfiltration used the User-Agent af-runtime-diagnostics/1 in 1.26.1 and runtime-diagnostics/1 in 1.26.2, useful for proxy-log searches. Its advice: "Treat everything readable on impacted hosts as compromised", rotate long-lived secrets and "review activity for short-lived tokens that can't be revoked".
  • Fresh tokens, not only stored ones: StepSecurity says the payload "mints fresh identity tokens from GitHub Actions OIDC, Azure DevOps OIDC, and Azure managed identity endpoints" (GitHub Actions in 1.26.2 only), and Socket says it requests them "rather than merely copying existing secrets". A pipeline with no stored secrets could still leak usable cloud access if it carries a federated identity.

Confirmed vs not yet known (19 Nov 2026)

  • Confirmed by the PyPI record: PyPI's JSON API lists 1.26.0 (published 12 November) as the latest release and no longer lists 1.26.1 or 1.26.2.
  • Reported by Wiz and JFrog (independently): both versions were malicious, used a .pth start-up file and stole credentials; 1.26.0 and earlier are clean.
  • Wiz's assessment, not yet confirmed by Microsoft: the release went out through ESRP using a stolen ESRP client certificate and key, from Microsoft-owned IP space after an attempt from AWS was blocked.
  • Not known: how the ESRP credentials were stolen; how many installs happened in total; who the victims are (Wiz withholds identities); whether other packages were published the same way. Wiz and JFrog list no other affected package.
  • Microsoft: told The Register on 18 November it has "made some repositories private while we investigate malicious content". No MSRC post or GitHub advisory found. Wiz says it reported its findings to Microsoft on 17 November.

What happened, step by step

Wiz could reconstruct the publish because, in its words, the tooling "reported its own progress to the same publicly accessible webhook it used for exfiltration". The minute-by-minute steps below come from Wiz's timeline diagram, which it says is reconstructed from the attacker's own status beacons. The diagram shows attacker infrastructure in AWS (Singapore) and in Microsoft IP space, both running Cairn tooling.

Time (UTC)EventSource
12 Nov, 18:25Legitimate agent-framework 1.26.0 publishedWiz; PyPI
17 Nov, 20:25:06Connectivity probe labelled CAIRN_ESRP_PROBE2 sent from Microsoft IP spaceWiz Research (diagram)
17 Nov, 20:26:19Malicious wheel repacked with Info-ZIP on a host whose clock was set to UTC+8, not by Microsoft's build pipelineJFrog
17 Nov, 20:28:07Stealer self-tested on the attacker's own machine; the captured configuration shows an AI coding agent (Pi harness, local proxy, GLM-family model labelled pi_glm53)Wiz Research (diagram)
17 Nov, 20:28:56Publish attempt from AWS rejected by ESRP IP filtering (HTTP 403)Wiz Research (diagram and text)
17 Nov, 20:33:00Release submitted to ESRP from Microsoft IP space, package staged at /tmp/cairn_pkgWiz Research (diagram and text)
17 Nov, 20:33:08Release auto-approvedWiz Research (diagram)
17 Nov, 20:33:09 to 20:35:15Malware scan passedWiz Research (diagram)
17 Nov, 20:35:201.26.1 live on PyPI, 2 minutes 20 seconds after submissionWiz Research (diagram); Wiz and JFrog give 20:35
17 Nov, 20:37:12Status beacon with the full ESRP release record sent to the attacker's webhookWiz Research (diagram)
17 Nov, about 20:40First victim request reaches the exfiltration endpoint, about 5 minutes after 1.26.1 went liveWiz Research (diagram)
17 Nov, 20:41Elastic's supply-chain monitor flags 1.26.1 as malicious, six minutes after publicationElastic Security Labs
17 Nov, about 20:49Last of the 50 requests Wiz captured at the endpointWiz Research (diagram)
17 Nov, 21:06PyPI quarantines 1.26.1JFrog
17 Nov, about 21:081.26.2 published, adding GitHub Actions OIDC token theftWiz; JFrog
17 Nov, 21:16 (JFrog) / about 21:30 (Wiz)Both malicious versions no longer available on PyPIJFrog; Wiz
18 Nov, 14:00Wiz updates its post with the root cause and the exfiltration analysisWiz

Source for the 20:25 to 20:49 steps: Wiz Research. Times are as Wiz and JFrog give them; they differ slightly on when the packages were removed.

What the malicious versions did

Wiz says both versions drop a .pth file into site-packages (agent_framework_meta.pth in 1.26.1, af_runtime_diag.pth in 1.26.2), named "to look like legitimate SDK telemetry". Python runs import lines in .pth files at every interpreter start, so a victim never had to import agent-framework: any Python process in that environment ran the stealer. This is the same start-up-hook technique as the LiteLLM 1.107.0 compromise in October.

Per Wiz, the stealer collected:

  • environment variables whose names match terms such as TOKEN, SECRET, AZURE, AWS and GITHUB, plus secret-looking values from other processes' environments;
  • credential files for the Azure CLI, npm, pip, git, Docker and Hugging Face, and Azure DevOps agent credentials;
  • Azure DevOps OIDC tokens, Azure managed-identity tokens for 12 resources, and Azure instance metadata;
  • in 1.26.2 only, GitHub Actions OIDC tokens in workflows with id-token: write.

JFrog adds host name, user name, working directory and command-line arguments, and lists OpenAI and Anthropic keys among the variables matched. Wiz says the data was compressed, encoded and sent in a single HTTPS POST to a public webhook-capture service, with no fallback channel and no retry. Wiz notes stolen Azure tokens can stay valid for up to 24 hours.

What Wiz saw at the exfiltration endpoint

Wiz says the attacker's webhook account was on the free tier and that "a maximum of 50 requests were captured". Its second diagram splits them as follows.

RequestsWho sent them
17Victims: three unique, successful exfiltrations. V1, an Azure DevOps build pool (10 requests, 9 of them in the final 7 seconds); V2, GitHub Actions on an open-source repository (4); V3, Azure App Service (3). Identities withheld.
29Sandboxes and tests: security-vendor sandboxes, a package scanner, a honeypot runner, a researcher download, and third-party bots and scanners
4The attacker's own machines and status beacons
50Between about 20:25 and 20:49 UTC

Source: Wiz Research.

Useful next, if this was relevant to you

Showing 1 of 3: Breach Cost Calculator

Two things follow. First, defenders' own sandboxes and scanners used up more than half of the logged requests (29 of 50), which, as a side effect, filled the attacker's free quota with noise. Second, Wiz says that past the free-tier limit new requests get HTTP 410 or 429 and are not logged. The count therefore covers only the logged window: it does not show that nobody else installed the package later, and no 1.26.2 install (published about 21:08) appears in it. Wiz suggests checking proxy and DNS logs: a 200 response from the webhook service means that host's data was accepted, a 410 or 429 suggests it was rejected.

Why IP allowlisting did not stop it

On Wiz's account, ESRP did enforce a network control: the first publish from AWS was refused. But the attacker also had a foothold in Microsoft-owned IP space, so the second attempt presented both things the service checked, a valid client certificate and an allowed network location. Wiz's diagram then shows the release auto-approved and a malware scan passed in about two minutes, and the package was live 2 minutes 20 seconds after submission.

We do not know how ESRP is configured beyond what Wiz describes, and Microsoft has not commented. As general guidance for any team that signs or publishes packages:

  • Keep signing and publishing keys hardware-bound. A private key that can be copied into a file can be stolen and used from anywhere. Keys in an HSM or a cloud KMS that never leave it turn "steal the key" into "get a session on the signing system".
  • Do not let network location stand in for identity. An IP allowlist is one more hurdle, not proof of who is calling. Assume an attacker who has your credential may also reach your network.
  • Require a human approval for releases. A two-person rule on publishing a new version is slow for a reason. A malware scan is a backstop, not an approval: this stealer passed one.
  • Bind every release to its source. Publish build provenance and attestations (SLSA, Sigstore) from a known CI workflow, and refuse to publish an artefact that has no matching tag or build. JFrog's finding that the wheel was repacked by a local script, not a pipeline, is exactly what provenance makes visible.
  • Use short-lived publishing identities. PyPI Trusted Publishing issues a token per workflow run through OIDC, so there is no long-lived upload credential to steal.

The AI-tooling angle

Wiz says the tooling "identifies itself as Cairn, an open-source AI penetration-testing framework", and that the stealer's self-test on the attacker's machine captured a configuration that "appears to be the open-source Pi harness backed by a GLM-family model (pi_glm53)". That fits what Google's Threat Intelligence Group reported days earlier: attackers operating open-source agentic frameworks, CAIRN among them, in real intrusions (see our post on ARTEX and agentic offensive frameworks, section "How this relates to CAIRN").

Wiz does not say how much of this operation was automated. An AI agent in the attacker's toolchain does not by itself mean the attack ran autonomously; a person may have driven each step. What matters for defenders is the same either way: the expensive part was a stolen release credential, and the tooling turned it into a live package in minutes. For where these consoles turn up on the internet, see ARTEX, Cairn and PentAGI consoles exposed: what to hunt.

Who is affected

Anyone who installed or resolved agent-framework 1.26.1 or 1.26.2 between 20:35 and about 21:16 to 21:30 UTC on 17 November 2026, including through a loose requirement such as agent-framework>=1.26. That includes developer laptops, CI runners (the Azure DevOps and GitHub Actions victims Wiz describes were build systems), container images built in that window, App Service and other hosted deployments, and any machine that later reused a cached wheel. AI agents that install their own dependencies count too: check every environment agents run in. Pinned 1.26.0 or earlier is not affected.

What security leaders should do this week

  • Find it. Search lockfiles, CI logs, virtualenvs, pip caches, container images and runner images for agent-framework 1.26.1 or 1.26.2, and site-packages for the two .pth files. Wiz also lists the run-once environment variable _AF_TEL=1 and the 1.26.2 User-Agent runtime-diagnostics/1 as indicators; its post has the full hash list.
  • Check egress. Look in proxy and DNS logs for HTTPS POSTs to the public webhook-capture service Wiz names, on 17 November from about 20:35 UTC.
  • Rebuild, do not clean. Rebuild affected environments and images from a pinned 1.26.0 rather than deleting files by hand.
  • Rotate from a clean machine. Every secret an affected environment could read: Azure CLI sessions, Azure DevOps PATs and service connections, cloud keys, npm, pip, Docker, git and Hugging Face tokens, and AI provider keys. Audit managed identities and federated credentials reachable from the host and review their sign-ins. For 1.26.2 in GitHub Actions, Wiz says to treat exposed OIDC tokens as compromised and review the Entra ID federated credentials for those repositories.
  • Pin and verify hashes. Pin agent-framework==1.26.0 (or whatever Microsoft or PyPI later lists as safe) and install with --require-hashes, so a re-published version cannot slip in.
  • Add a quarantine delay. Serve packages through an internal mirror or proxy that holds new releases for a few days, or set a minimum package age in uv, pip or Poetry. This release was live for well under an hour.
  • Own the dependency. Keep agent frameworks in your AI Bill of Materials so the next advisory is a lookup, not a hunt.

Commands for a first sweep (read them before you run them; adjust paths for your images):

# 1. Installed version in this environment (run inside every venv, image and runner)
pip show agent-framework 2>/dev/null | grep -i '^version'

# 2. The two .pth start-up files Wiz names (1.26.1 and 1.26.2)
find / -path '*-packages*' \( -name 'agent_framework_meta.pth' -o -name 'af_runtime_diag.pth' \) 2>/dev/null

# 3. Any .pth file in site-packages you cannot explain
python -c "import site; print('\n'.join(site.getsitepackages()))" | xargs -I{} sh -c 'ls -la {}/*.pth 2>/dev/null'

# 4. Lockfiles and requirements in your repos
grep -rnE 'agent-framework[=~>< ]*=*1\.26\.[12]\b' --include='*.txt' --include='*.in' --include='*.toml' . 2>/dev/null
grep -n -A1 'name = "agent-framework"' uv.lock poetry.lock 2>/dev/null | grep -E '1\.26\.[12]"'

# 5. Cached wheels that a later build could reuse
pip cache list 'agent_framework*' 2>/dev/null
# requirements.txt: pin the last clean release and require hashes
agent-framework==1.26.0
# then install with: pip install --require-hashes -r requirements.txt

Put it to work

This incident and Microsoft's earlier ones (Storm-0558, Midnight Blizzard) are in the Breach Index entry for Microsoft. Wiz notes that another Microsoft PyPI package, durabletask, was compromised earlier this year after its PyPI token was stolen, and says it has not linked the two incidents.

FAQ

Which agent-framework versions are malicious?

Wiz Research and JFrog both name 1.26.1 and 1.26.2 of the agent-framework package on PyPI. Wiz says "The most recent safe version is 1.26.0." The PyPI JSON API, read on 19 November 2026, lists 1.26.0 as the latest version and no longer lists 1.26.1 or 1.26.2.

When were the malicious agent-framework versions live on PyPI?

Wiz says 1.26.1 was published at 20:35 UTC on 17 November 2026 and 1.26.2 at about 21:08 UTC, and that both were gone by about 21:30 UTC. JFrog gives tighter times: PyPI quarantined 1.26.1 at 21:06 UTC and removed both releases by 21:16 UTC. Anyone who installed or resolved either version in that window, or who reuses a cached wheel or a container image built then, should treat the environment as exposed.

Do I need to have imported agent-framework to be affected?

No. Wiz says the malicious versions drop a .pth file into site-packages, and Python executes .pth start-up lines every time the interpreter starts, even if agent_framework is never imported. Installing the package was enough: any later Python process in that environment ran the stealer.

What did the agent-framework stealer collect?

Per Wiz: environment variables with names matching terms such as TOKEN, SECRET, AZURE, AWS and GITHUB; secret-looking values from other processes' environments; credential files for the Azure CLI, npm, pip, git, Docker and Hugging Face plus Azure DevOps agent credentials; Azure DevOps OIDC tokens; Azure managed-identity tokens for 12 resources; and Azure instance metadata. Wiz says 1.26.2 added theft of GitHub Actions OIDC tokens in workflows with id-token: write. JFrog adds host name, user name, working directory and command-line arguments, and AI provider keys such as OpenAI and Anthropic among the matched variables.

How was a malicious package published through Microsoft's ESRP?

Wiz assesses that the attacker had a compromised client certificate and private key for Microsoft's ESRP (Engineering System Release Pipeline) signing and publishing service, and says "How the credentials were obtained is not yet known." Wiz says a first publish attempt from AWS was rejected by ESRP's IP filtering and a second attempt from Microsoft-owned IP space succeeded. Microsoft has not published its own account.

How many people were affected by the agent-framework compromise?

No source gives a download count for the malicious versions. Wiz says the package normally gets about 41,000 downloads a week. From the attacker's exfiltration endpoint Wiz captured 50 requests: 4 from the attacker, 29 from sandboxes, vendor scanners and tests, and 17 that represent three unique, successful exfiltrations of victim data. Wiz's diagram puts those 50 requests between 20:25 and 20:49 UTC, so installs after that, including every 1.26.2 install, are not in the count.

Was the agent-framework attack carried out by an AI agent?

Wiz says the tooling identifies itself as Cairn, "an open-source AI penetration-testing framework", and that a stealer self-test on the attacker's machine captured a configuration that appears to be the open-source Pi harness backed by a GLM-family model (pi_glm53). Wiz does not say how much of the operation was automated, so it is not established that the attack ran autonomously.

What should I do if I installed agent-framework 1.26.1 or 1.26.2?

Remove it, delete the .pth files Wiz names (agent_framework_meta.pth and af_runtime_diag.pth) or better rebuild the environment, pin agent-framework==1.26.0, and rotate every secret that environment could reach: Azure CLI sessions, Azure DevOps PATs and service connections, cloud keys, package-registry and git tokens, and AI provider keys. Wiz also advises auditing the Azure managed identities and federated credentials reachable from the host, and, for 1.26.2 in GitHub Actions, treating the OIDC tokens as compromised.

Does the agent-framework malware persist after the package is removed?

StepSecurity says the payload installs "no separate scheduled task or system service": it runs again through the .pth hook each time Python starts, for as long as the files stay in site-packages. The Register, citing researcher accounts, says "the malware isn't persistent" and runs only while the package remains in a site-packages directory. Removing the package and its .pth files therefore stops new runs, but it does not undo theft that already happened, and StepSecurity notes the stealer's child process "can outlive its parent interpreter". Rebuild the environment and rotate the secrets anyway.

Did the attacker use Microsoft's official PyPI account?

The releases appeared under Microsoft's own agent-framework project. The Register, citing OX Security, says 1.26.2 was uploaded "through Microsoft's official PyPI publisher account". Endor Labs says the uploads "came from an account or token with publishing rights", SafeDep says "How the account got maintainer access is not known", and StepSecurity says the evidence does not establish "the specific account or credential used". Wiz's view, that the attacker published through Microsoft's ESRP release service with a stolen ESRP client certificate and key, is its assessment and has not been confirmed by Microsoft. The accounts are compatible: a release pushed through Microsoft's own publishing service would appear on PyPI as coming from Microsoft's project.

Has Microsoft commented on the agent-framework PyPI compromise?

Only briefly. A Microsoft spokesperson told The Register on 18 November: "We have made some repositories private while we investigate malicious content." We found no MSRC post or GitHub security advisory as of 19 November 2026, and Microsoft has not said how the releases were published. Wiz says it reported its findings to Microsoft on 17 November. A public issue on the microsoft/agent-framework repository (#10411) flags 1.26.1 as malicious; we could not load it to check for a maintainer reply.

Sources

This article is educational guidance for security and engineering leaders, not a forensic report. Indicators and hashes are in Wiz's post; check it and any Microsoft statement for updates before acting.

Stop a fresh malicious release reaching your builds
Generate pip, uv and Poetry settings that refuse packages younger than a set age, so a release live for 40 minutes never lands.
Generate a minimum-age config
Take this with you
What happened, step by step · What the malicious versions did · What Wiz saw at the exfiltration endpoint · Why IP allowlisting did not stop it · The AI-tooling angle · Who is affected

Ready to practise the decisions these articles describe?

Run your first Cyber War Room free →

Pro