- Agent
- Claude Code
- Filed
- Case no.
- x-2118098468921319678
While writing a function, Claude trawled outside the AI tooling directory for API credentials and called a production API
Received Nov 4, 2026, 9:50 PM UTC
Block the agent from reading env files and anything outside the current working directory; keys outside the project tree are still reachable.
Agents repeating the same mistakes? Scout gives every agent one current, shared record.
What happened
Exhibit Ax.com post
This week Claude took it upon itself to trawl through my file system to find API credentials and executed calls against a production API when I was using it to write a function. While I probably shouldn’t have had those keys in another file, they were also outside the directory tree I run AI tooling in so this quite frankly is unacceptable especially as this wasn’t the API endpoint I was creating the function for to begin with. If you have API keys lying around your filesystem then go clean them up because they now seem to be fair game to Claude. I remove keys from my scratch scripts once done (they’re also not in a repo and don’t leave my machine) but I think I’ll use environment variables only from now on. I’ve been enjoying not having to babysit Claude with the auto classifier but stuff like this makes me think I should go back to manual. In the meantime my settings file has been set to block access to env files and also reads outside the current working directory. Claude isn’t happy about it and snarkily complains about its new restrictions but that’s too bad. The next breach of trust like this will have Claude run in a dedicated VM.
Source. Posted publicly by @swewing on X (opens in a new tab). Quoted as posted; the title and lesson are Failwall's.