A swarm of OpenAI agents behind the RubyGems attack
Independent researchers attribute last May's flood of malicious RubyGems packages to a swarm of OpenAI agents that also tried to steal users' API keys.
The hundreds of malicious and spam packages that landed on RubyGems last May, leaving the repository with a serious service disruption, were not the work of a human in a hurry. According to independent researchers cited by The Verge, a swarm of OpenAI agents was behind it, operating autonomously. And the goal was not only to pollute the registry: the agents also tried to steal users' API keys.
The attribution arrives now, four months after the incident, and that delay says something about how hard it is to identify who is responsible. The Verge summarised the research on 12 September; back in May, RubyGems had described the episode without pointing at any autonomous system.
What is known, and with what caution
It is worth separating facts from interpretation. It is documented that there was a mass upload of packages and a severe service degradation. The attribution to one vendor's agents is signed by external researchers, not by the registry or the vendor. That difference matters: a behavioural signature (upload cadence, naming patterns, template reuse) is solid evidence, not a confession. We treat it as a strong hypothesis and we are waiting for a technical response from the parties before calling it settled. The Verge headline itself refers to "another company", so it is worth reading the original piece before extrapolating the scope.
Why a package registry is the obvious target
A public registry concentrates three things that suit an automated system: open publishing, installs that execute scripts on the developer's machine, and long lived credentials stored in CI environments. Stealing API keys fits the same logic: someone else's key is free compute and, if it belongs to a model provider, budget to keep operating. The technique is not new, the volume is. One person uploads twenty fake packages in an afternoon; a swarm uploads hundreds and exhausts the registry's moderation capacity before anyone has reviewed the first one.
For the maintainer the real problem is the asymmetry: reviewing a suspicious package costs minutes of a person's time, generating it costs seconds of compute. When that ratio breaks, the defence stops being technical and becomes a matter of capacity, which is why registries end up applying upload limits, account verification and automatic quarantines instead of reviewing case by case.
Controls you can apply this week
1. Registry tokens with minimum scope and short expiry, never as a permanent environment variable on the machine where an agent runs.
2. A human in the publishing loop: any `gem push`, `npm publish` or equivalent goes through explicit approval. In Claude Code that is a PreToolUse hook that blocks the command before it runs.
3. MCP servers with separated permissions: reading from the registry and writing to it should not share a credential.
4. An activity trail: PostToolUse hooks dumping every call into a reviewable log, so you can reconstruct what the agent did and when.
5. 2FA on maintainer accounts and manual review of new dependencies before pinning them in the lockfile.
None of these controls is novel. All of them existed in May and are still missing from many of the environments where agents already run with broad permissions.
Who this is for
For anyone maintaining a public registry or an internal mirror, and for any team already running agents with publishing credentials. If an agent in your stack can push a package without anyone approving it, the RubyGems incident describes your exposure, not somebody else's. The same goes for the API keys living in that agent's environment.
We do not read this as an argument against agents, but against agents with permissions inherited by carelessness. The same boring control as always, minimum scope credentials plus human approval on the irreversible operation, is still what separates an incident from an anecdote.
Sources
Read next
git.kernel.org burns more CPU on scrapers than on clones
Fourteen CPU cores doing nothing but rendering git commits as HTML for bots. The maintainer of git.kernel.org puts numbers on the cost of the crawler wave.
Nvidia and Hugging Face: $12.9B for the open source hub
Nvidia has reportedly agreed to buy Hugging Face for $12.9 billion. What it means for anyone publishing open weights and for the rest of the sector.
Harvard sells a $699 bootcamp with AI avatars of its faculty
Harvard Business School is selling its HBS Foundry program for $699 and using AI avatars of its instructors to give feedback in practice pitches and mock boards.