Blog/Engineering
Engineering

Claude Code Secrets on GitHub: What Apiiro Found in settings.local.json — A Rotate-First Checklist

i
iFynx StudioNov 7, 2026 · 10 min read
Close-up of source code on a laptop screen, an illustrative developer photograph, not an exposed repository

Direct answer: Apiiro research, published on 5 November 2026 and receiving fresh coverage on 7 November, describes secrets retained in Claude Code approval files and other agent artifacts that reached public GitHub repositories. The vendor’s own announcement confirms 2,539 distinct secrets across 1,994 public repositories. These are classified exposures—not 2,539 proven live credentials. Apiiro says it did not test validity; one notified company confirmed its key had been live.

This is an approval and configuration-handling risk, not a claim that “Claude Code was hacked today.” We checked the research text, the vendor’s announcement and current settings documentation. We do not identify affected repositories, publish secret values, provide sensitive search queries or link exploit demonstrations.

Key facts and limits

  • An exact approved command can become a saved allow rule; a literal credential in that command can become persistent configuration data.
  • Current local settings, historical versions, shared settings and transcripts are different datasets. Do not add file counts, copied forks and distinct-secret counts together.
  • Apiiro’s “real secret” is a classification based on format/context, not proof a credential currently works.
  • Revoke or rotate exposed credentials first, then coordinate repository and artifact cleanup.
  • Global Git exclusions are machine/user configuration; a repository-level exclusion travels with the project but does not undo existing tracked history.
Close-up of source code on a laptop screen, an illustrative developer photograph, not an exposed repository
Illustrative development workflow, not leaked credentials or a named affected repository. Photo: Marc Mueller via Wikimedia Commons, CC0 1.0, cropped.

What the approval remembers—and what the documentation confirms

Claude Code’s settings documentation says choosing “Yes, and don’t ask again” for a Bash command saves an allow rule in .claude/settings.local.json. Apiiro reports that when the proposed permission covers an exact command, that command can be saved word for word, including a password or token it contains. The problem is not merely whether running the command was authorized: the record granting future permission can become another copy of its credential.

Not every approval contains a literal secret, and a reusable rule need not contain one. The defensive question is what text is persisted after approval, where it can travel, and who reviews it. A permission decision should not silently double as credential storage. Avoid blanket claims that the tool publishes secrets automatically or that every project-local settings file is unsafe.

The numbers: preserve the denominator

Measured itemApiiro’s reported countCorrect interpretation
Public current local-settings copies examined104,185 files in 103,617 repositoriesFiles and repositories are different units.
Current copies classified as secret-bearing1,122 files, approximately 1.1%Share of examined files, not share of all GitHub users.
Distinct secrets in that current local-file subset1,379: 636 provider-format keys and 743 context-classified passwords/tokensA classified value is not a verified live credential.
Additional history-only secrets734 distinct secrets across 509 repositoriesAbsent from the current copies examined; not proof revoked.
Broader study total2,539 distinct secrets across 1,994 repositoriesIncludes history, shared settings and agent transcripts; do not present as local-file-only.
Organizations with a secret in a public allowlist63 organizationsAn organization-case subset, not the denominator for all 1,994 repositories.

Source: Apiiro’s research; an accessible Apiiro-branded research copy carries the detailed methods and tables. The official announcement independently confirms the broad total and canonical research URL. The paper’s 211 forks of 74 repositories describe propagation of the same secrets, not 211 additional distinct credentials. Its 539 Claude-coauthored changes among 1,105 traced repositories describe a traced subset; they do not prove Claude introduced or pushed every exposure.

The researchers collected default-branch data between 1 and 3 November and notified organization cases on 2 and 3 November. Their history coverage is incomplete by design, so the historical count is a floor for the material they examined. These are observations at collection time, not a live census of what remains public this evening. The November 7 news wave should not be rewritten as a newly discovered November 7 breach.

Validity, scanner coverage and what remains unknown

Apiiro says no credential was used or tested and no host was contacted. Its classification filters provider-format and contextual candidates, removes known false positives, and uses masked-context review for the main secret counts. It separately notes that some auxiliary memory, handoff and editor-settings categories were classified by rules alone. “Real” in that methodology therefore does not mean verified access or successful data theft.

In the 1,122 secret-bearing local files, Apiiro says gitleaks flagged 564 and TruffleHog 643, while neither flagged 215. The scanners ran without verification. Those numbers are overlapping file-level detections, not additive totals or a count of valid keys. A missed arbitrary password inside a command can look unlike a provider-formatted token; a clean scanner report should not override contextual review.

