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’sconfig.json, Hugging Face, Azure DevOps agents, and.envand 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.

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
- Isolate the host or runner and stop jobs that use it.
- Uninstall the package and delete the
.pthfile. Pin to 1.26.0, the last known safe version, and rebuild from a clean environment. - Do not rotate secrets from the affected machine. Use a clean system, or the attacker may capture the new ones.
- Rotate everything the machine could read: environment variables, cloud keys, tokens in
.git-credentials,.npmrc,.netrc, Docker config and.envfiles. - 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: writeonly to the specific jobs that need to authenticate to the cloud, and set the defaultpermissions: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.

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-framework1.26.1 and 1.26.2 - Searched for
agent_framework_meta.pthandaf_runtime_diag.pth - Reviewed all
.pthfiles that containimportlines - 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.siterequests - 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-frameworkreleases (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
.pthfiles, 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
- A Vendor’s Exposed Key Put a Fake Claude Code Extension in Cursor’s Marketplace
- Governing CI/CD Pipeline Credentials Without Standing Secrets
- Hackers Are Scanning for Exposed Vite Dev Servers to Steal AWS and Azure Secrets
- OVHcloud CLI Release Hijack: Supply Chain Secrets and What to Do
- Extension Confusion: The IDE Supply Chain Risk Hiding in Your AI Editor
- Governing Non-Human Identities with JIT
- What is Credential Theft? Phishing, Standing Access, and Blast Radius
- What is a CI/CD Pipeline?
- How to Stop Secrets Leaking in Git
- What is a Cloud Instance Metadata Service (IMDS)?
- Cloudanix Agentic JIT
- Cloudanix Code Security