Claude Code can leak seller API keys
How a "don't ask again" approval can save a password in plain text, and a short check for shops that run automation.
AI POD Builder
November 15, 2026 · 6 min read
In early November 2026, software security company Apiiro reported that Anthropic's coding assistant, Claude Code, had saved passwords and API keys into a project settings file that later appeared in public GitHub repositories. The researchers counted 1,122 public copies of that file that held at least one credential. For sellers who use an AI coding agent to automate shop tasks, the useful part is a short check, not the headline number.
How a key lands in the file
Claude Code asks before it runs most shell commands. According to Anthropic's permissions documentation, choosing "Yes, and don't ask again" for a Bash command saves an allow rule in .claude/settings.local.json at the repository root. The rule is permanent for that repository and command, including later sessions started in subdirectories.
Apiiro says the saved rule sometimes is a pattern, such as npm test *, and sometimes is the exact command the prompt offered. When it is the exact command, any password or token typed into that command is stored with it, in plain text. The researchers say they reproduced that behavior with current models.
Anthropic's settings documentation says Claude Code tries to keep the local file out of git. The first time it writes the file in a repository that does not already ignore it, it adds **/.claude/settings.local.json to the user's global git excludes, so git on that computer ignores the file in every repository. That protection lives in one user's git configuration on one machine. Anthropic does not add the file to the project's own .gitignore, so the ignore rule does not travel when someone else clones the project, or when the folder is later turned into a repository on a different computer. If the file was created by hand, the docs say it should be added to .gitignore directly. Apiiro's further point is that a file already committed is left in place.
What Apiiro found
The company's search of public GitHub found 104,185 copies of .claude/settings.local.json in 103,617 repositories, according to reporting by The Hacker News and Ars Technica, which summarize research by Apiiro's Shmulik Cohen and Matan Giladi. About 1.1 percent of those copies, or 1,122 files, held at least one credential, totaling 1,379 distinct secrets. A broader scan that included older versions of the file, the shared .claude/settings.json that teams often commit on purpose, and saved agent chat logs raised the total to 2,539 secrets across 1,994 repositories. The researchers also published a short census summary.
Among the current local-file secrets, The Hacker News reports, more than a third opened a database directly, including 379 database passwords. The same account lists 43 SSH logins for public servers, 42 tokens for GitHub, GitLab, and npm, and 23 AWS keys, across files tied to 63 organizations. In 539 of the 1,105 repositories the researchers traced, a commit that listed Claude as a co-author had changed the file. As of the Monday referenced in that reporting, every file that held a credential was still on its repository's default branch, and in half of those repositories it had been there for at least 217 days. Older versions of the file held 734 more secrets across 509 repositories. Forks spread the exposure further: 211 forks of 74 repositories carried the same secrets as the originals.
Those figures are Apiiro's findings. The company sells application and agent security products, and it did not test whether the secrets still worked. One organization it notified confirmed that an exposed key had been live. The research shows an exposure risk. It does not, by itself, show that the credentials were used by anyone else.
Users had described the same save behavior earlier. A bug report filed on August 11, 2025, said approved commands with API keys and tokens were being stored word for word in settings.local.json. Apiiro said an automated bot later closed that report as "not planned" after 60 days of inactivity, and that related reports it cited had also been closed by the same bot, with no reply from Anthropic as of its write-up. This article has not independently confirmed Anthropic's current response.
Why this reaches print-on-demand shops
A growing number of Etsy and print-on-demand sellers use coding agents to write scripts that talk to shop APIs, print providers, or spreadsheets. Those scripts often need an Etsy key, a Printify or Printful token, a Shopify Admin token, or a database password. If a seller approved a command that included the credential on the command line, the same settings file can hold it.
The leak does not require a public GitHub repository to matter. Apiiro notes that the file is ordinary JSON in the project folder, and that it can also be left inside a zip archive, a Docker image, an npm package, or a synced folder. Common credential scanners also missed a share of the files, the researchers said, because many of the secrets are ordinary-looking passwords sitting inside a command, not a well-known key format.
A short check, then rotate first
Apiiro's cleanup advice, which GitLab has also restated, is practical for a small shop as well as an engineering team:
- Search every GitHub account and organization you use for
.claude/settings.local.jsonand.claude/settings.json. Check each repository's git history, even where the files are gone. - Open the file on your own computer, including in projects that were never pushed, and look for passwords, tokens, or keys inside saved allow rules.
- Rotate every credential the file has ever held before cleaning up. Deleting the file does not revoke a key, and it does not erase copies in history, forks, or clones.
- Stop tracking the local file with
git rm --cached .claude/settings.local.json, and add.claude/settings.local.jsonto the repository's own.gitignore. - Keep secrets out of commands. Refer to them as environment variables, such as
$ETSY_API_KEY, so a saved rule stores the variable name rather than the credential. Prefer approving a pattern, such as a safe command prefix, over a single literal command.
If a shop uses other coding agents, it is worth treating their local folders the same way, as Apiiro recommends for directories such as .cursor/ and .gemini/. The firm said that of 16 coding agents whose documentation it compared, Claude Code was the only one confirmed to save the full approved command in a project file by default. That comparison is Apiiro's, not an independent audit of every tool.
For a short briefing on tools and marketplace rules that affect print-on-demand sellers, subscribe to the newsletter.
Good questions
What file should sellers look for?
The main file is .claude/settings.local.json in a project folder. Also search for .claude/settings.json, which teams sometimes commit on purpose, and check git history even if the files are no longer on the default branch.
If the repository is private, is this still a problem?
Yes. The file is plain text on disk. Apiiro notes that copies can also end up in a zip archive, a Docker image, an npm package, or a synced folder, not only in a public GitHub repository.
Is deleting the file enough?
No. Deleting it does not revoke a password or key, and it does not erase older copies in git history, forks, or clones. Rotate every credential the file has ever held, then untrack the file and add it to the repository's .gitignore.
Did Anthropic confirm a breach?
This article has not seen an Anthropic incident report on the research. Anthropic's documentation does describe the "don't ask again" save behavior. Apiiro's figures are the company's own findings and show exposure risk, not a demonstrated mass use of the secrets.
Take the resources
The video prompts and agent loops are free to copy. Visit the agent skills page for available skill packages.
Keep building your AI POD future.
Company names and logos are trademarks of their respective owners. AI POD Builder is not affiliated with or endorsed by them.