How to address security concerns about claude-code and other Ai coding agents reading files with passwords, secrets and other sensitive data
Meanwhile, my biggest concern about the usage of claude-code for now is the security threat it poses as regards reading and using sensitive data in repositories.
We can argue about whether it’s good or bad to commit sensitive information like passwords, secrets and connection strings in repos but the truth is that thousands of companies still do this, and securely too.
While using claude or any other ai coding agents, they’re able to read your files including those that contain sentive data and these information gets sent to their api. To what extent they use the data, I don’t know but I’d imagine that there’s a chance that your secret could get saved in their server, used in training or returned to other users.
For Claude code, some people suggest using the .Claudeignore file to exclude files you don’t want claude to be able to access but lots of posts confirm this doesn’t work.
Another way is the use of the settings.json file which I think kinda works based on my recent test but I’m not confident enough about it.
So what do we do?
- Refactor codebase to remove all sensitive data? What if you miss some of them?
- Avoid coding agents entirely? 🥺
- Expect agents to be smart enough to discard sensitive data and never do more than reading them the first time only? How complex would this be to achieve?
- Any other suggestions?
3 comments
Log in to join the conversationfirst thing first, never give it your personal information.
and if you want to avoid all this entirely, don't download it.
This is a serious security concern
💯👍