Second API Key Slip for Musk’s AI Models by DOGE Staffer Raises Questions About Security

July 18, 2025


A July 13 GitHub commit came bundled with another unprotected API key for over 50 AI models, and spotted by security outfit GitGuardian. The key was quickly removed later in the day but the researchers noted that it continued to function as of the following day.

About three months after an initial incident involving an API key leak via GitHub, Elon Musk’s AI models are back in the news for another round.

A July 13 GitHub commit came bundled with another unprotected API key, quickly spotted by the continual monitoring of the platform by security outfit GitGuardian. The oversight was quickly traced to DOGE staffer Marko Elez, something of a lightning rod for controversy in recent months. Unlike the last incident, the key was quickly removed later in the day. However, the researchers noted that it continued to function as of the following day.

Musk AI models embroiled in controversy just as federal adoption ramps up

Elon Musk’s “frontier” AI models are seeing uptake by the federal government in the wake of a $200 million ceiling contract that makes them broadly available to agencies and departments. A recent string of mishaps of this nature is thus unfortunately timed, raising questions about both the security and reliability of these models.

The two slips with API keys accompany a recent breakdown by the Grok chat model that interacts with users on X, in which some posters were able to goad it into calling itself “MechaHitler” and issuing a variety of offensive posts. X CEO Linda Yaccarino resigned shortly after this, though there have yet been no statements indicating that the outbursts had anything to do with it.

It remains unclear exactly to what degree the impacted AI models have been integrated with national defense infrastructure, but that is the most immediate security concern. The quick work of GitGuardian seems to have limited exposure to a matter of hours in this case, but it remains unclear who else might have encountered the API key during that time. Further, the key was not decommissioned in a timely manner though the responsible parties were clearly made aware of the issue. Elez has been linked to DOGE projects at the US Treasury, Social Security Administration, Department of Homeland Security and Department of Justice, raising further questions about the full range of exposure should a threat actor have come across it.

API key granted access to over 50 xAI models

The API key was located in a code script called “agent.py” that was uploaded to GitHub, and subsequently found to grant access to at least 52 xAI LLMs used by Grok and other services. Elez was traced as the owner and emailed by GitGuardian staff; he did not respond, but the API key was removed later in the day.

Elez has spent much of 2025 thus far involved in controversial issues. In February, an old account of his was unearthed that contained racist and otherwise offensive posts. He resigned from DOGE after the story broke, but was rehired after Vice President JD Vance tweeted in support of giving him a “second chance” and Musk ran an X poll that went well for him.

Another staffer leaked an API key in early March, which went unnoticed until it was discovered by security researchers in late April. That key was even more expansive, providing access to at least 60 Grok AI models in development.