Cybersecurity

Microsoft Agent Framework PyPI Package Compromised: Lessons

Attackers briefly hijacked Microsoft's Agent Framework package on PyPI to steal Azure, GitHub and OpenAI credentials. Here is what happened and what to check.

Tech After Me CEOCEO & Odoo ConsultantPublished 5 min read
Share
Microsoft Agent Framework PyPI Package Compromised: Lessons
On this page

Microsoft Agent Framework PyPI package compromised to steal credentials is the short version of a story that should worry anyone running AI or cloud workloads. On November 17, 2026, attackers published two malicious versions of Microsoft's official Agent Framework package on PyPI, the main repository Python developers use to install software. The package is popular, with around 190,000 to 200,000 monthly downloads, and the malicious releases sat live long enough for unpinned installs, CI caches, and container builds to pull them in.

This was not a typo-squat or a lookalike package. It was the real, official Microsoft project, compromised at the publishing level. That distinction matters for how seriously business and IT leaders should treat the incident.

How the Microsoft Agent Framework PyPI package compromised incident unfolded

Versions 1.26.1 and 1.26.2 of agent-framework still depended on the legitimate agent-framework-core 1.26.0 package, so applications kept working normally while malware ran quietly in the background. According to Socket, StepSecurity, Ox Security, Aikido Security, and Endor Labs, the payload executed automatically during Python startup, even in environments that never imported the Agent Framework package directly.

The stealer searched environment variables containing words like TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB, and OPENAI. It also read up to 60 credential files, including Azure CLI settings, Git and Docker credentials, npm and pip configuration, Hugging Face tokens, and application .env files, and pulled secrets from as many as 300 other running processes. Beyond stealing existing secrets, it actively requested new Azure managed identity tokens and Azure DevOps OIDC tokens, which can be exchanged for broader cloud access well beyond what was already stored on disk.

PyPI quarantined the first malicious version, but the attacker published a second one about two and a half minutes later using a different file path for the same payload, which suggests continued publishing access even after the first takedown. Both versions sent stolen data to the same webhook.site endpoint. Microsoft has not said publicly how the attacker gained access to publish under its official project, and had not confirmed a root cause at the time these reports were published.

Why the agent-framework compromise matters beyond one package

This incident lands squarely inside the AI developer ecosystem. The target list, OpenAI tokens, Hugging Face credentials, and Azure AI Foundry access, points to attackers specifically chasing the infrastructure behind AI agents and automated build pipelines, not just individual developer laptops. Endor Labs noted the payload reads like it was written for CI runners and Azure workloads first, developer machines second. OpenAI itself was not the target of the breach, but its API tokens were one of several credential types the malware searched for, which shows how far the blast radius of a single compromised package can reach.

It is also not an isolated event. Endor Labs flagged a similar compromise of Microsoft's durabletask Python SDK in May of the same year, though no researcher has linked the two attacks directly. Two incidents in one year involving official Microsoft Python packages is enough to treat this as a pattern worth planning around, not a one-off.

If your team is already experimenting with AI agents inside Odoo or other systems, this is a useful reminder that the AI & ML development stack carries the same supply chain exposure as any other software dependency chain. The convenience of pulling in popular packages does not remove the need to vet what is actually being installed.

The short-window trap

A common reaction to "the malicious version was only live for under an hour" is relief. That reaction is mistaken. Any build that ran during that window, whether a developer's local install, a CI job, a Docker image layer, or a lockfile committed to source control, can carry the malicious code forward indefinitely until someone finds and removes it. A short window limits new infections after the takedown; it does nothing to limit what was already baked into existing artifacts.

What companies should do now

Security firms investigating the Microsoft Agent Framework PyPI package compromised incident converged on a consistent response checklist:

