Leak of confidential data in Git repositories accumulated by AI assistants

With the growing popularity of AI assistants, developers are increasingly experiencing the leakage of confidential data into public Git repositories, which settles among the information stored by AI tools in the project's working tree. AI assistants like Claude Code, Cursor, Continue, Aider, OpenAI Codex, Copilot, Sourcegraph Cody, and Amazon Q create local configuration files and directories in the root catalog of the project, where operation history and context data may be saved, among other things.

Files saved by AI assistants may contain API access keys, database connection strings, links to internal resources, and credentials for connecting to cloud environments, which are obtained by the AI assistant in the process of executing instructions, after working with local settings, or captured in context related to the project. For developers, the settlement of such data in the file hierarchy of the project is not obvious, so many forget to list the directories created by AI assistants in the .gitignore file and inadvertently transfer them to the public git repository after publishing changes.

To detect such leaks in public repositories on GitHub, a tool called claudleak has been prepared. A test scan of GitHub showed that among repositories with subdirectories containing AI assistant configurations, approximately 2.4% hold active keys or credentials, the validity of which was confirmed through separate verification. The tool's author encountered a problem when he noticed a file named '.claude/settings.local.json' in his repository, which contained access keys and passwords transmitted through environment variables.

Developers using AI assistants are advised to add the directories .claude/, .cursor/, .continue/, .copilot/, and .aider/ to the .gitignore file and also configure their exclusion through a global filter with the command 'git config --global core.excludesfile filename_with_list'.

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster