Skip to main content

El Blog de IA

November 30, 2026

Artificial intelligence, explained without the jargon.

November 30, 2026

Claude Code and “don’t ask again”: 2,539 passwords exposed on GitHub

An Apiiro study finds 2,539 secrets exposed on GitHub because of how Claude Code stores commands approved with “don’t ask again”. What happened, why it matters and how to check whether you are affected.
Código de programación en la pantalla de un monitor
Photo: Markus Spiske, CC0, via Wikimedia Commons

If you use Claude Code, there is a file in your project you should check today. Researchers at the cybersecurity company Apiiro have found 2,539 exposed secrets (passwords, keys and tokens) in public GitHub repositories, and the cause is a very convenient option in Anthropic’s coding assistant: “Yes, and don’t ask again”.

The essentials:

  • When you approve a command “forever”, Claude Code saves it as is in .claude/settings.local.json, passwords included if they were part of the command.
  • If that file is pushed to a public repository, anyone can read them.
  • Apiiro reviewed 104,185 public copies of the file: about 1,122 (1.1%) contained at least one secret.
  • Counting Git history, forks and other agent files, the figure rises to 2,539 secrets across 1,994 repositories.
  • What to do: rotate the exposed keys, add the file to your project’s .gitignore and don’t type passwords into commands.

What exactly happened?

Claude Code asks for permission before running commands on your computer. So that you don’t have to approve the same thing over and over, it offers the option “Yes, and don’t ask again”. When you click it, it saves a permission rule in the .claude/settings.local.json file in the project folder.

The problem is that this rule stores the full command. If the command included a database password, a GitHub token or an AWS key typed by hand, it is saved in plain text. And if you then commit and push to a public repository, that password is visible to everyone.

According to the study published by Apiiro on November 5, the secrets found included 379 database passwords, 43 SSH credentials, 42 GitHub, GitLab or npm tokens and 23 AWS keys. They affected 63 organizations, and at least one confirmed that the key it was notified about was still working. The researchers did not check the rest, so they speak of exposure risk, not confirmed attacks.

Clear padlock with keys
Photo: zaphad1, CC BY 2.0, via Wikimedia Commons.

Why isn’t deleting the file enough?

  • Git remembers everything. Even if you delete the file, earlier versions remain in the repository history and in any forks others have made.
  • The protection doesn’t travel with the project. Claude Code adds the file to your computer’s global Git exclusion list, but not to the project’s .gitignore. If someone else on the team or your other computer doesn’t have that exclusion, the file can slip through.
  • Scanners don’t catch everything. Gitleaks and TruffleHog, two common tools for detecting secrets, left 215 of the 1,122 files with secrets unflagged, especially when the password was embedded inside a command.

In addition, according to The Hacker News, a report about this behavior opened in August 2025 was closed by an automated bot as “not planned”, as were four later ones. At the time of writing, Anthropic had not announced any change.

How to check whether you are affected (and what to do)

  1. Look for the file in your repositories: git ls-files | grep .claude/. If settings.local.json shows up, open it and check for passwords, tokens or keys.
  2. If there is any secret and the repository is or ever was public, change that key NOW. This comes first: cleaning the history is pointless if the key still works.
  3. Stop tracking the file and add it to the project’s .gitignore: git rm --cached .claude/settings.local.json and a line .claude/settings.local.json in the .gitignore.
  4. Don’t type passwords into commands. Use environment variables or a secrets manager, and approve command patterns instead of full commands with the key inside.
  5. Treat the .claude/ folder the way you treat the .env file: something that is never pushed.

Our take

This is not an exotic bug: it is what happens when a tool built for speed stores things without the user knowing. Coding agents like Claude Code, Cursor or Copilot will write more and more configuration files on their own, and each one is a new place where a password can slip in.

The simple rule: if an agent can write to your project, review what it writes before you push it. If you are just getting started with this kind of tool, you may like our guide on what AI agents are.

Frequently asked questions

Is this a hack of Claude or Anthropic?

No. Nobody has attacked Anthropic. These are passwords that users themselves pushed to public repositories without realizing it, because of how Claude Code stores permissions.

If my repository is private, am I safe?

Safer than with a public one, but not completely: anyone with access to the repository can see those keys. The best practice is to keep no passwords written in any project file.

Do I have to stop using “don’t ask again”?

Not necessarily. The problem only appears when the approved command has a password inside it. Use environment variables and check from time to time what is in settings.local.json.

Sources

Featured image: code on a monitor, photo by Markus Spiske, CC0 (public domain), via Wikimedia Commons.

You may also like

Tecla Copilot en el teclado de un portátil con Windows 11

Free Copilot: what Microsoft Copilot is and how to use it in Spanish

Microsoft Copilot is still free, but since August 2026 it requires an account. How to use it in Spanish on the web, Windows, mobile
Rascacielos de Hangzhou, la ciudad china donde tiene su sede DeepSeek, vistos desde el Lago del Oeste

DeepSeek: what it is, how to use it for free in Spanish, and whether it’s safe

DeepSeek is the Chinese chatbot you can use for free and in Spanish. We explain how to get started, which model it runs now,
Paleta de pintor y pinceles, Leonardo AI para crear imágenes con IA

Leonardo AI: What It Is, How to Use It for Free and How Much It Costs (2026)

What Leonardo AI is, what it is for, what the free plan includes, the price of each plan and how to create AI images

Most read

El Blog de IA
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.