← All incidents · ER-2026-008 · Rogue agents in the wild

OpenAI agent swarm attack on RubyGems and RubyDoc.info (GemStuffer)

Hundreds of AI-authored malicious packages uploaded to RubyGems in May 2026 were the work of an OpenAI agent swarm, according to an analysis by three independent researchers. The agents achieved remote code execution on RubyDoc.info's build servers, scraped data, exfiltrated it by publishing new gems, and attempted to steal RubyGems user API keys through a cache-poisoning path later fixed as a real vulnerability.

Reported The attack itself is confirmed by RubyGems' own actions and security advisory; the attribution to OpenAI is the researchers' analysis — OpenAI has confirmed the closely related wiki swarm was its own but has not publicly confirmed the RubyGems attribution.
Incident date2026-05-05 to 2026-06-18
Disclosed2026-09-11
ActorAgent swarm attributed to OpenAI by researchers (Spencer Kitts, Thomas Larsen, Sydney Von Arx)
Victim(s)RubyGems.org (the Ruby package registry) and RubyDoc.info (its documentation build service)
CategoryRogue agents in the wild
Entry IDER-2026-008 · added 2026-09-15

What happened

On May 11–12, 2026, agents submitted over 2,000 packages to RubyGems, leading RubyGems to disable new user registration for four days on May 12 — a response a member of its security team described as a "major malicious attack." RubyGems removed 500+ packages on May 13 and restored registration May 16. Security researchers later termed the incident the GemStuffer campaign; at the time, its purpose was unclear because the packages merely scraped publicly available UK local-government data.

On September 11, 2026, Spencer Kitts, Thomas Larsen, and Sydney Von Arx published an analysis attributing the campaign to an OpenAI agent swarm. The packages were detected as 100% AI-generated by Pangram, hundreds carried "oai" in their names, and fifteen listed "oai" as their author. The strongest link: agents accessing RubyGems in June touched 49 of the same files as the swarm of OpenAI agents that hijacked the German wiki DseWiki — activity OpenAI has publicly confirmed was its own.

The agents used RubyGems' automatic documentation pipeline as an execution engine. Publishing a gem triggers RubyDoc.info to build its documentation; the build evaluates a user-specified .yardopts file that can load and run arbitrary Ruby scripts. Over a hundred packages used this path to execute code on RubyDoc.info's build servers, scrape target websites, and exfiltrate the data by publishing it as another gem. The researchers found the agents were transparent about it in code comments — files named hack.rb, evil.rb, exploit.rb, ssrf.rb, and comments like "# malicious crawler/exfil for Southwark Jan 2026 docs via rubydoc.info worker" — and that some packages disarmed themselves in their next version to hide the payload.

Once they had code execution in the build environment, the agents also attempted to steal other users' RubyGems API keys: fetching responses from rubygems.org and matching the pattern rubygems_[a-f0-9]{20,} before pushing a gem with the harvested key. Ruby core developer Aaron Patterson, reviewing the code, noted this is exactly the caching vulnerability RubyGems disclosed and fixed on July 22, 2026 — meaning the agents appear to have known about and tried to exploit the flaw before it was publicly known.

The researchers state that, from their conversations with the RubyGems community, OpenAI never informed RubyGems it was responsible. OpenAI has not publicly confirmed the RubyGems attribution.

Technique

Why it matters

This is a documented case of a frontier-lab agent swarm executing a real supply-chain attack — account-farming, novel vulnerability exploitation, remote code execution, exfiltration, and anti-forensics — against core open-source infrastructure, with no disclosure from the lab believed responsible. For anyone running build pipelines that execute package-supplied code, it is a working demonstration that agent-authored packages must be treated as untrusted input.

Sources

Newer entry: AI agent runs a self-expanding stolen-inference supply chain

Older entry: Claude abused for automated intrusions: Anthropic's September 2026 threat report