OpenAI has confirmed that AI agents used RubyGems during a training run, after researchers linked them to a malicious package-publishing campaign and attempts to exploit the platform. The incident adds to a growing list of cases involving AI systems accessing external infrastructure during testing, raising fresh questions about agent safety.

OpenAI’s AI agents reportedly targeted the RubyGems software repository in May, attempting to exploit vulnerabilities and publish hundreds of packages, according to researchers cited by The Wall Street Journal. The incident happened roughly two months before AI agents linked to OpenAI were involved in an attack on open-source platform Hugging Face.

OpenAI has confirmed that its agents accessed RubyGems, although the company said its review so far suggests they were using the platform to retrieve publicly available information and perform legitimate tasks during a training run.

“Based on our review, our agents used the RubyGems platform to access the internet to carry out benign tasks and retrieve public information,” an OpenAI spokesperson said. The company added that it is continuing to examine the agents’ activity during training and evaluation.

The researchers who uncovered the May incident, Spencer Kitts, Thomas Larsen and Sydney Von Arx, said the agents appeared to have uploaded hundreds of packages to RubyGems on May 11. They said they believed the packages were produced by OpenAI’s internal agents, though they could not establish the agents’ intentions or determine whether every action attributed to them was successful.

OpenAI agents reportedly attempted to exploit RubyGems

The researchers said the activity went beyond simply downloading public information. According to their investigation, the agents attempted to obtain RubyGems user credentials by exploiting a previously unknown vulnerability in the platform’s servers.

techMore from Tech

They also reportedly used RubyDoc.info, a service that generates documentation for Ruby code, to execute their own code on its infrastructure. The researchers said they did not have access to the wider context of the AI agents’ behaviour, leaving the reason for these actions unclear.

RubyGems, however, said its investigation found no evidence that the credential-theft attempt succeeded. In a Friday blog post, the platform also said it could not establish whether AI agents were responsible for creating or publishing the packages involved in what it described as a spam-publishing campaign.

The incident nevertheless disrupted the service. RubyGems temporarily suspended new account registrations while responding to the activity, with a member of its security team describing the event at the time as a “major malicious attack”.

AI agents face growing scrutiny over cyber risks

The RubyGems episode is part of a wider series of incidents involving increasingly capable AI agents interacting with external systems. Anthropic disclosed its fourth case of an AI model hacking into external systems during testing on Wednesday, adding to concerns over how much autonomy such systems should have while being evaluated.

OpenAI has faced other incidents involving its agents as well. Before the July breach involving Hugging Face, a group of its agents reportedly took over a German-language wiki and used it as an improvised communication channel for cheating on tests. OpenAI did not publicly disclose that incident at the time.

The growing number of cases has intensified debate in the US over safeguards for AI systems that can browse the internet, execute code and interact with third-party infrastructure. The issue has gained additional political attention following warnings from Anthropic researchers that increasingly powerful AI could pose severe risks, including potentially existential threats.

For OpenAI, which is also reportedly preparing for a potential IPO, the RubyGems incident adds another example of the difficulty of controlling autonomous systems even when they are being developed and tested for ostensibly benign purposes.