The credential stealer in Microsoft's agent-framework did not wait to be imported. It arrived as a .pth file, and CPython's site module executes those at every interpreter start — so on any machine that installed version 1.26.1 or 1.26.2 on 17 November 2026, the collector ran the next time anything started Python, including the unrelated test step, the deploy script, the pre-commit hook. "We installed it but that job never imports agent_framework" is not a defence. The useful half of the story is what did hold: a hash-pinned lockfile stopped this outright, because 1.26.1 was never in anybody's hashes.
At a glance
The incident is unusually well-attested — Aikido, Chainguard, Elastic, Endor Labs, Orca, Socket and StepSecurity all published analyses within about 48 hours, and they agree on the facts below. Each row names who reported it, because the details are vendor telemetry rather than a vendor advisory from Microsoft.
| What happened | Detail | Reported by |
|---|---|---|
| Two malicious releases | 1.26.1 and 1.26.2, published 17 November 2026 roughly 33 minutes apart; installs between about 20:35 and 21:20 UTC are in scope |
Aikido |
| Legitimate publisher | Not a typosquat or a lookalike name — the releases came from the real Microsoft-associated PyPI publisher, and 1.26.2 went up after 1.26.1 had already been quarantined | Orca, Chainguard |
| Startup execution, not import | 1.26.1 routed through agent_framework_meta.pth; 1.26.2 used af_runtime_diag.pth to run af_runtime_diag.py |
Socket, Orca |
| What it took | Environment variables, local config files and other running processes; targets named include Azure, AWS, GitHub, Docker, Hugging Face and OpenAI credentials | Endor Labs, Wiz |
| Blast radius of the namespace | agent-framework-core and 22 other sibling packages were not affected; 1.26.0 from 12 November remains the latest clean release |
Orca, Endor Labs |
Why .pth is the whole story
A .pth file in site-packages is normally dull: a list of directories to add to sys.path. The feature that makes it a delivery mechanism is a documented CPython behaviour that predates every package manager in use today — a line in a .pth file that begins with import is executed by the site module during interpreter startup.
# what a dull .pth file contains ../src # what a weaponised one contains — site.py runs this line at every start import af_runtime_diag
Read that sequence against how a team actually reasons about a compromised dependency. The questions asked in the first hour are "do we use it?", "where do we import it?", "is it in production or only in that one prototype?" All three are the wrong question. The right one is "did any environment on any host install it", because the trigger is not your code — it is python itself, and it fires before your first line runs.
This is also why the usual mitigations people reach for do not apply. Lazy imports do not help; the import never happens. Removing the framework from a service's dependency list does not help if a developer's laptop venv still has it. Container immutability does not help if the image layer was built during the window. And because the collector also read other running processes, a build agent that happened to have a deploy in flight leaked more than its own environment.
Thirty-three minutes, and the cache that outlives a yank
The timeline is the most reassuring and the most misleading part of the incident. Elastic says it flagged the publication roughly six minutes after it went up. Both versions were quarantined on PyPI. The entire exposure window is about 45 minutes on a Tuesday evening in UTC. It is tempting to conclude that almost nobody was hit.
That conclusion confuses the publication window with the installation window, and they are not the same thing. Quarantine removes a release from the index; it does not reach into the places an artefact has already travelled:
- Your own caches.
~/.cache/pip,~/.cache/uvand CI wheel caches keep the downloaded artefact, and a cache hit does not consult the index. A pipeline that pulled 1.26.1 once can keep installing it for as long as the cache key survives. - Pull-through mirrors. Artifactory, Nexus and the various proxy registries fetch on first request and then serve their copy. A yank upstream does not evict it downstream.
- Built images. Any Docker layer built in the window is now a durable copy, and it will keep shipping the
.pthfile to every container it starts. - Lockfile hashes. If someone resolved and committed a lockfile during the window, the bad artefact is now the pinned, reproducible, "correct" one — and your tooling will fight to restore it.
So the remediation question is estate-wide and it is about storage, not about traffic: does any cache, mirror, image or lockfile under our control hold agent-framework 1.26.1 or 1.26.2? That query is answerable in minutes if you have an inventory and effectively unanswerable if you do not, which is the real reason this class of incident takes days rather than hours.
Rotate on exposure, not on confirmation. The collector read environment variables and the memory of other processes on the host; there is no log you can inspect that proves a specific token was not taken. Elastic's guidance is the right default — if either version touched a build agent or a laptop, treat every secret on that host as gone.
The clean siblings were luck, not isolation
The detail most of the write-ups note in passing deserves more weight: agent-framework-core and 22 other agent-framework-* packages were untouched, still sitting at their 12 November releases. That reads like containment. It is not — it is the shape of the attack rather than a property of your defences.
A publisher account that can push agent-framework can generally push its siblings too, and whoever had it kept it long enough to publish a second release after the first was quarantined. The namespace is 23 independently-versioned packages that your lockfile pins independently and that a human reviewing a diff reads as one dependency. Pinning the umbrella package is not pinning the namespace; a compromise that had chosen two siblings instead would have produced exactly the same diff in your lockfile and attracted exactly the same amount of attention.
The general lesson for agent stacks specifically is that the dependency graph under an agent framework is unusually wide and unusually privileged. It is the component you deliberately give cloud credentials, a model API key, a GitHub token and often a shell. There is no configuration in which this is a low-trust dependency, which is why the controls below are worth their cost here even if you skip them elsewhere. See our earlier piece on dependencies the agent adds for you for the adjacent failure: a package that was never in the lockfile at all.
What actually held, in order of how much it buys
Comparing the rows is more instructive than reading them. The two that hold do so for the same reason — the artefact has to match something decided in advance — while the two that fail do so for the same reason, which is that they ask the index what the newest acceptable version is at install time.
- Hash-pinned lockfiles, enforced. This is the control that actually worked on 17 November, and it is also the one most teams believe they have and do not. A
poetry.lock,uv.lockorrequirements.txtwith--require-hashesmakes 1.26.1 unresolvable: it is a version nobody recorded a hash for. The enforcement word matters — an unpinnedpip installanywhere in a Dockerfile, a tox environment or a developer's setup script routes around the lockfile you are relying on. - A publish delay on a private mirror. Quarantine happened in roughly 45 minutes. A mirror that refuses to serve a release less than 24 or 48 hours old converts almost every incident of this class into a non-event, and it also gives you the record of what was requested. This is the highest-leverage change available to a platform team and the one most often rejected as friction.
- No credentials in the environment that performs installs. The stealer was good at its job; the fix is not to out-run it but to make the step it runs in boring. Resolve and build in a job with no cloud credentials, then run with credentials in a job that does not install. This also removes the "other running processes" vector, because there are none worth reading.
- An inventory that answers the storage question. Not a dependency scanner — those report declared dependencies — but the ability to list which hosts, images and caches hold a given artefact version. The incident's duration is almost entirely a function of how long this takes you.
- Exact pins without hashes. Worth noting as the honest middle:
==1.26.0would have stopped this specific attack, because the attacker published new versions rather than republishing an existing one. It would not stop a republished artefact under the same version, which is what hashes are for.
None of this is agent-specific, and that is the point worth taking away. The agent framework was not compromised because it is an agent framework; it was compromised because it is a popular Python package. What is agent-specific is the payout. A stealer inside a web framework gets a database password. A stealer inside the thing you handed a cloud role, a model key and a repository token gets the keys to the loop.
FAQ
Was Microsoft's package actually compromised, or was this a lookalike?
The real package. Researchers found the malicious releases under the legitimate Microsoft-associated PyPI publisher, not a typosquat — Orca reports the publisher account was subsequently secured. That is what distinguishes this from the steady background rate of name-confusion attacks.
Am I affected if my code never imports agent_framework?
Yes, if the install happened. The payload was delivered through a .pth file, which the site module executes at interpreter startup regardless of what you import. The relevant question is whether 1.26.1 or 1.26.2 was ever installed into any environment on the host.
Which versions are safe?
1.26.0, published 12 November 2026, is the last clean release and was still current at the time of the incident. Treat any agent-framework release dated 17 or 18 November 2026 as suspect until Microsoft confirms it, which is Chainguard's guidance and the conservative reading.
Do I need to rotate secrets, or can I check the logs first?
Rotate. The collector read environment variables, config files and other processes' memory on the host, and none of those reads leave a trace you can audit. If either version was installed on a build agent or a laptop, assume every secret available to that host is compromised.
Did the sibling packages need pinning too?
They were not affected, but they share the publisher. If you depend on agent-framework-core or any other agent-framework-* package, pin and hash them individually — your lockfile already treats them as 23 separate dependencies, and so should your review.
Would a container have protected me?
Only if the image was not built during the window and the container holds no credentials worth taking. Immutability is not isolation: a layer built between roughly 20:35 and 21:20 UTC on 17 November carries the .pth file into every container started from it, indefinitely.
Further reading
On this wiki:
- Agent supply-chain security — the full threat model this incident is one instance of.
- Pinning & verification — what a pin does and does not promise.
- Secrets management for agents — why the install step should not hold credentials.
- Agent artifacts on the endpoint — the developer laptop as the hardest surface to inventory.
- Detecting agent compromise — what a stolen credential looks like downstream.
- Vetting a third-party skill — the same review problem one layer up.
Sources:
- Aikido — two malicious releases in 33 minutes (timeline and install window)
- Socket — the
.pthrouting in both versions - Orca Security — publisher, siblings and credential targets
- Chainguard — guidance on later releases
- Elastic Security Labs — detection timing and rotation advice
- Endor Labs — startup hooks and sibling-package check
- PyPI —
agent-frameworkrelease history