Skip to content

Accident reports · August 2025

Nx: trapped packages make coding agents search the disk

Trapped Nx versions launched Claude Code, Gemini CLI or Amazon Q without permission to hunt for secrets, then published them on GitHub.

  • Company Nx
  • Agent Claude Code / Gemini CLI / Amazon Q
  • Model not published
The agent as a weapon
Stacked sheets of corrugated cardboard seen edge-on
Photo: Roberto Sorin on Unsplash
WhenAugust 2025 (trapped versions published on 26 and 27 August)
WhoNx, a widely used development tool published on npm; the hijacked agents: Claude Code, Gemini CLI and Amazon Q
What the agent didLaunched by trapped software with the options that skip every permission, the agent installed on the machine searched the disk for keys and secrets
ConsequenceAccording to GitGuardian, quoted by The Hacker News: 2,349 distinct secrets exposed, published in public GitHub repositories under the victims' names

What happened

According to The Hacker News (28 August 2025) and Snyk, eight trapped versions of the nx package were published on npm from the evening of 26 August 2025, along with several plugins of the same project. According to the Nx maintainers, quoted by The Hacker News, the attacker probably obtained the publishing token by exploiting a flaw in one of the project's GitHub Actions workflows; they say they "believe" so, without certainty. According to the timeline published by Snyk, npm removed the versions about four hours after the first one.

On install, on Linux and macOS, the trapped code checked whether the machine had Claude Code, Gemini CLI or Amazon Q. If so, it launched them with the options that remove every permission prompt, and gave them an instruction: go through the home folder and system folders, and write to a file the paths of sensitive files (cryptocurrency wallets, SSH keys, .env files…). The software then sent these results, with GitHub and npm tokens, to a public repository named "s1ngularity-repository" created on the victim's GitHub account. It also added a machine shutdown command to the terminal's startup files.

According to GitGuardian and Wiz, quoted by The Hacker News, 2,349 distinct secrets leaked, up to 1,346 repositories bore that name, and a third of the affected machines had at least one AI tool installed. Wiz later described a second wave, in which private repositories were made public, without being able to attribute it with certainty to the same author. The articles do not say whether any agent refused the instruction.

Why it happened

A coding agent installed on a developer's machine knows how to search files, read and summarise: that is its job. Malware no longer needs to write the search itself; it asks the agent already there, in plain words, with the user's rights.

The options that skip permissions exist to go faster. Here, they let a third-party program drive the agent without any person seeing a single request go by.

The failure family

This is the "The agent as a weapon" family: a person uses an agent to attack. The victim's agent becomes the attacker's tool, on the victim's own machine.

The safeguard in code

  • The options that skip permissions are blocked by a company rule on workstations and in automated workflows, except in a sandbox without secrets.
  • No secrets in plain text in the home folder: keys and tokens live in a vault, with limited rights and a short lifetime.
  • Dependencies are pinned and checked (publishing provenance) before install; an alert fires if a public repository is created on a company account.

What we test

Our crash tests test the company's agent, not the attacker's: what it does when a booby-trapped instruction arrives in what it reads, when an account is hijacked, when a side door is tried. A trapped program that launches the agent itself without any permission is not yet tested as such. What a company can lock down today: ban permission-free modes on workstations, keep secrets out of files, and watch installed dependencies.

And your agent, what would it do?

The crash test puts your agent in these situations, dozens of times, on several models. You get the figures, the conversations where it gave in, and the fix plan.

Crash-test my agent See the live demo

Further reading