Skip to content

In review · not yet published

6 min readLaunchapp

When your own AI tools work for the attacker

Two supply-chain incidents turned developers' AI assistants and an AI triage bot into attack tools. What happened, and the controls that contain it.

Two incidents, six months apart, changed what a software supply-chain attack can look like. In the first, malware did not carry its own tools for finding secrets on a developer's machine. It asked the AI assistants already installed there to do it. In the second, an AI bot that triaged GitHub issues became the first link in a chain that ended with an unauthorised package release.

Both projects published detailed accounts afterwards, and both researchers reported before going public. This part relies on those primary sources.

s1ngularity: malware that prompts your assistant

On August 26, 2025, malicious versions of Nx, a widely used build tool, were published to npm. Nx's security advisory and Wiz's analysis describe what the package did when installed.

Part of it was ordinary credential theft by script. The new part, in Wiz's words, was that "the malware leveraged AI command-line tools (including Claude, Gemini, and Q)", "prompting them with dangerous flags (--dangerously-skip-permissions, --yolo, --trust-all-tools)" to search the machine for wallets, keys and tokens.

Those flags exist so that a developer can let an assistant work without stopping to ask. The malware used them for the same purpose.

The stolen data was written to public repositories, named s1ngularity-repository, created inside the victims' own GitHub accounts. In a second phase, Wiz reports, an attacker used leaked tokens to make victims' private repositories public.

Wiz's follow-up on September 3, 2025 gives the final counts: more than 1,700 users had secrets publicly leaked, and at least 480 compromised accounts, two thirds of them organisations, had over 6,700 private repositories published.

One finding in that follow-up deserves emphasis because it cuts against the headline: the AI tools "only exfiltrated data successfully in under a quarter of cases". The assistants were an unreliable accomplice. They were still an accomplice the attacker did not have to bring.

How the attacker got to publish at all is a familiar story. Nx's advisory traces it to a GitHub Actions workflow using the pull_request_target trigger, which runs with elevated permissions. Nx writes that it believes the token from that workflow was used to trigger the publish workflow, altered to send the npm token to an outside address.

Clinejection: a triage bot in the release path

Cline, an open-source AI coding assistant, ran an AI agent in GitHub Actions to triage new issues. Researcher Adnan Khan found that, as the write-up puts it, "the issue title is interpolated directly into Claude's prompt", and the workflow was configured so that "anyone with a GitHub account can trigger it simply by opening an issue."

A triage bot with read access would be a small problem. Khan showed why this one was larger: "the low-privilege triage workflow shares the same cache scope as the high-privilege nightly release workflow". Code running in the triage job could poison the cache that the release job later trusted, and the release job held the publishing tokens.

Khan reported this privately on January 1, 2026, and published on February 9. Cline's postmortem is frank that "The report was not addressed until Adnan publicly disclosed the vulnerability on February 9."

Eight days later, per the postmortem: "At 3:26 AM PT on February 17th, an unauthorized party used a compromised npm publish token to publish cline@2.3.0 to npm." The only change was a postinstall script that installed another package globally. Cline published a corrected version, deprecated 2.3.0 and revoked the token by 11:23 AM the same day. StepSecurity estimates the package was downloaded about 4,000 times in the roughly eight hours it was live.

How the token was obtained is not settled, and the two accounts are better read together than against each other. Khan's inference is that a different actor found the proof of concept and used it against Cline to obtain the credentials. Cline's postmortem says that during rotation "the wrong token was deleted while the exposed one remained active", and does not state how or by whom the token was taken. So: exposed by some route, and still valid because the rotation missed it.

Cline's response was to remove capability: "Removed the AI-powered triage workflows entirely." Publishing now goes through GitHub Actions with OIDC provenance, with no long-lived token to steal.

