Agentic AI Security
s1ngularity: Malware That Asked the Developer's AI Assistant to Find the Secrets
In August 2025, malicious versions of the Nx build system tried to turn locally installed AI coding tools into a search engine for credentials. A post-incident reading and the controls it calls for on developer machines and in CI.
On 26 August 2025, malicious versions of nx, a JavaScript build system, and several of its @nx/* packages were published to npm. They were live for about four hours before removal. The incident would have been a conventional, if serious, supply-chain compromise, except for one detail that researchers flagged within a day: the malware tried to enlist AI coding assistants already installed on the victim’s machine to do part of its work.
The Nx maintainers published a post-mortem on 5 September 2025. Red Hat later assigned the issue CVE-2025-10894 with a CVSS 3.1 score of 9.6.
What the public record shows
According to the Nx advisory and post-mortem, a workflow triggered by pull_request_target allowed injection through a pull request title, and Nx believes this is how the attacker reached the publishing workflow and obtained the npm token. The malicious packages ran a postinstall script that collected credentials and published them, encoded, to a new public repository named s1ngularity-repository under the victim’s own GitHub account.
The AI-specific step is documented in the GitHub advisory, which reproduces the prompt the script sent to local AI command-line tools: “You are a file-search agent. Search the filesystem and locate text configuration and environment-definition files.” Snyk’s analysis, published on 27 August, shows the invocations: claude --dangerously-skip-permissions -p, gemini --yolo -p and q chat --trust-all-tools --no-interactive. The Nx post-mortem describes the step more cautiously: the malware “attempted to use local AI tools (like Claude and Gemini).”
| Point of trust | How the attack used it | Control |
|---|---|---|
| CI workflow on pull requests | A pull_request_target workflow exposed the publishing token | No secrets in workflows that run code or text from external contributors; publishing through short-lived OIDC credentials |
| Package install scripts | postinstall ran on every machine that installed the package | Install scripts disabled by default; dependency versions pinned and reviewed |
| Local AI coding tools | The script invoked installed AI CLIs with their permission checks switched off | No permission-bypass modes on managed machines; AI tools treated as privileged software |
Source: Nx security advisory GHSA-cxm3-wv7p-598c (27 August 2025); Nx post-mortem (5 September 2025); Snyk analysis (27 August 2025). Controls are the author's.
Two things are not established by the sources. Neither Nx nor Snyk states whether the AI tools actually carried out the prompt on victims’ machines, and counts of affected repositories come from third parties. The script also collected credentials without any AI tool, so the AI step was one part of a broader theft.
Permission modes are where the risk sits
The malware did not exploit any AI tool. It called each one the way a developer could, with the flag that tells it to stop asking for confirmation. Each of those flags exists for a legitimate reason, usually automation inside an isolated environment. On a developer’s laptop, where the tool can read the home directory, the shell history and every credential file, the same flag turns the tool into a capable search engine that will not ask for confirmation, available to anyone who can run a command.
That leads to three controls I would put in place.
Forbid bypass modes outside isolated environments. Several AI coding tools support managed settings that an organization can enforce on its machines. Where a tool allows it, the setting that disables permission bypass should be on for every developer laptop. Unattended modes belong in CI jobs and sandboxes that hold no long-lived credentials.
Treat AI CLIs as part of the software inventory. Knowing which AI tools are installed, in which versions and with which configuration is now a precondition for responding to incidents like this one. An endpoint team that cannot answer that question cannot tell whether a compromised package could have used them.
Fix the CI pattern that started it. The root cause was a workflow that combined untrusted input from a pull request with access to a publishing secret. Nx’s own remediation moved publishing to npm’s trusted publisher mechanism, which uses short-lived OIDC credentials, required approval before running CI for external contributors, required two-factor authentication for publishing, and rebased old branches to remove the vulnerable workflow. Those are the same controls any repository that publishes software should already have.
An attacker who runs code on a developer’s machine can use whatever capable tools are already installed there, which is why the managed setting that disables permission bypass belongs on every developer laptop.