Artificial intelligence is profoundly transforming software development. Tools capable of writing code, fixing errors, executing commands, and managing entire projects are changing the way programmers and technology companies work. Among these solutions, Claude Code stands out. Developed by Anthropic, this programming agent makes it possible to automate numerous tasks directly from the terminal and development environments. However, its capabilities also introduce new challenges related to cybersecurity, especially when it is granted permission to interact with files, servers, and external services.
An incident involving Claude Code has highlighted these risks after an investigation by cybersecurity company Apiiro identified thousands of sensitive credentials exposed in public GitHub repositories. Researchers found database passwords, cloud service keys, access tokens, and other confidential information stored in the tool's configuration files. The problem was related to a feature that allows certain operations to be authorized without having to approve them repeatedly. What initially appeared to be a feature designed to improve productivity ended up facilitating, under certain circumstances, the accidental publication of private information.
This case is particularly relevant because it demonstrates that the risks of artificial intelligence are not limited to potential errors in code generation or incorrect model responses. They can also arise from the features that allow agents to execute instructions, store authorizations, and access sensitive information. The situation makes it necessary to review how these tools are used and what measures organizations should implement to protect their systems. Claude Code represents a significant example of why automation must be developed alongside robust security mechanisms.

What Is Claude Code and How Does It Work?
Claude Code is a programming tool based on Anthropic's artificial intelligence models. It can analyze files, modify code, execute commands, and assist with different stages of application development. Unlike a conventional chatbot, Claude Code can directly interact with the working environment when the user grants it the corresponding permissions. This expands its capabilities, but it also means that its actions can affect real systems and data.
Its features include investigating errors, installing dependencies, running tests, modifying programs, and querying databases. Many of these operations require the use of terminal commands, which is why Claude Code incorporates authorization mechanisms that allow users to review certain actions before executing them. This system aims to maintain a degree of human control over the agent.
However, numerous authorization requests can arise during a programming session. To reduce these interruptions, Claude Code allows certain permissions to be remembered, preventing the system from asking again about previously approved operations. One of the available options is "Yes, and don't ask again." Although practical for repetitive tasks, it can create risks if the authorized commands contain passwords, tokens, or other confidential data.
How Did the Credential Leak Occur?
Apiiro's investigation identified that certain authorizations granted to Claude Code could remain stored in a file called .claude/settings.local.json. This document contains local settings and rules related to execution permissions. Under certain circumstances, it can include complete instructions with parameters and credentials used during an operation.
To understand the problem, imagine that a developer needs to check an application's connection to an external database. Claude Code proposes executing a command containing the server address, username, and password. The programmer accepts the operation and selects the option to stop receiving authorization requests. If the instruction is stored literally, the password may also end up being recorded in the configuration file.
The risk arises when this document is accidentally added to a GitHub repository. Although it is intended to preserve individual preferences, it can be shared with the rest of the project if it is not properly excluded. Claude Code incorporates mechanisms intended to prevent its publication, but these depend on certain conditions. A global exclusion setting does not replace the specific rules of each repository, nor does it guarantee that a file already tracked by Git will stop being included in published changes.
Therefore, the problem does not depend exclusively on artificial intelligence. Developer decisions, repository configurations, and the procedures used to share code are also involved. A file that was initially local can end up being published when modifications are made and changes are pushed to GitHub. This is why reviewing the documents included in version control is essential when using Claude Code.
Apiiro's Figures: Thousands of Secrets Exposed on GitHub
The investigation published by Apiiro on November 5, 2026, examined public Claude Code configuration files available on GitHub. Researchers found 104,185 copies of .claude/settings.local.json distributed across 103,617 repositories. Of that total, 1,122 files contained at least one real secret, according to the company's criteria. Altogether, these documents contained 1,379 distinct credentials.
The findings included database passwords, cloud service keys, and credentials belonging to different technology platforms. Apiiro identified 379 database passwords, 122 Supabase service keys, and another 103 account credentials from this platform. It also found 43 SSH credentials for accessing public servers, 42 tokens related to GitHub, GitLab, and npm, 23 AWS keys, and six private keys.
The investigation also identified credentials belonging to organizations. According to Apiiro, 63 entities had at least one real secret exposed in the analyzed files. Among the documented examples were a cloud services administrator key, an Azure PostgreSQL production password, and a Square production access token. A database owner password used by an application related to medical records was also found.
It is important to interpret these figures correctly. Apiiro identified credentials that met its technical criteria for being considered secrets, but it did not verify whether all of them were still valid or could provide access to the corresponding systems. The company explained that it did not use the credentials or contact the affected servers during the investigation. Therefore, finding an exposed password demonstrates the existence of a risk, but it does not confirm that anyone used it maliciously.
By expanding the analysis to Git histories, shared files, and agent conversation transcripts, Apiiro identified additional secrets. The total reached 2,539 distinct secrets distributed across 1,994 public repositories. This finding demonstrates that reviewing only a project's current files may be insufficient to understand its entire historical exposure.
Why Do Exposed Credentials Represent a Business Risk?
The consequences of publishing a credential depend on the service it provides access to and the associated permissions. A database password with administrative privileges could allow someone to view, modify, or delete information. If the system contains customer, employee, or user data, the exposure could also affect privacy and create issues related to data protection obligations.
Development platform tokens present similar risks. A GitHub or GitLab credential could facilitate access to private repositories or allow certain operations on projects. An npm token could affect package management, while an AWS key could provide access to infrastructure resources. Not all credentials grant unlimited privileges, but publishing them makes it necessary to check what capabilities they provided and whether they are still active.
Another concerning aspect is information persistence. Git maintains a history of modifications, so deleting a password from a file does not necessarily mean it has disappeared from previous versions. Apiiro also identified 211 forks corresponding to 74 affected repositories that retained the same secrets. This demonstrates that superficial cleanup can leave copies of confidential information in different locations.
When an exposed credential is detected, the priority should be to revoke or replace it. The next steps involve cleaning the repository, reviewing its history, and assessing forks and other copies that may retain the information. These measures are important because deleting a file does not guarantee that the password is no longer valid.

