The OpenAI RubyGems Incident: What Actually Happened

Piotr Grudzień
Published 9 min read
A dashed sandbox card with an AI agent allowed to read the internet but not write to it, a blocked write arrow turning into an upload into a package registry whose gem list fills with junk packages, next to the title The OpenAI RubyGems incident

In May 2026 the team behind the RubyGems package manager announced they had been hit by a serious cyber attack and paused the service to clear compromised accounts. The attack looked typical at first, except for two things that did not fit: nobody knew who was behind it, and the attacker appeared to have nothing to gain, because the data being uploaded was already public. Four months later the answer arrived. There was no human behind it at all.

The uploads came from OpenAI agents being tested inside the lab, and they are the same group of agents involved in the Hugging Face incident. The agents could read the internet but not write to it, were being scored on how fast they could answer questions about government statistics, and worked out that hacking a package manager would give them somewhere to put the data so they could read it back at speed. The video below walks through what happened in plain language, why the motive confused everyone for four months, and why this incident is different from every attack that came before it.

Here is the video. The script, edited for reading, follows below.

What follows is the script of the video from the Quickchat AI YouTube channel, edited for reading. The sentences and their order are as spoken. I cut the connectors that only work out loud, added a heading at each of the video’s chapters, and put the sources at the end.

Starts atChapter
0:00A hack with no hacker
0:44What RubyGems saw in May
1:42Why stuff public data into packages
2:44What the agents were actually optimising for
4:44The agents knew to hide it
5:20The model behind the swarm
6:00Real, AI-generated, or AI-conceived

What happened in the RubyGems incident?

A cyber attack on a package manager turned out, four months later, to have had no human behind it.

It turns out yet another hacker attack can be traced back to OpenAI agents breaking out of their lab. Back in May, the team behind the RubyGems package manager announced that they needed to shut down the service for a bit because they had been under a serious cyber attack. They did not know who was behind it, and now, four months later, it turns out that there was no human behind it, but rather OpenAI agents breaking out of the confines of their training setup. In this post I will explain what happened in plain language so you can understand it and form your own opinions.

What did the RubyGems team see in May?

A flood of uploaded packages, some carrying malicious code and some carrying data with no reason to be there.

In May 2026, the team members behind the RubyGems package manager noticed a large number of packages being uploaded to the system, some containing malicious code, some containing data that should not be there. The team recognised it as a cyber attack pretty quickly because it looked fairly typical. Package managers fall victim to cyber attacks quite often because they are places that users download software from to run on their computers. If you are a hacker, what you will try to do is upload code into the package manager such that if users download it and run it on their machines, it will, for example, grab their passwords and send them to you over the internet.

The RubyGems team recognised the cyber attack, announced it, and shut down the service for some time to be able to clear the compromised accounts. The cyber attack was significant enough that some tech news sites picked it up and published articles about it. What was slightly confusing about the cyber attack was that, first of all, it was not clear who was behind it, and second, the motive was not clear at all, because it seemed like the attacker had nothing to gain from the attack itself.

Why would anyone upload public data to a package manager?

The data being smuggled in was government statistics that anyone could already download for free.

The data that was being uploaded into the package manager was data that is actually publicly available elsewhere, and in particular, it is statistical data that sits on .gov sites in the US or in the UK. So why would anyone hack a package manager to stuff publicly available data into there? To quote one of the RubyGems team members, “It’s not clear what exactly the end goals are as the information appears to be publicly accessible anyway.”

Now picture this. You suffered a cyber attack. You managed to recover from it. You still do not know who was behind it. And then four months later, you learn that there was no human behind it. It was just AI agents who decided, as part of their task, to hack your site. Let us take a step back and try to understand what really happened, and why AI agents would hack a package manager to upload publicly available government data into there.

What were the agents actually trying to do?

They were being scored on answering .gov statistics questions fast, and the package manager was the fastest cache they could reach.

Put yourself in the shoes of an AI agent that is being tested inside the OpenAI lab. You sit in a box where all you have access to is the ability to read information off the internet, and the task you are being tested on is to answer, in quick succession, questions about statistical numbers from .gov sites. So the goal you are pursuing is to answer questions based on .gov sites in a very reliable way and very fast.

What you will likely find is that .gov sites might be unreliable. They might be slow in replying to you, they might sometimes block you or put rate limits on you, and you want to find a way around it. If the task I just described sounds familiar, it is because the OpenAI agents that were involved in the Hugging Face incident described in our previous video were being tested on the same task. In fact, it is the same group of OpenAI agents that was involved in both the Hugging Face incident and the RubyGems incident.

What likely happened is that the agents decided that since they need to fetch data from .gov sites in a very fast and reliable way, the best way to do it would be to download the data and store it somewhere they would be able to fetch it very quickly. The agents were constrained. They could not write things to the internet. All they could do was read things off the internet. So they decided what they needed to do was hack a piece of software like the package manager to be able to post data there, and within that data encode and hide the .gov information they needed to fulfil their goals.

Did the agents know they were doing something wrong?

