Skip to content
Free · Scenario lab

AI CLI Supply Chain Lab: When Packages Use Your AI Tools

When a bad package version runs on a developer machine, the AI tools already installed there can become its search engine. Wiz says the Nx “s1ngularity” malware prompted Claude, Gemini and Q command-line tools to look for secrets, then uploaded what it found to public repositories, and that leaked tokens were later used to publish private ones. Make 11 scored calls on scoping, rotation order, repository exposure, AI tool access and install controls.

Related: the GitHub supply chain attack anatomy, GitHub CI secret hardening and the npm supply chain tracker.

No download, no card
Template & sample scenario. A fictional rehearsal built on common real-world patterns, not a record of any real organisation, audit or deal. Generated from a PlayCISO template as a starting point: it is not legal, audit, certification, investment or professional advice. Review, adapt and validate it for your organisation before you rely on it.

You are Alex Moreno, platform security lead at Harborline Systems. Malicious versions of a popular build tool were published to npm. Their install script used AI command-line tools already installed on developer machines to hunt for secrets, and leaked tokens then exposed private repositories. Across 11 decisions you work out what ran where, order the token rotation, make repositories private again, remove the AI tool access and add lockfile and provenance controls. The story follows the Nx "s1ngularity" campaign as written up by Wiz and by Nx; the organisation and repositories are fictional. No code or commands appear. Each call is scored 0 to 10 with the source behind the rationale.

Make it yours

Replace the sample names so the scenario and the debrief you export are about your organisation.

TL;DR

What this lab is

5 points
  • A scenario lab with 11 scored decisions about malicious package versions whose install script used AI command-line tools already on developer machines to hunt for secrets, after which leaked tokens exposed private repositories.
  • Based on the Nx "s1ngularity" campaign of 26 August 2025 as written up by Wiz and by Nx itself. Wiz says the malware ran on developer machines and in some build pipelines; Nx says the packages were live for about 4 hours.
  • You decide what ran where, the token rotation order, how to make repositories private again, how to take ambient access away from AI tools, and which lockfile and provenance controls would have limited it.
  • Free to play. Final score, debrief with the source behind each rationale, and links to the related labs.
  • Defensive only. No code, commands or payload text appear. The organisation and repositories are fictional.

Claimed versus confirmed

Figures come only from Wiz and Nx and are attributed to them. Wiz and Nx are describing their own observations and response. We could not read the GitHub security advisory itself (GitHub blocked our automated fetch), so nothing is cited to it directly. Rotation order and the install-time control set are marked as PlayCISO practice.

Frequently asked questions

What happened in the Nx s1ngularity attack?

Nx says that on 26 August 2025 attackers used a GitHub Actions injection flaw to steal its npm publishing token and published malicious Nx package versions that were live for about 4 hours. Wiz says the install script searched for secrets, used installed AI command-line tools (including Claude, Gemini and Q) to help, and uploaded results to public repositories in victims' own GitHub accounts.

How many people were affected?

Wiz reports that in a second phase leaked GitHub tokens were used to make private repositories public, affecting over 400 users or organisations and over 5,500 repositories, and observed over a thousand valid GitHub tokens in the leaked data. These are Wiz's observations, not a count of all victims.

Did it affect Windows?

Wiz says the payload executed only on Linux and macOS. Developers on Windows were not the target of the main payload, but check the hosts you have rather than assume.

Which credentials should be rotated first?

Wiz says to revoke and regenerate all GitHub tokens, npm tokens, SSH keys, API keys and environment secrets that may have leaked. The ordering in the lab (GitHub first, then publish tokens, cloud and production, then SSH and the rest) is PlayCISO practice based on what Wiz saw attackers use next, not a vendor standard.

Does npm provenance stop this?

Not by itself. Nx says the malicious versions lacked provenance, but provenance does not block unsigned packages from being installed. You have to check it as a gate. Nx moved its own publishing to npm trusted publishing.

Why does the lab say to remove the AI tools' access?

Wiz says the malware prompted installed AI tools with flags that skip permission checks to read the filesystem, and that this succeeded in hundreds of cases. The lasting fix is to remove ambient access, not only to rely on provider guardrails.

Sources

Opened on 4 November 2026 unless a note says otherwise. Vendor product pages are not used as evidence.

Scenario people, organisations and hosts are fictional. More tools.

The tools people use most on PlayCISO.

All tools
🖤 Black Friday: new customers get 3 months of Pro for $5, then $5/month. Ends 30 Nov. Claim 3 months for $5 →