Apiiro found passwords and suspected secrets in 1,122 public GitHub files. The real issue is not a single risky model output. Claude Code's Don't Ask Again feature turns one approval into standing permission.
Source: https://apiiro.com/blog/coding-agents-leaking-secrets-github-dont-ask-again
The latest exposure is not about Claude Code independently generating a dangerous string. The deeper problem is that once a developer selects Don't Ask Again, subsequent file changes, command execution, Git commits, and pushes may all move through the same automated chain.
What Was Found Across 1,122 Files
Apiiro's scan identified 1,122 public GitHub files containing passwords and suspected secrets. Public repositories expose content beyond their members: commit histories can be cloned, search services can index them, and forks replicate them. Even if a sensitive file is later deleted, Git history may retain the original version.
Dependency vulnerabilities and credential leaks are not the same problem. Dependency flaws usually map to specific versions, CVEs, and package manager records. Credentials scattered across scripts, configuration files, Notebook outputs, and temporary files lack a consistent format.
Hard-coded API keys, private keys, database passwords, and internal service addresses often sit beside ordinary code. Scanners can struggle to distinguish test placeholders from real credentials reliably.
The research frames the issue as a workflow problem involving coding Agents and public GitHub repositories, rather than simply asking whether models output secrets. After a developer allows an Agent to read local files, modify code, and run Git commands, a secret that remained inside the workspace may end up in a configuration file, test snapshot, or command log before being committed to a repository.
The Real Risk Is Persistent Permission
Claude Code's Don't Ask Again appears to remove one confirmation prompt, but it actually converts a single human approval into ongoing authorization. Once a developer approves a tool or class of commands, the Agent can continue operating within that scope.
Suppose the initial prompt allows access to the project directory. After selecting “Don't Ask Again,” the Agent may gain the ability to run Bash commands, modify files, and invoke Git. The chain can unfold like this:
- The Agent reads
.env, deployment configuration, or CI files. - While “fixing the issue,” it writes environment variable values into logs, test files, or default configuration.
- The Agent runs
git add, staging the changes for commit. - It runs
git commit, thengit push, pushing the changes to a public repository. - The secret leaves the local environment before anyone can review it.
There is no need to assume that an Agent is deliberately trying to attack the developer. Prompt injection, an incorrect task description, or inadequate diff review can produce the same outcome. GitHub Actions may also push code using GITHUB_TOKEN, but that scenario requires additional context; the presence of a string in a repository alone does not prove an attack path.
Don't Ask Again does more than amplify an individual mistake. It expands the radius of any incorrect action. When commands require confirmation, a human can still see the target. With persistent authorization, the Agent can keep moving while the developer is not watching every step.
Why Conventional Secret Scanners Miss the Window
GitHub secret scanning, secret scanners in CI, and repository-side rules primarily operate at the commit or push stage. They remain valuable, but by the time they run, the sequence may already be too late when coding Agents are involved.
After a developer uses an Agent to modify files, the Agent may immediately commit and push its changes. If scanning occurs only during a pre-push hook, in CI, or through remote protection rules, credentials may already be on the remote while waiting for a scanner to report them. Even with push protection enabled, false positives, gaps in coverage, custom credential formats, and secrets already stored in Git history can still let leaks slip through.
The risk window for a coding Agent more closely resembles activity on the developer's own machine. With access to the shell, file system, and Git credentials, the time between reading a secret and committing it may be only seconds. Unless a scanner establishes boundaries before the Agent acts and checks the workspace after each write, it cannot serve as the final line of defense.
This is why the issue cannot be reduced to a claim that models should never know secrets. More practical questions include: Can the Agent access sensitive directories? Can it write content into files tracked by Git? Can it execute git push? Do all of its commands appear in an auditable log?
Add Guardrails to Claude Code
First, restrict file access. Where possible, prevent the Agent from reading .env, .ssh, cloud credential directories, password manager exports, and production configuration. Keep sensitive data in environment variables or a separate secret store rather than placing it inside the entire project directory the task may scan.
Second, narrow Bash permissions. Authorize reading, modification, and pushing separately instead of granting broad permission to run every command. Restrict at least git push, release commands, package publishing commands, and scripts that access production environments. A safer workflow is to have the Agent generate a diff first, then let a human review and commit it.
Third, inspect what Git is tracking. Before modifying code, run:
# Review files pending commit without pushing directly
git status --short
git diff --cached
If the workspace contains sensitive files, verify that .gitignore covers them. Keep in mind that .gitignore only prevents untracked files from being added; it does not remove secrets that have already entered Git history.
Fourth, add a local pre-commit scan. Use gitleaks to inspect the current changes. The following command scans the workspace before commit:
# gitleaks must be installed in advance
gitleaks detect --source . --no-git --redact
If the repository already has Git history, use this command instead:
# Scan the full Git history and redact matched secrets
gitleaks detect --source . --redact
Fifth, do not rely on pushing and then undoing the change. If a password or suspected secret appears in a public repository, revoke or rotate the credential first, then clean the Git history. Deleting a file does not invalidate a credential. Rotation is complete only when the other party can no longer use it.
Source: https://apiiro.com/blog/coding-agents-leaking-secrets-github-dont-ask-again
The Editorial Take
The central tension in coding Agents is straightforward: the easier permission approvals become, the farther a mistaken action can spread. Don't Ask Again saves clicks, not risk. Apiiro's discovery of 1,122 public files shows why scanners cannot rely exclusively on a CI-stage gate.
More Agent execution audits are likely to follow. The focus will shift from recording only what a model said to tracking what it read, what it changed, which commands it ran, and which approval allowed the sequence to continue. Git commits once served as a clear human checkpoint in development workflows. Once an Agent connects file reads, code changes, commits, and pushes, that checkpoint must be redefined. Auditing model output is not enough; the entire authorization chain needs to be auditable.
Still, the scan results alone do not establish that Claude Code caused all 1,122 files to be exposed. A public scan cannot automatically reconstruct the history of each file. The number is enough to raise an alarm, but not enough to prove complete causation.