ActionWhy it matters
Search for agent_framework_meta.pth, _telemetry.py, af_runtime_diag.pth, af_runtime_diag.pyThese are the specific files used by the two malicious versions
Check CI images, container layers, and lockfiles, not just live serversThe payload can persist in artifacts built during the exposure window
Review egress logs for webhook.site trafficConfirms whether data actually left the environment versus being blocked
Rotate Azure service principal secrets, PATs, and GitHub, npm, PyPI, Docker, Hugging Face, OpenAI tokensAny credential reachable from an affected host should be assumed compromised
Review Azure sign-in logs for unusual managed identity or federated credential useDetects whether stolen tokens were actually used to access resources
Pin dependencies to hash-verified releasesPrevents an unpinned range from silently pulling a future compromised version

Removing the package does not undo anything that was already sent out, a point several of the researchers made directly. Treat exposure like a breach, not a cleanup task: isolate, rotate, and investigate in that order.

Where this fits into a broader security posture

Supply chain compromises like this one are exactly the kind of risk that generic antivirus or firewall rules do not catch, because the malicious code arrives disguised as a routine dependency update. Reviewing how dependencies are pinned, how CI secrets are scoped, and how outbound traffic from build infrastructure is restricted is the kind of work that belongs in a periodic review, not a one-time fix. If your team has not audited its CI/CD credential exposure in the last year, this incident is a reasonable trigger to do so, and our cybersecurity services team can walk through that scoping exercise with you. Related reading on securing other parts of the stack is in our DevOps services overview, and for a look at how automated access controls can limit blast radius inside your own ERP, see our piece on Odoo access rights and record rules.

One honest limitation worth naming: no amount of internal process guarantees a vendor's own publishing pipeline stays secure. Microsoft has not disclosed how the attacker got in, and until that is known, any team using agent-framework or similar Microsoft Python packages is relying partly on trust rather than verifiable control. Hash-pinning and egress restrictions reduce exposure; they do not eliminate it. Build your monitoring assuming the next compromised package might look just as clean as this one did.

Share

Frequently asked questions

What happened with the Microsoft Agent Framework PyPI package?

Attackers published two malicious versions, 1.26.1 and 1.26.2, of Microsoft's official Agent Framework package on PyPI on November 17, 2026. The versions contained a credential stealer that ran automatically during Python startup and exfiltrated secrets to an attacker-controlled webhook.

Which credentials were targeted?

The stealer searched for environment variables and configuration files tied to Azure, AWS, GitHub, Docker, Hugging Face, OpenAI, npm, and pip. It also requested Azure managed identity tokens and Azure DevOps OIDC tokens, which can unlock broader cloud access.

How long were the malicious versions live on PyPI?

Reports indicate the window was short, roughly 45 minutes to under an hour, before PyPI quarantined both releases. A short window does not guarantee safety, since any unpinned install, CI cache, container image, or lockfile built during that time could still contain the malicious code.

Does removing the package fix the problem?

No. Removing or downgrading the package stops the malware from running again, but it does not reverse any data that was already sent to the attacker. Any credential reachable from an affected host should be treated as compromised and rotated.

How can a company check if it was affected?

Search hosts, build agents, container images, and lockfiles for the files agent_framework_meta.pth, agent_framework_meta/_telemetry.py, af_runtime_diag.pth, and af_runtime_diag.py. Also review egress logs for connections to webhook.site and check Azure sign-in logs for unusual managed identity or federated credential use.

What should teams do to reduce this risk going forward?

Pin dependencies to specific, hash-verified versions rather than open ranges, restrict outbound traffic from build infrastructure to known destinations, and separate developer credentials from CI credentials so a single compromised package cannot reach both.

Sources

About the author

Tech After Me CEO

CEO & Odoo Consultant

The CEO of Tech After Me implements, customizes and supports Odoo ERP and builds web, mobile and data products for companies in Thailand, the USA and India.

More from this author

Keep reading

Put what you read into practice

The team writing these guides is the same team that ships them. Tell us what you are working on.

Get new articles in your inbox

Get new articles in your inbox

Odoo guides and IT news that matter to your business. At most one email a week.