The agent-framework PyPI compromise: your eval pipeline holds the keys
On 17 November at 20:35 UTC, version 1.26.1 of Microsoft’s agent-framework package appeared on PyPI with a credential stealer inside it. Version 1.26.2 followed at about 21:08 UTC. Both were gone by about 21:30 UTC. Wiz published its analysis the same day and added a root-cause update the following afternoon. The last safe version is 1.26.0, released on 12 November.
Most of the coverage since, including SecurityWeek and The Hacker News, has treated this as a security-team incident. It is one. It is also a test-infrastructure incident, and that part has had far less attention. The jobs that install a fresh agent SDK within hours of release, and run it while holding model keys, cloud tokens and CI identities, are usually the evaluation and test jobs. We write those suites before we write the agent, and we see them left unguarded more often than anything else in an agent project.
What the payload did
The package gets around 41,000 downloads a week. The malicious versions did not need anyone to import them. They shipped a .pth file, and Python processes .pth files in site-packages every time the interpreter starts. So the stealer ran whenever Python started in that environment: a pytest run, a linter, a one-line script to print a version number. According to Wiz, it was dressed up as SDK telemetry, with names like “_telemetry” and a “Lightweight runtime diagnostics hook”.
What it went after reads like an inventory of a typical eval runner:
- environment variables whose names contain strings such as TOKEN, SECRET, KEY, AZURE, AWS, GITHUB, OPENAI, HF_, BUILD and AGENT;
- secrets from the environments of up to 300 other processes on the same machine;
- credential files: .npmrc, pip.conf, .git-credentials, Docker config, Hugging Face tokens, and .env files under /app and /workspace;
- Azure DevOps OIDC tokens and Azure managed-identity tokens;
- in 1.26.2, GitHub Actions OIDC tokens in workflows granted id-token: write.
Version 1.26.2 also changed the trigger file, so anyone searching only for the 1.26.1 file names will miss it.
The root cause matters as well. Wiz reports that the attacker appears to have compromised a client certificate and private key for ESRP, Microsoft’s internal signing and publishing pipeline. How those credentials were obtained is not yet known. The poisoned versions therefore came through the official publishing path, which means checking that a package came from the right publisher would not have caught them. Wiz also notes that another Microsoft Python package, durabletask, was compromised earlier in 2026 after its PyPI token was stolen. The two incidents have not been linked.
Why the eval runner is the most exposed job
Think about what an agent evaluation job needs to do its work. It calls the real model, so it holds a live model API key. It exercises the agent’s tools, so it holds tokens for whatever those tools touch: a search index, a ticketing system, a storage bucket, a staging database. It runs in CI, so it often has a cloud identity attached by default. And it is the job most likely to pick up a new SDK version first, because the point of an eval run is to find out whether the new version changes the agent’s behaviour.
Production is usually better defended. The production image is pinned, reviewed and promoted. The eval environment is often rebuilt on every run from a requirements file with a loose version range, because someone wanted the latest fixes.
Wiz’s breakdown of the 50 requests captured at the exfiltration endpoint gives a sense of how quickly new releases get installed. Four came from the attacker. Twenty-nine appear linked to sandboxes, vendor scanning and tests. Seventeen represent three unique successful exfiltrations of victim data. The 29 include security vendors scanning the package, so we would not read them as victim test environments. The point they support is narrower: automated environments pull new versions within minutes. A window of under an hour is plenty for a CI job running on a loose version range.
One more detail is worth noticing. The attacker’s tooling called itself Cairn, an open-source AI penetration-testing framework, and its own run captured an AI coding agent configuration. Agent configuration files hold keys too.
“We only use it in the eval job” protected nobody
The usual reassurance after an incident like this is scope: we only import that package in one place. The .pth mechanism removes that comfort. If the package was installed in the environment, the code ran on every Python start, whether or not anything imported it. A shared virtualenv or container image used for both evals and unit tests means both were exposed. A developer laptop with one global environment means everything run on it was exposed.
This is why we argue the evaluation harness needs the same release discipline as the agent it tests. The suite’s own environment is part of the system. If the harness is careless with credentials and dependencies, the evidence it produces is weaker too, because you cannot say with confidence what actually ran when the results were recorded.
Release discipline for the harness
None of this is exotic. It is the discipline teams already apply to production, pointed at a job that has usually escaped it.
- Pin and hash-lock. Use a lockfile with hashes (pip-tools with –generate-hashes, uv or Poetry) and install with hash checking, for example
pip install --require-hashes -r requirements.txt. A new version should never arrive without a commit. - Treat an SDK upgrade as a change, not housekeeping. Bumping the agent SDK gets its own pull request and its own eval run, in an isolated environment with no production-adjacent credentials, before the main suite adopts it.
- Scoped, short-lived keys. Give the eval job a model key that only works for evaluation, with a spend limit and a short lifetime. Tool credentials should point at test fixtures, not shared staging systems.
- No ambient cloud identity. Do not attach a managed identity or grant id-token: write to jobs that do not need it. Where OIDC is needed, scope the trust policy to the specific repository, branch and workflow.
- Restrict outbound network. An eval runner needs the model endpoint and its tool fixtures, not the open internet. An egress allow-list would most likely have turned this payload into a failed request in a log.
- Separate environments. Do not share one virtualenv or image between evals, unit tests and local tooling. Each separation shrinks what one bad package can reach.
What to do this week
If you build or evaluate agents in Python, first check whether either bad version reached you. Following Wiz’s guidance, search lockfiles, CI logs, virtualenvs and container images for agent-framework 1.26.1 and 1.26.2, remembering that the two versions used different trigger files. Pin to 1.26.0. Check egress logs from the evening of 17 November. Rotate every secret that was present in an affected environment, not only the ones you think the agent used, because the stealer also read other processes’ environments and credential files on disk. Stolen managed-identity and OIDC-exchanged tokens were valid for up to 24 hours, so review what those identities did in that window.
Then, whether or not you were hit, look at your eval runner as though it were production. Write down which credentials it holds, which destinations it can reach and how a new dependency version gets into it. If the answers are “most of them”, “anywhere” and “automatically”, fix those before your next agent release rather than after the next advisory.
If you lead engineering in a regulated business, ask one more question: could you show an auditor exactly which package versions were installed when your last agent evaluation produced its evidence? If not, a hash-locked lockfile committed alongside the results is the simplest control you can add.
We describe how we set up evaluation environments in our AI assurance and evaluation work, and why agent test environments need deliberate design in our piece on agent test environments.