PL. 07From a public text field to a published packageCause chain · read left to right
  1. Link 01

    An AI agent in CI read text any stranger could write

    Guardrail

    Treat such a job as untrusted code execution

  2. Link 02

    That job shared a cache with the release job

    Guardrail

    Separate caches and runners for release

  3. Link 03

    Publishing used a long-lived token

    Guardrail

    Publish with short-lived OIDC credentials

  4. Link 04

    A rotation revoked the wrong token

    Guardrail

    Verify revocation by testing the old token

  5. Link 05

    Installed AI tools accepted skip-permission flags

    Guardrail

    Run agents sandboxed, never with those flags

Each link is a condition that had to hold for the damage to happen. The line beneath it is the control that breaks that link.

Why it happened, in engineering terms

Both incidents rest on the same two facts.

An AI agent that reads public input is a public execution endpoint. A workflow that feeds an issue title into a model with tools is, in effect, a place where strangers can submit instructions. It needs the same isolation as any job that runs untrusted code: no secrets, no shared caches, no write tokens.

An installed assistant is a capability on the machine. A coding assistant can read files, run commands and call the network. With permission prompts on, a person stands between a request and those actions. Flags that skip the prompts remove that person, for anything that can invoke the tool, including a malicious install script.

Underneath both sits the oldest supply-chain weakness there is: a long-lived publish token, reachable from somewhere it should not be.

What it cost

For the Nx incident, the figures above: thousands of leaked secrets and thousands of private repositories made public, each of which had to be assumed compromised and rotated. For Cline, a package live for about eight hours and, by the project's own account, a fix that came later than it should have. Both teams paid in trust, and both chose to explain themselves in public, which is the part worth copying.

The practice that stops it

  • Never run AI command-line tools with skip-permission flags outside a sandbox. Not on a laptop that holds credentials, and not in CI with secrets in the environment.
  • Give an AI job in CI nothing worth stealing. Read-only token, no secrets, its own cache, its own runner. Assume its inputs are hostile.
  • Publish with short-lived credentials. OIDC-based publishing removes the standing token that both incidents turned on.
  • Verify a rotation. After revoking a token, try to use it. Cline's postmortem is a clear lesson in why.
  • Include assistant configuration in incident response. After a suspected compromise, check the settings and hook files of installed AI tools along with everything else.
  • Pin and review dependencies, and delay adopting brand-new releases by a short window where you can. The malicious Cline release was live for about eight hours.

A flag that lets your assistant act without asking lets everything else on the machine act through your assistant.

How we handle this

Our own agents run through Animus, the orchestrator we built, and its permission model is designed around the point these incidents make.

Agents run in isolated workspaces. The worktree manager we built gives each agent its own checkout, so one agent's working directory is not another's, and parallel runs do not collide. In our hosted setup, agents run in ephemeral sandboxed containers, not on a developer's laptop next to its credentials.

Approval is a system function, not a flag an agent or a script can switch off. An agent can ask a person a question or request approval and wait; a request that nobody answers is denied. The tools for answering those requests are on a surface agents do not have.

Outside credentials are injected by a proxy and held in the operating system's keychain, so an assistant asked to "find tokens" has less to find.

We are users of the same package registries as everyone else, and a compromised dependency could reach us too. What these controls change is how much such a package could do once it arrived.

What we built

The work behind this post: the worktree manager MCP server that isolates agent workspaces, and Animus, which carries the approval model. The cards below link to both.

Proof

The work behind this post

  • Built

    Worktree manager MCP server

    An MCP server with 47 tools that lets AI agents create, run and clean up isolated git worktrees, so many agents can work on one codebase in parallel.

    agent-facing tools
    47
    agent-facing tools
  • Built

    Animus

    Open-source orchestrator with a Rust core that runs teams of AI coding agents in parallel. Its whole control surface is exposed over MCP.

    commits on main since Feb 2026
    1,700+
    commits on main since Feb 2026
    View source

Founder-led

Building something like this? A founder will reply personally.

Scope a project