An approval rule became another copy of a credential

A developer can keep a secret out of the usual configuration file and still publish a second copy. Apiiro describes a route through Claude Code's saved command approvals: when a shell command contains a password or token and the developer chooses "don't ask again," the command can be stored as a rule in .claude/settings.local.json. Claude Code's documentation confirms that saved approvals go into that file.

Apiiro found credentials in 1,122 public copies of the local settings file. Its broader figure of 2,539 distinct secrets includes repository history and other agent-related files. Those are different measurements. The researchers did not test every credential; one notified organization confirmed its exposed key had been live.

A local file can still reach a repository

Claude Code normally adds the local settings file to a developer's global Git excludes. That protection does not travel with a project to another machine and cannot untrack a file already committed.

Look for the copies developers did not expect

  1. 1

    Check current files and history. Search public and internal repositories for Claude Code settings files and agent transcripts. Review saved commands for embedded passwords, tokens and connection strings.

  2. 2

    Rotate exposed credentials. If a real secret was published, revoke or rotate it first. Removing a file from the latest commit does not erase forks, clones or prior history.

  3. 3

    Prevent another copy. Keep secrets out of shell command arguments when possible, add a repository-level ignore rule for local settings, and verify the file is not already tracked.

Treat agent working files as part of the secret inventory

The lesson extends beyond one assistant. Files that remember permissions, conversations and tool activity can retain sensitive values after the original source is protected. Include them in repository review and incident response.