Back to insights
Artificial Intelligence5 min read

Do AI Coding Assistant Settings Files Leak Passwords? Apiiro Research: Secrets in 1,122 Files and 8 Measures

According to Apiiro, one AI coding assistant saves approved commands in full in a project settings file; when the file reaches GitHub, passwords and keys go public with it. Eight checks your software team can run today.

By , Founder, Aktaş Digital
Do AI Coding Assistant Settings Files Leak Passwords? Apiiro Research: Secrets in 1,122 Files and 8 Measures

In brief: According to research by security firm Apiiro (The Hacker News, 7 November 2026), when a user picks “Yes, and don't ask again” in Claude Code, the approved command is saved in full in .claude/settings.local.json inside the project. If the command contains a password or token, it is stored in plain text. The researchers found 104,185 such files in 103,617 public repositories; 1,122 (about 1.1%) contained at least one secret, 1,379 distinct secrets in total, including 379 database passwords, 43 SSH logins for public servers, 42 GitHub/GitLab/npm tokens and 23 AWS keys. Counting the shared settings.json and saved chat logs, the total is 2,539 secrets across 1,994 repositories. The researchers did not test whether the secrets still work; one company they notified confirmed its key was live. The lesson is not specific to one tool: agent folders hold secrets just like .env files. Eight checks you can ask your software team for are below. Source: The Hacker News.

Last updated: 9 November 2026

Transparency note: we use these tools in our own work too; this article is a risk notice, not a promotion, and it reports the findings in the story.

What was found?

According to Apiiro, the mechanism works like this:

  1. A developer approves a command the assistant wants to run with “Yes, and don't ask again.”
  2. The command is written in full into the project's .claude/settings.local.json as a permission rule.
  3. If the command contains PGPASSWORD=..., sshpass -p ..., mysql -p... or an API token, the secret goes into the file in plain text.
  4. The tool adds the file to the user's global git excludes, but not to the project's own .gitignore. So the protection doesn't carry over to other users or to the project; the file can enter the repository.

The numbers

MeasureValue
Files scanned (settings.local.json)104,185 copies in 103,617 public repositories
With at least one secret1,122 (about 1.1%)
Distinct secrets (in these files)1,379
Database passwords379
SSH logins for public servers43
GitHub/GitLab/npm tokens42
AWS keys23
Organisations affected63
Extra secrets in older versions734 secrets, 509 repositories
Shared settings.json298 of 76,011 copies
All sources combined2,539 secrets, 1,994 repositories

Other details from the story:

  • Every file with a secret was still on its repository's default branch; in half of the repositories it had been there for at least 217 days.
  • In 539 of 1,105 traced repositories, a commit co-authored by Claude changed the file.
  • Of 16 coding agents compared, the researchers say Claude Code is the only one confirmed to save the full approved command into a project file by default.
  • Leak scanners miss it: of the 1,122 files, gitleaks flagged 564 and TruffleHog flagged 643; neither flagged 215. Most misses were passwords typed inside commands.

The vendor's side

The story says Anthropic did not reply to the researchers, that an 11 August 2025 bug report was closed as “not planned” by an automated bot on 3 January after 60 days of inactivity, and that four related reports were all closed by the same bot. That is the story's claim; the vendor's official response should be followed separately.

Is this only about one tool?

No. The recommendations in the story are tool-neutral: agent folders such as .claude/, .cursor/, .gemini/, .specstory/ and agent memory files are places that can hold secrets, like .env files. AI coding assistants run commands, write files and keep logs; all of that output is saved somewhere. Whatever tool you use, you need to know where those records go.

8 measures: ask your software team for them

  1. Search first: in your GitHub organisation and git history, search for .claude/settings.local.json and .claude/settings.json (and other agent folders).
  2. Rotate secrets first: every password, token and key found in these files, before cleaning up. Deleting the file does not delete the copy in history.
  3. Stop tracking the local file: remove it from the repo with git rm --cached and add it to the project's .gitignore.
  4. Delete rules that contain secrets: in local copies, including uncommitted ones.
  5. Don't put secrets in commands: instead of typing the password in the command, use variables fed from a secrets manager (for example $DB_URL).
  6. Approve patterns, not single commands: grant approval with patterns like Bash(npm run:*) so full command text isn't saved.
  7. Treat agent folders as secret-bearing: add these folders and agent memory files to pre-commit and CI secret scanning, including git history, and verify your scanner catches passwords typed inside commands.
  8. Add them to the organisation template: put .claude/settings.local.json and similar files into the organisation's .gitignore template. Credentials that grant direct access to a server (SSH logins, database passwords) have the highest priority.

From a contracting angle

If you have software built by an agency or an in-house team, this is a process question: which AI tools does the team use, where do your code and credentials end up in those tools' records, and are credentials in a shared secrets manager? We covered this in our AI use policy guide, our checklist for giving AI agents access to company data and our LiteLLM supply-chain article. For the relevant contract clauses, see our 15-clause checklist.

With Aktaş Digital

In projects we keep credentials separate from code repositories and agent records, and add secrets management and scanning steps to delivery. To have your current repositories reviewed, use our quote form. Related services: web applications and AI solutions.

Frequently Asked Questions

Is this only about Claude Code?

The story says Claude Code is the only tool confirmed, among 16 compared, to save the full approved command into a project file by default. But the measures, and the lesson that agent folders can hold secrets, are tool-neutral.

Were the secrets actually usable?

The researchers did not test validity; one company they notified confirmed its key was live. Whether anyone used them is not stated. The safe approach is to treat every secret found as valid and rotate it.

Is deleting the file enough?

No. It stays in git history and forks may have copied it. Rotate the secrets first, then clean up.

Should I stop using AI coding assistants?

Not necessarily. The tools can speed up workflows (where does the bottleneck move?); what matters is that secrets are not typed into commands, settings files don't enter the repository and scanning is automated.

Which secrets are the most dangerous?

Credentials that give direct access to a server or database (SSH logins, database passwords, cloud keys). The story recommends prioritising them.

Conclusion

Apiiro's finding shows that the settings and log files AI coding assistants produce as a by-product can be a new secret-leak path. The tool-neutral lesson: protect agent folders like .env, don't type secrets into commands and automate scanning. The first step: this week, have your software team search your repositories for .claude/ (and other agent folders) and give you the result in writing.

Your first consultation is free
Let's bring your project to life
Tell us about your idea and we'll prepare a tailored roadmap and cost estimate.