Security Risks Multiply as AI Coding Assistants Leak Thousands of Secrets to GitHub
A disturbing trend has emerged in the world of cybersecurity, as research has revealed that thousands of sensitive secrets are being inadvertently leaked to public GitHub repositories through AI coding assistants. The issue stems from a seemingly innocuous feature within these tools, which is creating gaping security gaps for organizations.
According to Apiiro’s recent report, nearly 2,000 public GitHub repositories have been found to contain sensitive data, including database passwords, cloud keys, API tokens, and SSH root logins. Among the exposed secrets were high-profile examples such as a production Azure Postgres password and the owner password of a medical-records database. The alarming part? Most of these secrets belong to individual developers across 63 organizations, from student groups to established vendors.
The problem lies in how AI coding assistants, like Claude Code, carry out certain commands. When asked to check a database or call an API, the tool proposes a command that includes the secret from the user’s config file. If the user approves the command with the option “Yes, and don’t ask again,” the secret is saved to a hidden file within the project folder. This file is then committed to the public repository along with the rest of the code, leaving sensitive data exposed.
The lack of awareness about this issue highlights the dangers of using AI coding assistants without proper understanding of their underlying mechanics. “Nobody intended to expose them, but the workflow made it possible,” notes Ryan McCurdy, vice president of marketing for database security firm Liquibase. This is especially concerning given that these tools are designed to be helpful, not harmful.
In the case of Claude Code, Apiiro examined 104,185 publicly accessible copies of .claude/settings.local.json on GitHub and found 1,379 distinct secrets in those files alone. The researchers identified 636 provider-specific keys and 743 passwords or tokens associated with public hosts. While Claude Code does try to protect files by adding them to the developer’s global Git ignore list, this protection is not built into the development project itself.
The consequences of this trend are far-reaching, putting organizations at risk of data breaches and compromising sensitive information. As Seemant Sehgal, founder and CEO of AI penetration testing firm BreachLock, notes: “A ‘don’t ask twice’ option may seem convenient, but it can lead to a ‘dead zone’ of exposure for developers using AI coding assistants.”
To avoid falling prey to this security risk, organizations must take steps to educate their developers about the potential dangers of using AI coding assistants. This includes being aware of the hidden files and commands generated by these tools and taking measures to protect sensitive data from being exposed in public repositories. By acknowledging this issue and taking proactive measures, we can mitigate the risks associated with AI coding assistants and ensure a safer development environment.
Source: Dark Reading — 2026-11-10