AWS and Cloudanix team co-authored this blog: Real-Time Threat and Anomaly Detection for Workloads on AWS

Cloudanix – Your Partner in Cloud Security Excellence

Microsoft's agent-framework Package on PyPI Was Poisoned to Steal Cloud Credentials: How to Check If You Were Hit and How to Limit the Damage

  • Purusottam Mupunu Purusottam Mupunu
  • Monday, Nov 23, 2026

On November 17, 2026, attackers published two malicious versions of agent-framework, the Python package behind Microsoft’s open-source Agent Framework for building AI agents. The two releases, 1.26.1 and 1.26.2, appeared 33 minutes apart. Each one was built to run a credential stealer every time Python starts, whether or not anything in your code used the package. Security vendors including Aikido, Chainguard, Endor Labs, OX Security, SafeDep, Socket, StepSecurity and Wiz reported on it, and the package, which sees about 190,000 downloads a month, was quarantined on the Python Package Index (PyPI). The Hacker News has the full account.

This post explains what happened in plain language, who is at risk, and what to do. It is useful whether or not you ever installed this package, because the technique, and the cloud tokens it went after, apply to any Python environment that builds or deploys software. We cover general steps any team can take with built-in tools, and how Cloudanix can help.

Primary source: The Hacker News report, which cites the security vendors named above. It was updated on November 20 with a statement from Microsoft. It is unclear how the attacker got publishing access to the package. We describe only what the report states. Commands are our own guidance and should be tested first.


Who Should Read What

  • Python developers and ML or AI engineers: “What Happened,” Steps 1 and 2. You are the most likely to have installed it.
  • DevOps and platform engineers: Steps 3 to 7. Your CI runners and cloud identities were the target.
  • Security and incident response teams: Steps 2, 3 and 8. The exposure window is short, which makes a targeted search practical.
  • Engineering leaders and CISOs: “Why This Keeps Happening” and “Key Takeaways.” The fix is mostly about how much a stolen token can do.
  • Compliance teams: Step 7 and the Cloudanix section. Auditors increasingly ask for a software bill of materials and for proof that build credentials are short-lived.

What Actually Happened

Each term below is explained, so you do not need background knowledge.

The package. A package is a bundle of reusable code. PyPI is the public store where Python developers download packages, usually with a command such as pip install. agent-framework is the “meta-package” for Microsoft Agent Framework, which means installing it pulls in the pieces of the framework. A framework for building AI agents is typically installed on developer laptops, CI servers and cloud machines that hold access to cloud accounts, which is what made it an attractive target.

The poisoned releases. Versions 1.26.1 and 1.26.2 were published on November 17, 2026, 33 minutes apart. Users who were exposed installed them between about 8:35 and 9:20 p.m. UTC on that day, according to the report’s guidance. Both versions have since been quarantined, meaning PyPI no longer serves them. The last known safe version is 1.26.0. It is not known how the attacker obtained the ability to publish.

How the stealer ran. Each malicious version added a small file ending in .pth to the site-packages folder, which is where Python keeps installed packages. A .pth file is normally used to add folders to Python’s search path, but Python also executes any line in it that begins with import. That means the stealer ran every time any Python program started on that machine, including pip itself, even if no code ever imported the package. The two files were named agent_framework_meta.pth (version 1.26.1) and af_runtime_diag.pth (version 1.26.2). This is why “we never used that package in our code” is not a safe answer.