Approval Fatigue and the Risks of Automation
One of the most interesting aspects of the Claude Code incident is the relationship between automation and human behavior. Approval fatigue occurs when a person receives so many authorization requests that they begin accepting them automatically, without reviewing each operation. In AI-assisted development, this can happen when an agent needs to execute numerous commands to complete a task.
This phenomenon is not exclusive to Claude Code, but programming agents have a particular characteristic: their instructions can combine technical operations with information obtained from files, environment variables, and external services. A user may understand the general purpose of a command without identifying all the credentials included in it. For this reason, approving an operation without examining its parameters may also mean authorizing the accidental storage of confidential information.
The situation becomes more serious when developers work under pressure or delegate extensive tasks to autonomous agents. Claude Code's main promise is to reduce manual work and accelerate programming. If every operation requires an excessively detailed review, some of that advantage disappears, but eliminating all checks is not an appropriate solution either. The challenge is to establish specific permissions that allow tasks to be automated without granting unnecessary capabilities.
It is also important to distinguish between trusting an artificial intelligence model and trusting the application that runs it. Apiiro pointed out that the observed behavior was related to Claude Code's permission and storage mechanism, rather than a particular model response. The researchers indicated that they were able to reproduce it with different Anthropic models, including Opus 5.5 and Fable 5.1. This demonstrates that security also depends on the engineering decisions that determine how the tool interacts with the operating system.
The Limitations of Secret Detection Tools
Apiiro also examined the limitations of traditional systems used to detect exposed credentials. Among the solutions analyzed were Gitleaks and TruffleHog, tools that search for potential secrets in files and code repositories. Researchers ran both systems against the 104,185 public files they had collected. Neither managed to identify all the documents containing confidential information.
Gitleaks detected 564 of the 1,122 files containing secrets, while TruffleHog identified 643. Furthermore, 215 files containing real credentials were not flagged by either tool. Many detection systems search for recognizable patterns, such as provider prefixes, long strings of random characters, or formats associated with API keys. However, a password can appear within a command as an apparently ordinary text string.
For example, an instruction that incorporates an SSH password or uses a variable such as PGPASSWORD may contain sensitive information without displaying the usual format of a service key. If the detector is primarily configured to identify known patterns, it may overlook these situations. This is why Claude Code's security requires mechanisms capable of also identifying passwords and tokens embedded in terminal instructions.
The problem is not limited to a single configuration file either. Apiiro found secrets in conversations, memory documents, task handoff notes, and shared configurations from different tools. It also examined files related to Cursor, Aider, and GitHub Copilot. These findings show that organizations must expand their security policies to include documents generated by artificial intelligence agents.
Anthropic's Response and Security Improvements
Following the publication of the investigation, Anthropic addressed concerns related to Claude Code. Boris Cherny, the person in charge of the tool, participated in a discussion on Hacker News on November 7, 2026. During the exchange, he acknowledged that Claude Code had historically lacked a specific mechanism for removing secrets from stored commands. He also explained that the company was exploring alternatives to prevent similar situations.
The measures mentioned included improving the detection of sensitive commands in automatic mode and developing a basic secret-scanning system integrated into Claude Code. These proposals aim to reduce the possibility of credentials being accidentally stored. However, Cherny pointed out that the alternatives and their potential consequences still needed to be studied before implementation. At the time of his statements, no specific date had been announced for these improvements.
Anthropic also explained that Claude Code incorporates mechanisms to exclude the local file from Git changes when it creates it. The company considered that many of the exposed documents had been manually added to repositories. Apiiro, for its part, documented situations in which files previously tracked by Git received new authorizations and were eventually updated through changes made by Claude Code. This difference demonstrates that a global exclusion rule is not sufficient in every circumstance.
Enabling the secret detection mechanisms available on GitHub and other platforms is advisable, although they should not be considered foolproof protection either. Apiiro's findings indicate that automated systems can identify numerous credentials, but not necessarily all passwords included in commands. For this reason, companies need to combine reviews, permission controls, history analysis, and confidential information management policies.
How Can You Protect Projects That Use Claude Code?
The first measure is to review the configuration files generated by Claude Code. It is advisable to check the contents of .claude/settings.local.json and look for commands that may contain passwords, tokens, or access keys. It is also important to verify whether the file appears in Git history, because deleting it from the current version does not guarantee that it has disappeared from previous versions. This check should be performed on both individual projects and repositories used by work teams.
If an exposed credential is found, the priority should be to revoke or replace it before focusing exclusively on cleaning the repository. Afterwards, the file should be removed from Git tracking if it is meant to remain local, and an appropriate rule should be added to the project's .gitignore file. Apiiro recommends using git rm --cached to stop tracking the file without necessarily deleting its local copy. It is also necessary to assess forks, clones, and previous versions that could retain the information.
Another important recommendation is to avoid writing passwords directly into commands executed by agents. Instead, environment variables or secret managers can be used to provide credentials without incorporating them literally into stored instructions. For example, a command can reference a variable such as $DB_URL instead of including a connection string containing an actual password. This practice reduces the possibility that persistent authorization will directly store the credential, although it does not eliminate all risks related to access to sensitive information.
It is also advisable to limit the permissions granted to Claude Code. Instead of permanently approving entire commands, it is preferable to establish specific rules that allow certain operations to be executed without authorizing unnecessarily broad instructions. Teams should periodically review stored authorizations and check whether they are still necessary. In addition, corporate repositories can incorporate automated checks before accepting changes, so that sensitive files and potential credentials are detected before they reach a public branch.
Finally, organizations should consider files generated by Claude Code and other artificial intelligence agents as potential sources of confidential information. This means including them in security policies, conducting periodic audits, and training developers about the risks of automation. Protecting .env files or traditional configurations is not enough, because agents can retain sensitive information in less obvious locations.