Rotate-first response for Gulf, Egypt and Palestinian development teams

  • Assign an incident owner and the credential’s service owner before copying findings into tickets. Keep evidence in a restricted record with values redacted; do not paste a password into an issue, chat transcript or public AI prompt.
  • If a credential was exposed, revoke or rotate it at its issuing system first. Coordinate dependent applications and verify the replacement works without leaving the old credential enabled indefinitely. Prioritize high-privilege and production access based on actual scope.
  • Review service and identity logs for misuse during the possible exposure window. A publicly visible password is serious, but it is not evidence by itself that a database was read or an account was taken over. Escalate suspicious activity to incident responders.
  • Audit current configuration and historical commits in repositories you own or are authorized to assess, including forks, clones and release artifacts under organizational control. Do not limit review to the default branch or files still visible today.
  • After containment, coordinate untracking and history cleanup with repository owners. Understand collaboration and downstream-copy consequences before rewriting history; deleting a file cannot recall copies already downloaded.
  • Separate local personal approvals from deliberately shared team settings. Put the appropriate local-file exclusion into the repository’s policy templates and review existing tracking; do not assume a global exclusion on one freelancer’s laptop protects every teammate.
  • Inspect package contents, container build inputs, archives, synchronized folders and agent transcripts before publication. A file can leave the laptop without any Git commit.
  • Close with evidence: revocation completed, dependent systems healthy, saved rules reviewed, artifacts checked and the safe state verified on a clean authorized checkout. Do not close the incident merely because the newest file no longer contains the value.

For an agency working across client projects, isolate credentials and approval policies per client rather than sharing a catch-all development account. A personal portfolio repository should never inherit a customer’s production access. Use an Arabic/English handoff that identifies the responsible owner, affected service, revocation status and next update time without including the secret itself. We do not assert a local statutory notification deadline without checking the applicable primary rule.

Prevention: shared controls, narrow approvals and safe runtime references

The vendor documentation describes adding the local settings path to the user’s global Git excludes when Claude Code first writes it in a Git repository. That is a real safeguard and should be acknowledged. But it belongs to one user/machine; it is not a committed .gitignore rule. Git’s documentation explicitly says ignore rules do not affect files already tracked. Both prevention and cleanup need an organization-level owner.

Keep literal secret values out of command text and use approved secret-manager/runtime references where appropriate. An inline assignment containing the actual password still contains the password; a variable name is not a guarantee that expansion, execution logs or transcripts remain secret-free. Review what the assistant saves and keep standing approvals narrow and task-specific. Do not respond by granting unrestricted command patterns merely to avoid storing one literal string.

Add contextual scanning to pre-commit and CI review, with controlled synthetic test cases rather than real production values. Review agent configuration, memory and exported conversations alongside application source. Require a human review for new persistent approvals touching production, payment infrastructure or privileged infrastructure accounts.

Frequently asked questions

Was Claude Code hacked?

The verified story concerns credential-bearing commands saved in approval/configuration files that were then published in repositories. Apiiro’s findings do not establish a breach of Anthropic infrastructure or a malicious actor using every exposed credential.

Does “2,539 secrets” mean 2,539 live keys in settings.local.json?

No. Apiiro’s total covers distinct classified secrets across current settings, Git history, shared settings and agent transcripts. It did not use or test credentials. The current local-settings subset contained 1,379 distinct secrets, not the full total.

How does “don’t ask again” create the risk?

Claude Code’s documentation says that approval saves an allow rule in the project-local settings file. Apiiro reports that an exact credential-bearing command can be saved verbatim, retaining the literal secret inside that rule.

Does the word “local” or a global Git exclusion prevent all publication?

No. Local describes configuration scope. Vendor documentation describes a global Git exclusion on the machine where Claude Code creates the file; that is not a committed repository policy and does not untrack a file already committed.

Does deleting the file or rewriting Git history fix an exposed key?

No. Revoke or rotate exposed credentials first with the system owner. Earlier commits, forks, clones and downloaded artifacts can retain copies. Coordinate cleanup after containment rather than relying on deletion to disable access.

Should the shared settings.json file also be ignored?

Not automatically. The shared file is intentionally versioned for team settings. Review it for secrets and unsafe permissions; distinguish it from personal local overrides rather than deleting all team configuration.

Can a secret scanner prove a repository is safe?

No. In Apiiro’s measured local-file subset, neither of two scanners flagged 215 of 1,122 files classified as secret-bearing. These are file counts, not a count of live credentials, and scanner results are not a substitute for context-aware review.

Are environment variables a complete fix?

Referencing a runtime secret can avoid saving the literal value in an approval, but putting the value into an inline assignment still exposes it in command text. Expansion, logs, transcripts, build artifacts and permissions need separate review.

Sources and update policy

We will update vendor behavior, remediation or counts only with attributable evidence. No affected repository or organization is named here, and no credential was retrieved, tested or used by آيفينيكس for this article.

Related reading