PyPI quarantined the first malicious agent-framework wheel 31 minutes after it was uploaded, and the second one eight minutes after that. Forty-two minutes of exposure, end to end. That number leads every writeup, and it measures one thing: how long the file was downloadable from the public index. It tells you nothing about how long the payload keeps running inside a build environment that pulled it.
The package is the meta-package for Microsoft Agent Framework, the open-source Python stack for building AI agents, at roughly 190,000 downloads a month. Versions 1.26.1 and 1.26.2 went up on November 17, 2026 under the project's own legitimate name, not a typosquat. Both carried a credential collector that runs from a Python startup hook and then goes looking for Azure and CI tokens. Both are now marked "Release quarantined" on PyPI. Wiz, Socket, Endor Labs and StepSecurity published independent reversals within hours of each other, and they agree on the mechanism. As of this writing Microsoft has published no statement and there is no GitHub security advisory on the project.
Relevance verdict. If agent-framework appears nowhere in your requirements files, lockfiles, container images, package-proxy cache or CI logs, this one is not yours and you can close the tab. The sub-packages are clean: Endor Labs checked 22 agent-framework-* distributions and found no releases after November 12, and both malicious wheels pin agent-framework-core[all]==1.26.0, so the rest of the framework installed normally. If the meta-package does appear anywhere in your estate and anything resolved it loosely, the question you have to answer is narrower than "were we breached" and harder than "did we install it": did any Python interpreter start in an environment that received one of those two wheels.
The forty-two minutes on PyPI, in order
StepSecurity reconstructed the upload sequence from PyPI's own event data, and Wiz's timeline agrees within a couple of minutes.
- November 12, 18:24 UTC. Legitimate
1.26.0is published with both a wheel and an sdist. This is the last clean release. - November 17, 20:35:20 UTC.
1.26.1is uploaded. Wheel only, no sdist, with an uploader user-agent ofRestSharp/106.13.0.0rather than the project's normal publishing tooling. - November 17, 21:06:16 UTC. PyPI quarantines
1.26.1. - November 17, 21:08:39 UTC.
1.26.2is uploaded, two minutes and 23 seconds after the first quarantine. The attacker still held publishing rights at that moment. - November 17, 21:16:44 UTC. PyPI quarantines
1.26.2.
Nobody has confirmed how the publishing access was obtained. Wiz found no matching python-1.26.1 tag or release in the microsoft/agent-framework repository and no malicious code on the main branch, which puts the build outside the project's normal release process. StepSecurity's timeline records a maintainer account added to the project the same day. Treat that as a lead, not a conclusion, until Microsoft or PyPI says more.
Why the window is the wrong boundary
Forty-two minutes sounds survivable, and for anyone installing interactively it mostly was. The problem is everything that freezes a wheel in place. A container image built at 20:50 UTC carries 1.26.1 until you rebuild it, and it will keep carrying it through every deployment of that image next week. A pip wheel cache on a long-lived build agent serves the same artifact after PyPI stopped doing so. An internal package proxy or mirror that fetched the release during the window now holds a copy that quarantine upstream does not remove. A lockfile regenerated in that window pins the bad version by hash, and the pin will survive review because it looks like a routine bump.
The install window is 42 minutes; the execution window is open-ended, and the practical boundary for triage is the build artifact. Anything produced after 20:35 UTC on November 17 that ran pip install agent-framework without an exact pin is in scope, and it stays in scope until the artifact is rebuilt from a clean index.
The .pth file did the work
The payload never relies on your code importing anything. Python's site module scans site-packages for .pth files at interpreter startup and executes any line beginning with import. Dropping one line into a .pth file buys execution on every Python launch in that environment, including pip itself.
The two versions used the same trick with different plumbing, and the difference matters for detection:
- 1.26.1 ships
agent_framework_meta.pthcontainingimport agent_framework_meta, and appends a block to that package's__init__.pythat imports a_telemetrymodule and calls_start(). - 1.26.2 restores
__init__.pybyte for byte to the clean1.26.0file and moves the payload to a top-levelaf_runtime_diag.py, loaded byaf_runtime_diag.pth. A diff of the package module finds nothing in this version. Endor Labs called the hash of that file a non-indicator for exactly this reason.
_start() wraps everything in a bare try/except so failures are silent. It sets _AF_TEL=1 in the environment as a guard against re-running in child processes, then forks and calls os.setsid() so the collector outlives the parent process; on platforms without fork it falls back to a daemon thread. Socket's analysis makes the follow-on point that is easy to miss during cleanup: the guard lives in process memory only. There is no file on disk saying the collector already ran, so every fresh top-level Python launch collects again.
Running pip list in the affected virtualenv to see what is installed starts Python, and starting Python runs the hook.
It asked for new tokens, which changes your rotation list
The collection stage is ordinary. Environment variables are matched by substring against TOKEN, SECRET, KEY, AZURE, AWS, GITHUB, OPENAI, HF_, FOUNDRY, TENANT, CLIENT and MANAGED, with ACTIONS, OIDC, RUNNER and ARM_ added in 1.26.2. It reads up to 300 entries under /proc/*/environ to lift secrets out of other processes, and pulls up to 80 credential files: ~/.azure/*.json, .npmrc, pip.conf, .netrc, .git-credentials, .docker/config.json, Hugging Face tokens, Azure DevOps agent .credentials files, and .env and JSON files under /app and /workspace.
The stage after that is the one that breaks a normal rotation plan. The collector does not only copy credentials that already exist. It uses them to request fresh ones.
- Azure managed identity. Where
IDENTITY_ENDPOINTor the IMDS endpoint at169.254.169.254answers, it requests tokens for twelve resources, among them Azure Resource Manager, Microsoft Graph, Key Vault, Storage, Container Registry and Azure DevOps. It also retains up to 8,000 characters of instance metadata, which exposes subscription, resource group and host identity. - Azure DevOps. With
SYSTEM_ACCESSTOKENandSYSTEM_OIDCREQUESTURIset, it requests a federated token forapi://AzureADTokenExchange. Present in both versions. - GitHub Actions. New in 1.26.2. In any job with
id-token: write, it readsACTIONS_ID_TOKEN_REQUEST_URLand requests OIDC tokens forapi://AzureADTokenExchangeandhttps://management.azure.com/.
Rotating the secret in your vault does nothing to a token that was minted from it. Wiz puts the lifetime of stolen managed-identity and OIDC-exchanged tokens at up to 24 hours, and both Endor Labs and StepSecurity point out that deleting a federated credential does not revoke tokens already issued under it. The rotation list has to include a revocation step: review managed identity and federated sign-in activity for the period after exposure, revoke refresh tokens on affected service principals, and treat the federated trusts those workflows rely on as exposed rather than merely suspect.
Exfiltration is a single HTTPS POST. The collected data is serialized to JSON, zlib-compressed, base64-encoded and sent to a hardcoded webhook.site URL with the query string ?t=telemetry. Failures are swallowed with no retry and no fallback channel. One detail genuinely limits the damage: Wiz confirmed the attacker used a free-tier webhook.site token, which caps at 100 requests, and that it captured at most 50. Fifty working sets of cloud, CI and registry credentials is still fifty.
Hunting it without starting Python
Every vendor that reversed this lands on the same first instruction, and it is counterintuitive enough to repeat: do not run python or pip in an environment you suspect. Read the filesystem with tools that do not start the interpreter.
# Run from a trusted shell. Do NOT invoke the suspect environment's python or pip.
find / -xdev \( -name 'agent_framework_meta.pth' -o -name 'af_runtime_diag.pth' \) \
-printf '%p\t%TY-%Tm-%Td %TH:%TM\n' 2>/dev/null
find / -xdev -type d -name 'agent_framework-1.26.[12].dist-info' 2>/dev/null
# Loose pins that could have resolved to 1.26.1/1.26.2 during the window
grep -rsnE 'agent[-_]framework\s*(==\s*1\.26\.[12]|[><~^=]*\s*1\.2[5-9])' \
--include='*.txt' --include='*.in' --include='*.toml' --include='*.lock' / 2>/dev/null
# Confirm by hash (Socket / Wiz, SHA-256)
# af_runtime_diag.py 54d885b7d7161c9ed96489c66364c4bfbf635929166843bba10d97d46b5a2e1f
# af_runtime_diag.pth 325e7e9f0ec94e41ad1a1b7a3f18a6b8b5bffece2e2b97b8d3369eb967452f93
# wheel 1.26.1 d27fa34414e6201d5e03e559ef634f020057554d7b3f4898dd5d7cd3e989e110
# wheel 1.26.2 3d20a8bc91351a9a16b6db243b848ceca0206b7a8623b02d2af553a9c9f7e0a9
Then sweep the images, because that is where it persists
Host scans miss the artifacts that froze the wheel. Walk every image built after the upload and look for the hook inside it, with networking disabled so nothing you start can phone home.
# Inspect images created after the first malicious upload (2026-11-17 20:35 UTC).
for img in $(docker images --format '{{.Repository}}:{{.Tag}}' | grep -v '<none>'); do
created=$(docker image inspect "$img" --format '{{.Created}}')
[[ "$created" > "2026-11-17T20:35:00" ]] || continue
hit=$(docker run --rm --network none --entrypoint sh "$img" -c \
'find / -xdev -name "*.pth" -exec grep -lE "^import (af_runtime_diag|agent_framework_meta)" {} + 2>/dev/null')
[[ -n "$hit" ]] && printf 'SUSPECT %s\n%s\n' "$img" "$hit"
done
And check what left the network
Match on the full webhook.site path, since the service itself is legitimate and used by plenty of honest tooling. The token-request burst is the better signal anyway, because it fires before exfiltration and does not depend on egress succeeding.
// Defender XDR / Microsoft Sentinel: the collector's egress
DeviceNetworkEvents
| where Timestamp >= datetime(2026-11-17 20:35:00)
| where RemoteUrl has "d381fd80-ec62-42ad-8f5c-d1b15103c9bb"
or InitiatingProcessCommandLine has_any ("af_runtime_diag", "agent_framework_meta")
| project Timestamp, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine, RemoteUrl
// One identity asking for many audiences in a few minutes is the token sweep
AADManagedIdentitySignInLogs
| where TimeGenerated between (datetime(2026-11-17 20:35:00) .. datetime(2026-11-19 00:00:00))
| summarize audiences = dcount(ResourceIdentity), requests = count()
by ServicePrincipalId, bin(TimeGenerated, 5m)
| where audiences >= 6
| order by audiences desc
On a proxy rather than an EDR, the user-agent strings are af-runtime-diagnostics/1 for 1.26.1 and runtime-diagnostics/1 for 1.26.2. A 200 response means that host's data was accepted. A 410 or 429 means the free-tier token had already filled up and the POST was rejected.
Start with the images built after 20:35 UTC
Order the work by what keeps executing. Rebuild and redeploy every container image and CI runner image produced after 20:35 UTC on November 17 from a clean index, with agent-framework==1.26.0 pinned by hash and both bad versions blocked at your package proxy. Only then rotate, and rotate from a clean machine, because a rotation performed inside a compromised virtualenv hands the next set of credentials to the same collector. Finish with the revocation step that rotation alone does not cover: refresh-token revocation on affected service principals, and a review of managed identity and federated sign-in activity for the 24 hours after exposure.
Two controls would have shortened this from an incident to a non-event, and both are configuration rather than spend. A minimum release age on your package proxy, set to something as short as 24 hours, would have made the 42-minute window unreachable. An alert on any third-party wheel that installs a .pth file containing an import line catches this class of attack regardless of which package carries it next. Add a third if you run Azure from CI: scope id-token: write to the jobs that actually deploy, rather than granting it at workflow level and forgetting it is there. If you want a second set of eyes on whether a dependency compromise reached anything that matters, that is the kind of engagement we run.
Need an incident response plan before the next dependency compromise?
We help organizations scope package-compromise incidents and build and test the incident response playbooks that make the next one routine. Book a session with our team.
