The Agent Framework malware could seek cloud access without a saved password
Malicious releases could collect credentials without a framework import. Recovery means investigating…
The short version
- Malicious agent-framework releases 1.26.1 and 1.26.2 could collect credentials at Python startup without an application importing the framework.
- The second release could request GitHub Actions OIDC tokens, but Azure access still required matching federation trust and resource permissions.
- Affected environments warrant isolation, clean rebuilding and credential investigation; registry quarantine does not remove installed files or resolve prior exposure.
The agent-framework hack turned Python startup into a cloud login
Running pip to inspect this infection could wake it up. My usual tool can start the Python interpreter that runs the malware.

In the Microsoft agent-framework PyPI compromise, malicious releases 1.26.1 and 1.26.2 could execute at Python startup, without an application importing the framework. The collector could search for credentials and request fresh tokens from accessible identity endpoints. A routine dependency check could inherit deployment authority.
Kanishka Narayan said:
For too long, Britain has produced some of the world’s best scientific ideas, only to see too much of the technology, industry and wealth they create built elsewhere.
If I found either release installed, I’d isolate the environment before running Python or pip. Registry quarantine doesn’t remove files from runners or container images. I’d check when that interpreter last started and what it could access.
Python startup supplied the invitation
I’d start with agent_framework_meta.pth, the first malicious release’s hook. StepSecurity’s analysis traces it through the altered package initializer to agent_framework_meta/_telemetry.py. Searching application code for framework imports would miss it.
Installing the wheel placed the hook in site-packages. On a subsequent normal launch, Python’s site initialization reads.pth files in recognized package directories. Their import lines execute before the user’s script. The malicious line imported the collector through the package initializer, so a Python-based linter or later test could activate it without touching Agent Framework. Scope depends on which directories that interpreter processes. I wouldn’t declare every virtual environment infected because a neighboring one contained the wheel.
I’ve found “we never import that package” reassuring before. Time to retire that shortcut.
The second release punished another plausible review habit. Endor Labs and Mend found it restored agent_framework_meta/__init__.py to clean content, moving execution to a separate top-level module. The new pair: af_runtime_diag.pth and af_runtime_diag.py.
Comparing only the initializer with the legitimate release could leave me with a clean diff and an unreviewed startup hook. I’d inspect wheel contents alongside the repository comparison. Python executes the installed artifact.
Once loaded, the collector guarded against repeat execution in child processes and tried detaching into a background process, falling back to a daemon thread. It searched accessible environment variables, other processes’ environments and credential files. According to JFrog, it compressed and Base64-encoded collected JSON before an HTTPS POST to webhook.site.
JFrog found no payload encryption. Base64 encoded the data; HTTPS protected transport.
Genuine framework dependencies remained, so normal functionality could survive background collection. I’d keep a passing build as evidence of execution timing, not grounds to close the investigation.
OIDC leaves authority inside the job
Before congratulating myself on having no saved Azure password in repository secrets, I’d check id-token: write. Wiz found the second release could request GitHub Actions OIDC tokens when workflows exposed the necessary request variables.
I still recommend OIDC: removing a long-lived cloud key removes something valuable to steal. But I must decide which code can run inside a job authorized to request fresh identity tokens.
With suitable permissions, a GitHub Actions job receives access to an OIDC request endpoint. Code inside can use exposed request credentials to ask GitHub for an ID token describing the workflow identity and intended audience. That isn’t an Azure access token. Microsoft Entra requires a matching trusted federated credential for an exchange; the resulting Azure identity has its assigned resource permissions. A recorded token request establishes an attempt. Production Key Vault access also requires matching federation trust and resource permissions.
I won’t turn every attempt into a cloud takeover, or assume a short token lifetime makes immediate exfiltration harmless.
The OpenSourceMalware team put it well in its analysis:
That combination of passive theft and active token requests makes it especially dangerous in cloud build environments, because even short-lived tokens are useful when they're exfiltrated right away.
The payload also tried available Azure identity endpoints. Useful access depended on the environment and identity permissions. A collector can ask ambitiously; the cloud still has to authorize it.
Kat Jones said:
Hyperscale AI datacentres simply cannot run on renewable power alone, they absolutely need a highly reliable source of grid power.
The Azure DevOps branch needs another caveat. Elastic found the analyzed requests omitted serviceConnectionId, a parameter in Microsoft’s documented flow, and JFrog reports rejection by real endpoints. I’d record attempted token issuance; successful federation through that branch remains unestablished.
I caught myself asking where pipelines store secrets before asking when they acquire authority. My proposed change: install and test dependencies in a job without deployment identity, then authorize deployment separately with narrow permissions.
Researchers haven’t experimentally validated that defense here. I’d propose it because the collector could exercise its process’s capabilities; separating dependency execution from deployment identity removes one it could otherwise try.

