What to do
As of 8 October 2026
First what RubyGems, JFrog and Mend.io said to do, then clearly labelled general advice for people who install packages and for teams running AI agents. The general advice is not from the sources.
What RubyGems said to do (advisory, 22 July 2026)
RubyGems' advisory on the legacy API-key leak is aimed at people who own gems:
- Check your gems for unexpected versions, yanks, owners, trusted publishers or webhooks [1]
- Turn on multi-factor authentication for both the website and API use [1]
- Prefer scoped keys, which are API keys limited to specific actions [1]
- Use trusted publishing in automated build pipelines [1]
What JFrog and Mend.io said
JFrog's guidance is for organisations whose build systems may have processed affected versions:
- Review automated build jobs that processed affected versions [2]
- Isolate workers that ran untrusted payloads [2]
- Build documentation without publishing keys or cloud credentials [2]
- Rotate exposed credentials and audit account changes [2]
- Sanitise package metadata [2]
What the sources do not say None of the sources reviewed gives a separate instruction for people who only install gems, and none reports that a real developer was harmed by installing one. Mend.io's view is that this kind of flood needs real-time behavioural monitoring by the registry itself, which an individual cannot supply [3].
General advice for people who install packages (not from the sources)
This is general good practice, kept short, and is not a statement about what happened here.
- Add a dependency only when you need it, and look at who publishes it, how old it is and whether the name is a near-copy of a better-known one
- Treat a brand-new package with a vague description or few users as unproven until you have read its code
- Use a lockfile that records exact versions, and review changes to it like any other code change
- Keep secrets such as API keys out of the environment where packages are installed and tested, and rotate any key you think was exposed
- Turn on multi-factor authentication on your registry account
General advice for teams running AI agents (not from the sources)
Again general practice, not a finding about OpenAI or this incident.
- Limit which sites an agent can reach, and leave out public registries unless the task needs them
- Do not give an agent credentials that can publish code or create accounts unless that is the task
- Log what agents fetch and publish, and review the logs for unexpected registry or account activity
Sources
- RubyGems blog, “Security advisory: legacy API key leak (GHSA-9j48-x3c3-mrp2),” 22 Jul 2026 (primary source) — https://blog.rubygems.org/2026/07/22/security-advisory-legacy-api-key-leak.html
- JFrog Security Research, “New packages identified in GemStuffer "OpenAI Swarm" malicious RubyGems campaign,” 15 Sep 2026 (primary source) — https://research.jfrog.com/post/gemstuffer-openai-rubygems/
- Mend.io, “Inside the RubyGems supply chain attack,” 14 May 2026 (modified 17 Aug) (primary source) — https://www.mend.io/blog/inside-the-rubygems-supply-chain-attack/