Your AI Agent Passed Every Prompt Injection Test. Then Someone Ran pip install.
On November 17, 2026, two malicious releases of Microsoft's agent-framework package hit PyPI and harvested cloud and CI credentials. What happened, why agent environments are so exposed, and what to check in your stack.
The worst agent incident this week never touched the model.
On November 17, 2026, someone published two new versions of Microsoft's official agent-framework package to PyPI. They came through Microsoft's own publisher account. They installed cleanly, and the framework worked exactly as before. Meanwhile, on every Python start, a background process collected cloud tokens and CI secrets and sent them to a public webhook.
No jailbreak was involved, and no poisoned document or clever prompt. The agent's security posture was settled before the agent ever ran.
33 min
between the two malicious releases
~200K
monthly downloads of the package
~1 hour
before both versions were pulled
What Actually Happened on November 17
The researchers at Wiz and Socket have reconstructed most of the chain:
- The attacker obtained signing material. Wiz traced publishing access to a client certificate and private key for Microsoft's internal release pipeline. How the attacker got them is still unknown.
- The first attempt failed. Address filtering blocked a publish from AWS. A second attempt from Microsoft-owned address space went through.
- Two versions shipped. Versions 1.26.1 and 1.26.2 went live 33 minutes apart, and each one dropped a Python startup hook.
- Nothing broke. Both versions still depended on the genuine agent-framework-core 1.26.0, so every test and every agent kept passing.
- Both were pulled within about an hour. Anything that installed them in that window should be treated as compromised.
The second release was quieter than the first. It put the package's original initializer back byte for byte and moved the hook into a new file. Anyone who checked the obvious place found nothing wrong.
Even the attacker used an agent
According to Wiz, the attacker's tooling reported its progress to the same webhook it used for stolen data. It identified itself as Cairn, an open-source, AI-assisted penetration-testing framework.
Why a .pth File Beats Every Import Audit
Python runs .pth files in site-packages every time the interpreter starts. The stealer therefore ran on any Python launch in an affected environment, including pip itself, whether or not anything imported the framework.
That gets past the checks most teams rely on:
- Import monitoring sees nothing, because nothing imports the package.
- Functional tests pass, because the real framework is still underneath.
- Production dependency lists can look clean. As Cloudsmith's head of security pointed out, a build runner may have installed it and shut down before any alert fired.
- Reviewing the package initializer missed version 1.26.2 completely.
WHAT THIS MEANS FOR YOU
A working agent tells you nothing about whether the environment it runs in is clean.
Agent Environments Are Credential Vaults With an Interpreter Attached
A machine that builds or runs AI agents holds model API keys, tool OAuth tokens, cloud identities and CI federation credentials, because the agent needs all of them to do its job. The stealer was written for exactly that environment. Per Socket and Endor Labs, it went after:
- Environment variables whose names matched patterns like TOKEN, SECRET, KEY, AZURE, OPENAI and HF_
- Other running processes, by reading their environments wherever permissions allowed
- Fresh Azure managed-identity tokens for 12 resources, which it requested rather than just copying existing ones
- GitHub Actions OIDC tokens, added in the second version
- Credential files for Git, Docker, npm, pip and Hugging Face, plus application .env files
The model never saw a malicious prompt. It didn't need to.
Keep the Scale in Perspective
The confirmed blast radius looks small. Wiz could only see the 50 requests the attacker's free webhook account kept. Of those, 17 represented just three unique successful thefts. The rest came from the attacker's own machines and from security vendors scanning the package.
The pattern is the real story. This is the second official Microsoft Python package compromised this year, after durabletask in May, and LiteLLM was hit by a similar credential stealer. The libraries that agents are built from are now a target in their own right.
What to Check in Your Agent Stack This Week
- Search every environment, including CI runners and container images, for agent-framework 1.26.1 or 1.26.2 and the files agent_framework_meta.pth or af_runtime_diag.pth.
- If you find either version, treat it as a credential compromise. Rotate everything that environment could reach, not only what it actually used.
- Rebuild from a known-good image and pin the package to 1.26.0.
- Pin agent dependencies by version and hash, and stop pulling patch releases automatically on the day they ship.
- Shrink what an agent environment can reach. Use scoped identities, keep long-lived keys out of environment variables, and give build and runtime separate credentials.
Agent Security Starts Below the Prompt
Most AI security testing begins and ends with the model: jailbreaks, injections, refusals. Those tests matter, but this incident skipped all of them. What decided the damage was what the environment around the agent could reach.
That's the gap our AIVSS-scored agentic security audits are built to measure. A CVSS score tells you how bad a flaw is. AIVSS adds the agentic amplification factors, including tool use, memory and identity, to measure how far the agent can carry that flaw. In practice we look at:
- Which secrets and identities the agent runtime can actually reach
- The blast radius if anything inside the environment turns hostile, whether that's a dependency or the model itself
- Whether tool, memory and identity boundaries hold under adversarial pressure
Our quality gates also pin prompts, tools and agent config to a hash, so every release shows a diff of exactly what changed.
The next agent incident might start with a prompt or with a package. Either way, the question is the same: how far can it get from there?