What it collected. According to Socket, Endor Labs and SafeDep as quoted in the report:

  • Environment variables whose names matched credential-like terms (an environment variable is a named setting that a program reads from its surroundings, and teams often store keys there)
  • Credential files for the Azure command line (~/.azure/*.json), .npmrc, pip.conf, .netrc, .git-credentials, Docker’s config.json, Hugging Face, Azure DevOps agents, and .env and JSON files
  • Azure DevOps OIDC tokens (version 1.26.2 also collected GitHub Actions OIDC tokens)
  • Azure managed-identity tokens
  • Azure instance metadata, trimmed to 8,000 characters

The important twist: it asked for new credentials. SafeDep’s analysis points out that the code did not only read credentials already stored on disk. It asked the platform to issue new ones. In an Azure DevOps pipeline, two values that every job already has, SYSTEM_ACCESSTOKEN and SYSTEM_OIDCREQUESTURI, are enough to request a federated token. On Azure compute, the code asked the managed-identity service for an access token for each resource, using either IDENTITY_ENDPOINT or MSI_ENDPOINT on App Service and Functions, or the local address 169.254.169.254 elsewhere. That address is the instance metadata service (IMDS), a service on every cloud virtual machine that hands the machine its own identity. SafeDep concluded: rotating stored secrets does not cover this, because the stolen path is a live ability to mint tokens, not only a file.

Where it sent them. The data was saved as a JSON document, compressed, encoded and sent in an HTTPS request to an address on webhook.site, a public service that receives and displays web requests.

Microsoft’s response. Microsoft told The Hacker News it made some repositories private, including microsoft/agent-framework and microsoft/onnxruntime, while it investigates, and said its priority is protecting customers. This is the second Microsoft-related PyPI package compromised this year. In May 2026, the TeamPCP group published three malicious versions of durabletask, Microsoft’s Python client for its Durable Task workflow system.

What the malicious releases did, in order


Why This Keeps Happening

Developers install by default, not by decision

Running pip install fetches the newest version unless you say otherwise. In a project that does not pin versions, a new release reaches every build within minutes. Attackers know this, which is why a 45-minute window is enough.

Install-time code runs with your full access

Python packages can run code at install time and, through .pth files, at every start. That code runs as the same user and with the same environment as your build job. If your CI job can deploy to production, so can the stolen token.

Build systems hold powerful, always-available identities

CI runners usually carry cloud credentials so they can deploy. These are often broader than a single job needs, and they exist all day. A stealer on a CI runner inherits everything that runner can reach.

AI tooling is a fast-growing target

AI agent frameworks, model runtimes and related packages are new, widely installed and often run on machines with access to cloud accounts, model keys and data. An attacker who poisons one reaches many such machines at once. We covered the same pattern in the Cursor and Fireworks AI vendor-key incident.

Rotating is not the same as removing

A stolen static key can be rotated. A stolen ability to request tokens lasts as long as the malicious code runs. The cleanup step is removing the code and cutting what the identity can do, not only changing the secret.


The Protection Guide

These steps use built-in tools and do not require any product. Steps 1 to 3 check whether you were affected. Steps 4 to 8 reduce the damage from the next one.

Step 1: Find out whether the bad versions were ever installed

Search every place Python runs: developer machines, CI runners, build caches, container images, notebooks and servers.

# Is the package installed here, and which version?
pip show agent-framework 2>/dev/null | grep -E '^(Name|Version)'
pip list 2>/dev/null | grep -i '^agent-framework'

# Search the dependency files in a repository for the package and versions
grep -RInE "agent-framework(==|>=|~=| )" --include="requirements*.txt" --include="pyproject.toml" \
  --include="poetry.lock" --include="Pipfile.lock" --include="uv.lock" .

# Look for the two known malicious .pth files on a machine
find / -name "agent_framework_meta.pth" -o -name "af_runtime_diag.pth" 2>/dev/null

A package’s own presence matters less than the .pth file. Also review any .pth file with an import line that you do not recognize:

python - <<'EOF'
import site, glob, os
for d in site.getsitepackages() + [site.getusersitepackages()]:
    for f in glob.glob(os.path.join(d, "*.pth")):
        for line in open(f, errors="ignore"):
            if line.lstrip().startswith("import"):
                print(f, "->", line.strip()[:120])
EOF

For container images, scan the image layers or run the same find inside a container started from the image. For CI, review job logs and caches for installs that happened between 8:35 and about 9:20 p.m. UTC on November 17.

Step 2: If you find them, treat the machine as compromised

  1. Isolate the host or runner and stop jobs that use it.
  2. Uninstall the package and delete the .pth file. Pin to 1.26.0, the last known safe version, and rebuild from a clean environment.
  3. Do not rotate secrets from the affected machine. Use a clean system, or the attacker may capture the new ones.
  4. Rotate everything the machine could read: environment variables, cloud keys, tokens in .git-credentials, .npmrc, .netrc, Docker config and .env files.
  5. Because the code requested fresh tokens, also review what each cloud identity on that machine could reach, and tighten it (Step 6).

Step 3: Search your logs for the attacker’s footprints

# Proxy or DNS logs: any request to the exfiltration domain
grep -i "webhook.site" /var/log/proxy/*.log 2>/dev/null

In your cloud sign-in logs, look for:

  • Sign-ins by CI service principals or managed identities from unfamiliar addresses
  • Token requests for resources the pipeline does not normally touch
  • New role assignments, credentials or federated credentials added to identities

In Azure, the sign-in logs for service principals and the activity log show these. In GitHub, review the audit log for workflow runs that deployed to Azure during the exposure window.

Step 4: Pin and verify what you install

A package that you pinned to an exact version with a hash cannot be silently swapped for a new release.

# Generate a fully pinned, hash-checked requirements file
pip install pip-tools
pip-compile --generate-hashes -o requirements.txt requirements.in

# Install only what matches the recorded hashes
pip install --require-hashes -r requirements.txt

Commit the lock file. Treat updates as reviewed changes, not automatic ones.

Step 5: Add a waiting period for brand-new releases

Many malicious releases are caught within hours. A rule that your build only accepts versions that have been public for a few days gives the community time to find and remove them. Use a private package mirror or proxy that holds new versions in a “quarantine” for a set period before developers and CI can fetch them, and that lets you block a version in one place.

Step 6: Shrink what a build identity can do

If the stealer runs on your CI runner, the damage equals the permissions of the runner’s identity.

  • Give each pipeline its own identity with only the permissions for its own deployment, not one shared administrator identity for all jobs.
  • In GitHub Actions, grant id-token: write only to the specific jobs that need to authenticate to the cloud, and set the default permissions: for the workflow to read-only.
  • For federated identities in Azure or AWS, restrict the trust condition to the exact repository, branch and environment that may use it, so a token stolen from elsewhere cannot be used.
  • Prefer separate identities for building (which runs third-party code) and deploying (which holds powerful access), and run the deploy step only after the build is complete.

Step 7: Cut the exits and watch the doors

The stealer needed to send data out. Restrict outbound traffic from CI runners and build servers to the destinations they truly need, and block public request-capture sites unless you use them. Alert on any build job that talks to a new external domain. Restrict access to the instance metadata service where your cloud supports it (for example, by requiring session tokens), so that software on the machine cannot freely request identity tokens.

Step 8: Know what you ship

An SBOM (software bill of materials) is a list of every component inside a piece of software, with versions. If you keep one for every repository and image, “did we use version 1.26.1 anywhere?” takes minutes to answer, not days. Generate SBOMs in your build, store them, and make them searchable.


How Cloudanix Can Help

The steps above work with any tooling. Cloudanix reduces the effort of three things this incident exposed: knowing where a package is used, making stolen credentials worth less, and spotting misuse of identities.

Answer “where did we use this?” quickly. Code Security scans your repositories for dependencies, including indirect ones, across manifests and lock files for npm, PyPI, Maven, Go, RubyGems, NuGet and Cargo, and generates a CycloneDX SBOM per repository. That gives you a searchable record to answer Step 1 across all connected repositories. It works with GitHub, GitLab, Bitbucket and Azure DevOps. Cloudanix matches components against its vulnerability database, which draws on 28 upstream feeds and uses CISA KEV and EPSS to prioritize, so known-bad versions show up with context. Secrets scanning checks code and full git history, and pull request checks can block a merge.

Make pipeline credentials worth less. The core lesson of this incident is that a build runner held credentials that were available all the time. Agentic JIT changes that for CI/CD jobs, pods and AI agents. You register a pipeline once, and its job elevates for only the seconds a privileged step needs, then revokes. Audit records tie each action to the agent, the workflow and the commit. It works with Jenkins, GitHub Actions, GitLab CI, Bitbucket, CircleCI and ArgoCD, and across AWS, Azure and Google Cloud. A stealer that runs at a random time on a runner finds no standing administrator role to copy. See also governing CI/CD credentials without standing secrets.

Cloudanix just-in-time access requested and approved in Slack, with no standing credential to leak

See what each build identity could reach. Non-human identity and CIEM inventory service accounts, keys and roles, flag the over-permissioned ones, and show what each can reach. That is the review in Step 6, kept current. Attack path analysis shows how a build identity connects to production data.

Detect misuse. Cloud UEBA builds a baseline for each identity and alerts on departures, such as a pipeline identity requesting resources it has never used, which is the footprint described in Step 3.

Keep AI tools from leaking secrets. For developers’ AI coding agents, Coding Agent Guardrail runs on the developer’s machine and blocks secrets and personal data from reaching the model provider. That addresses a different path than this incident, but the same root cause: credentials sitting where software can read them.

What this does not do. Cloudanix does not stop a malicious package from being published or installed. A newly published malicious version may not yet appear in advisory feeds, so a vulnerability database cannot flag it in the first hours. And if malicious code runs during the few seconds that an Agentic JIT grant is active, it could use that grant, which is why the grants are short, narrow and logged. The value is in shrinking and recording what an attacker can reach, and in letting you answer the exposure question fast. Pinning, hashes and a quarantine period in Steps 4 and 5 remain your front line.


Quick Reference Checklist

  • Searched machines, runners, images and lock files for agent-framework 1.26.1 and 1.26.2
  • Searched for agent_framework_meta.pth and af_runtime_diag.pth
  • Reviewed all .pth files that contain import lines
  • Isolated any affected host and rebuilt from a clean environment pinned to 1.26.0
  • Rotated secrets from a clean system, not from the affected machine
  • Searched proxy and DNS logs for webhook.site requests
  • Reviewed cloud sign-in logs and role changes for the affected identities
  • Pinned dependencies with hashes and committed lock files
  • Added a quarantine period for new package versions
  • Gave each pipeline its own least-privilege identity and restricted federation to exact repositories and branches
  • Restricted outbound traffic from build systems
  • Generate and store an SBOM for every repository and image

Key Takeaways

  • Two malicious agent-framework releases (1.26.1 and 1.26.2) were published on November 17, 2026, and ran a credential stealer on every Python start, with no import required.
  • The stealer collected stored credentials and asked the platform for new Azure and GitHub tokens, so rotating files alone is not enough.
  • Check for the .pth files, not only the package name, and clean up from a trusted machine.
  • Pinning with hashes, a quarantine period and narrow build identities limit the damage from the next poisoned package.
  • Short-lived, narrow, logged pipeline access means a stealer finds little worth taking, and an SBOM turns “are we affected?” into a search.

Want to see which pipelines and service accounts in your environment hold standing cloud access, and what an Agentic JIT model would change? Book a session and we will map it with you.

People Also Read

What Our Users Are Saying

Customer Reviews

Cloudanix is trusted by security leaders worldwide to deliver proactive, reliable, and cutting-edge cloud security.

One day, I changed the password of a root account, and my CTO called me within less than a minute to confirm if I did so. I was not expecting a reaction this quick. He told me Cloudanix alerted him of this password change and that he wanted to confirm as it was a critical security notification. I couldn't believe it!

Ritesh Agarwal
Ritesh Agarwal
CEO, Airgap Networks

Compliance is one way of staying secure, but what I want is the ability to go deeper and attain 'true security.' Cloudanix provides us the capability to do so.

Vishal Madan
Vishal Madan
Head of Engineering, iMocha

Cloudanix is building for the future of the cloud, which makes the product all the more desirable.

Ritesh Agarwal
Ritesh Agarwal
CEO, Airgap Networks

Cloudanix gave us the visibility we were missing. Being able to move from permanent access to a robust Just-In-Time (JIT) workflow has fundamentally changed our security posture without slowing down our engineering velocity.

Pavan Kumar Lekkala
Pavan Kumar Lekkala
SRE Lead, HugoHub

We are excited to leverage Cloudanix's comprehensive multi-cloud DevSecOps solution to secure our production workloads on AWS. Cloudanix has demonstrated that it can solve many challenges that DevSecOps teams face while continually adding new features such as SOC2 compliance and drift detection.

Satish Mohan
Satish Mohan
Co-founder & CTO, Airgap Networks

Managing third-party partner access was once a major concern for our security posture. With Cloudanix JIT Cloud, we've effectively achieved zero third-party risk. We can now grant access confidently, knowing that it is temporary, audited, and automatically revoked, resulting in a 100% reduction in our privileged access exposure.

Okesh Badhiye
Okesh Badhiye
Head of Technical Engineering, Finfinity

The snooze feature and responsible alerts have helped us save time and prioritize what to tackle first.

Satish Mohan
Satish Mohan
Co-founder & CTO, Airgap Networks

Implementing Cloudanix JIT internally allowed us to practice what we preach. By eliminating permanent access to our own clouds and databases, we've neutralized the risk of standing privileges, ensuring our own 'keys to the kingdom' are never left exposed.

Girish Manghnani
Girish Manghnani
Managing Partner, Tech Inspira

The problem with permissions is a lot of times, the gaps are left open due to oversights from inside the organization itself. With Cloudanix's CIEM, we get a complete view of user permissions and access. This enables us to update the permissions, reducing the attack surface.

Nilesh Pethani
Nilesh Pethani
Application Architect, iMocha

In the world of Fintech, trust is our currency. Cloudanix provided the frictionless visibility we needed to secure our EKS workloads across AWS, ensuring we stay audit-ready for SOC2 and GDPR without slowing down our engineering velocity.

Amol Naik
Amol Naik
Head of Security & Infrastructure, HugoHub

Cloudanix delivered value within 5 minutes of onboarding. Continuous monitoring, timely detection, and excellent documentation helped us attain a great cloud security posture.

Divyanshu Shukla
Senior DevSecOps, Meesho

Technology strategies and business strategies are in a state of constant change which includes centralization and decentralization of responsibilities. Regardless of strategic shift, we still have intellectual property to protect. Cloudanix are critical partners for us in our public cloud security posture across our three cloud providers.

Jerry Locke
Jerry Locke
Senior Director Global Solutions Engineering, Eversana

Cloudanix has been amazing. They opened up a common Slack channel with us — and it feels like we are talking to our own team and getting things done with Cloud security. The support team is always available, friendly, helpful, and ready to go out of their way.

Satish Mohan
Satish Mohan
CTO, Airgap Networks

Beyond just access management, Cloudanix CSPM has given us a unified view of our AWS environment. The real-time alerting and anomaly detection allow us to prevent any untoward activity before it happens, which is critical for a marketplace connecting 50+ financial institutions.

Okesh Badhiye
Okesh Badhiye
Head of Technical Engineering, Finfinity

For a Fintech company, data is our most valuable — and most sensitive — asset. Cloudanix DAM hasn't just improved our visibility; it has given us control. The ability to mask data and prevent unauthorized queries in real-time is a game-changer for our compliance and customer trust.

Jiten Gala
Jiten Gala
President Engineering and Product, Kapittx

Our clients, especially in the Middle East financial sector, demand absolute accountability. Cloudanix JIT Cloud has been a competitive differentiator for us, allowing us to provide secure, governed access to customer accounts that meet their strictest audit and compliance requirements.

Girish Manghnani
Girish Manghnani
Managing Partner, Tech Inspira

Cloudanix is always on my team's lips because of its exceptional support. Be it a small or big query, Cloudanix has gone above and beyond to resolve them. This one's a keeper for us.

Sujit Karpe
Sujit Karpe
CTO, iMocha

For a long-lasting partnership, great support goes a long way. Cloudanix has delivered exceptional support whenever required. Their edge is their team is always ready to go beyond to solve any issues that we have. This speaks volumes about the culture at Cloudanix.

Akash Maheshwari
Akash Maheshwari
Co-founder, MoveInSync

Beyond the technology, Cloudanix feels like an extension of our own team. Their willingness to stand up a dedicated Middle East tenant for us and provide exceptional support at a sensible price makes them a long-term partner for Hugosave.

Surya Tamada
Surya Tamada
CTO, HugoHub

The real-time notifications that Cloudanix provides are a real lifesaver. Their adaptive notifications ensure that my team stays productive and doesn't get interrupted all the time.

Digvijay Singh
Staff Security Engineer, Meesho

The whole point in technological evolution is to help improve the world we live in. We must protect that and to do so requires an effective and efficient security strategy. The Cloudanix team helped make our public cloud security posture management strategy a reality. The symbiotic relationship we have allows for a continuous feedback loop which is how business should operate.

Larry Wheat
Larry Wheat
Staff Solutions Engineer, Eversana

Ready to see your graph?

Connect a cloud account in under 30 minutes. See every finding rooted in identity, asset, and blast radius — with a fix path attached.

Book a Demo