In my diagram, two branches leave the startup hook: readable credentials and requestable identity tokens. The token branch needs separate gates for request permission, federation trust and resource authorization.
The webhook was a window into the operation
I agree with the strongest argument against a sprawling breach headline: public evidence supports a much narrower claim than package popularity suggests.
Wiz analyzed 50 requests at the attacker’s webhook, including attacker activity and apparent sandbox, scanning and test traffic. That mixed sample cannot establish a victim count. Neither can package-wide downloads.
Installation places malicious files in an environment; a later interpreter launch can activate them. Collection may hit unreadable files or unavailable identity endpoints before attempting upload. Independent launches can generate multiple requests from one environment. Wiz could classify available webhook inbox records, but free-tier limits constrained visibility. Those records cannot establish worldwide malicious installations or everything attackers subsequently did with collected credentials.
The shared inbox gave defenders an unusual opening. The attacker sent progress messages and stolen data to a publicly accessible webhook, letting Wiz observe otherwise hidden activity. I’d appreciate that mistake without mistaking the inbox for a complete audit trail.
Network alerts need similar restraint. StepSecurity cautions that connecting to the domain alone doesn’t confirm exfiltration. I’d record a DNS lookup differently from an accepted upload.
The publishing timeline is firmer. StepSecurity’s November 17 timestamps place the first quarantine about 30 minutes after publication, then the second malicious upload about 2 minutes later. Publishing access remained usable for that second upload.
I can’t infer continued access afterward. A later advisory says PyPI Security and Microsoft completed account-review and remediation steps. I’d include that, however much persistent access improves the headline.
Attribution has similar limits. Wiz reported evidence suggesting compromise of an ESRP certificate and private key associated with Microsoft’s release service. SafeDep said upload logs needed to confirm its maintainer-account hypothesis hadn’t been released. How publishing credentials were obtained, and which account uploaded the wheels, remain unresolved in the supplied public record.
Two more blanks in my incident notes: the number of affected organizations and the full extent of successful credential use beyond records Wiz could inspect.
I’d rebuild before trusting that runner again
I’d pause affected workflows, isolate the relevant runner or host, then inspect it with trusted tooling outside the suspect Python environment. Asking that environment’s Python whether it contains malware is a little too participatory for my taste.
I’d review installation logs and image records, then compare lockfiles and the filesystem. Today’s clean lockfile says little about yesterday’s installation. Mend identifies virtual environments, container images and CI caches as investigation targets. Each can preserve the artifact after registry distribution stops.
I’d inspect both hook-and-payload pairs: agent_framework_meta.pth with agent_framework_meta/_telemetry.py, and af_runtime_diag.pth with af_runtime_diag.py. Before deleting them, I’d preserve evidence needed to reconstruct execution. The linked advisories provide fuller artifact and hash inventories.
Rebuilding takes more than a downgrade. I’d recreate affected virtual environments and images from a clean base, then replace contaminated caches. The advisories identify 1.26.0 as the clean predecessor. Pinning that umbrella package constrains its version, but its dependencies may permit release ranges, letting a new resolver run select a different permitted set. Locking the resolved set makes that selection explicit; hash verification checks selected files against approved bytes. Before restoring valuable access, I want its resolved dependencies accounted for and executable files verified.
Then I’d investigate what the collector could reach during execution: credential files and process environments readable under operating-system permissions, plus workload identities the job could request.
Wiz’s static analysis puts the second release’s credential-file cap at up to 80 files versus 60 in the first, and notes added GitHub runner paths. Those code limits help me scope investigation; successful theft still needs evidence.
I’d revoke or rotate exposed credentials as appropriate and investigate their use. For workload identities, I’d review federation trust, resource permissions and token-request capability, correlating Entra sign-in records and Azure activity logs with CI execution times. Changing a stored secret may leave an issued token usable; that token needs its own response assessment.
Whoever owns the pipeline, which might be me, owes an awkward answer: why does dependency installation happen after deployment authority becomes available?
At the next pipeline review, I want the first step needing that authority on screen. If it’s halfway down the job, someone must explain why an interpreter launched near the top can already ask Azure for credentials. Preferably before we approve the next dependency update.
Frequently asked questions
Which Microsoft Agent Framework versions were malicious?
The malicious Microsoft Agent Framework releases on PyPI were agent-framework 1.26.1 and 1.26.2. The advisories identify 1.26.0 as the clean predecessor. Installed malicious files could remain in virtual environments, container images and CI caches after registry quarantine, so checking current package availability alone cannot establish whether an environment was exposed.
How could the malware run without importing Agent Framework?
The malicious wheels installed.pth files in site-packages. During a subsequent normal interpreter launch, Python’s site initialization processes recognized package directories and executes import lines in those files. The hooks loaded the collector before the user’s script, allowing Python-based tools to activate it without an application importing Agent Framework.
Did stolen GitHub Actions OIDC tokens automatically grant Azure access?
A GitHub Actions OIDC token is not an Azure access token. Microsoft Entra requires a matching trusted federated credential before exchanging it, and the resulting Azure identity has assigned resource permissions. A recorded token request therefore establishes an attempt, not proof of successful access to production resources.
Sources
- Microsoft agent-framework PyPI Package Compromised
- Microsoft agent-framework Compromised: Credential Stealer Targets Azure and CI Pipelines
- We caught the agent-framework PyPI compromise six minutes after it published
- Microsoft's agent-framework Hijacked on PyPI via Silent.pth Startup Hook
- agent-framework compromised: Python startup hooks steal Azure and CI credentials
- Microsoft agent-framework Compromised Twice on PyPI