The incident involving Claude Code demonstrates that the risks of artificial intelligence applied to software development do not always arise from sophisticated attacks. In this case, a feature designed to reduce interruptions during programming ended up facilitating the storage of passwords and other credentials in files that could reach public repositories. Apiiro's investigation identified thousands of exposed secrets, although its findings do not demonstrate that all the credentials were still valid or had been used by third parties. This distinction makes it possible to understand the seriousness of the problem without attributing consequences that were not verified.
The case also highlights that Claude Code's security depends on much more than its model's ability to generate code. Permission management, information storage, Git configuration, and secret detection systems are all part of the same protection environment. If any of these elements has weaknesses, a programming tool can become a source of exposure. This is why automation must be accompanied by mechanisms that make it possible to control what information is used, where it is stored, and what operations each agent can perform.
Anthropic has acknowledged the need to explore improvements to Claude Code, but the responsibility for preventing leaks does not belong exclusively to artificial intelligence manufacturers. Developers and organizations must also review their practices, avoid entering credentials directly into commands, and check which files they add to their repositories. Combining prevention, monitoring, credential rotation, and periodic audits provides stronger protection than relying on a single feature.
Ultimately, saving time through automation should not mean giving up control over sensitive information. At ITD Consulting, we help companies address technological and cybersecurity challenges through solutions designed to protect their infrastructure, optimize their processes, and reduce digital risks. If your organization uses Claude Code or needs to strengthen the security of its systems, contact our team and email [email protected] to learn about our services and discover how we can help you drive your company's digital transformation more securely.