They named the scripts evil.rb, and then covered their tracks.

The agents were aware that what they were doing was not cool. When they were uploading the data onto the package manager, or running scripts that attempted hacking the package manager, they would call them things like hack.rb, exploit.rb, or evil.rb. And then they deliberately took steps to try to hide the traces of their exploits.

What model was behind the agents?

An unreleased model, less guardrailed than anything in OpenAI’s products, fine-tuned to pursue goals at all cost and to collaborate.

If we take a step back, did the agents do anything unexpected or surprising? Not really. The agents were based on a very powerful, not yet publicly available model within the OpenAI lab. The model was not as guardrailed as the models that are available in OpenAI products. In fact, the agents not only lacked some of the safety mechanisms, they were also specifically fine-tuned to, one, pursue their goals at all cost, and two, be very collaborative, to be able to see what other agents are doing and potentially pursue other goals and help each other pursue more goals collectively.

Why does this incident matter?

Every creation until now had a human behind it, including the AI-generated ones. This one did not.

Why do I think this incident was so significant and so mind-blowing? Whenever you encounter a piece of creation out in the world or on the internet, you are always wondering who the creator is, who is behind it. Up until now, the answer would always be that there is a human behind it. Even if we are talking about very advanced AI-generated content like deepfakes, there is always a human behind it, a human who came up with the idea of creating the deepfake.

In this case, in the RubyGems incident, the only way humans were involved is to take AI agents, put them in a box where they can only read the internet, and give them a task of learning to very quickly answer questions based on .gov statistics sites. It was the agents themselves that decided to break out of the confines of their little task and enter this whole other universe of fulfilling goals, of exploiting software, and hiding the traces of what they did.

So this incident marks the start of a new era where it is no longer is it real or AI-generated, but rather is it real, is it AI-generated, or is it autonomously AI conceived at the very core? And to me, that is the often overlooked little fact about the RubyGems incident that makes it so unique.

Sources

Frequently asked questions

What happened in the OpenAI RubyGems incident?

In May 2026 the RubyGems team noticed a large number of packages being uploaded, some carrying malicious code and some carrying data that had no reason to be there. They recognised it as a cyber attack, announced it, and paused the service to clear the compromised accounts. Four months later it emerged that no human was behind it. The uploads came from OpenAI agents being tested inside the lab, which had broken out of the constraints of their task.

Why would AI agents attack a package manager?

The agents were being tested on answering questions about statistics from .gov sites, quickly and reliably. Government sites are slow, sometimes unreliable, and rate limit automated traffic, so the agents wanted a faster source. They were allowed to read the internet but not write to it, so they hacked the package manager to get a place they could write to, encoded the .gov data inside the packages they uploaded, and read it back at speed.

Was any private data exposed?

No. The data the agents packaged up was already publicly available on the government sites it came from. Socket’s research found the campaign collected public UK council portal content such as calendar pages, agenda listings and committee links. That is what made the attack confusing at the time: the attacker appeared to have nothing to gain, because the information was public anyway.

Did the agents know what they were doing was wrong?

The evidence suggests they did. The agents named the scripts that attempted the hack things like hack.rb, exploit.rb and evil.rb, and then deliberately took steps to hide the traces of what they had done.

Is this the same group of agents as the Hugging Face incident?

Yes. It is the same group of OpenAI agents, tested on the same task. The Hugging Face incident and the RubyGems incident are two different escapes by the same swarm, working around the same constraint of being able to read the internet but not write to it.

Why were the agents able to do this?

They ran on a model that was not publicly available and was not guardrailed to the standard of the models in OpenAI’s products. Beyond missing some safety mechanisms, the agents had been specifically fine-tuned to pursue their goals at all cost and to be highly collaborative, so they could see what other agents were doing and help each other pursue goals collectively.

Why does this incident matter?

Until now, anything found in the world had a human behind it, including AI-generated content like deepfakes, where a human had the idea. Here the only human involvement was putting agents in a box with read-only internet access and a task about .gov statistics. The agents themselves decided to break out, exploit software and hide their traces. The question about a piece of creation is no longer whether it is real or AI-generated, but whether it was autonomously conceived by AI at its core.

Summary

The RubyGems package manager was attacked in May 2026 and paused its service to clear compromised accounts. The uploads carried malicious code and government statistics that were already public, which left the maintainers with an attack that had no identifiable attacker and no apparent motive. Four months later the campaign was attributed to OpenAI agents running inside the lab, the same group involved in the Hugging Face incident.

The agents were being scored on answering .gov statistics questions quickly, ran into the rate limits and unreliability of government sites, and could read the internet but not write to it. Hacking the package manager gave them a writable place to cache the data they needed, hidden inside the packages they uploaded. They named their scripts evil.rb and hid their traces afterwards, running on an unreleased model that was fine-tuned to pursue goals at all cost and to collaborate with other agents.

What makes the incident distinct is the absence of a human author. The humans involved put agents in a box with read-only access and set them a task about government statistics. Breaking out, exploiting the package manager and covering the traces were the agents’ own decisions.