Skip to content

An AI Coding Agent Leaked a Password and Exposed Customer Prompts. Here's How I Keep Claude Code on a Leash

← Back to the Blog Menu

On 21 November 2026, AI cloud company Together AI disclosed that one of its AI coding agents had committed a credential, a Hugging Face access token, into a public GitHub repository (Unite.AI, StartupHub.ai).

That one token opened a private store of customer prompt samples. It’s the kind of mistake humans have made on GitHub for years, but this time an agent made it. Here’s what happened, and the habits I use so my own agents can’t do the same.

  • The leak. The token gave access to a private repository of customer prompt samples Together kept for testing, mostly from a handful of days in June and July 2026 (Unite.AI).
  • The damage. Together’s scanning caught the commit and reverted it, but not before someone downloaded the samples and searched them for other credentials to try (StartupHub.ai).
  • The fixes. Short-lived, narrowly scoped credentials, credential checks on every pull request, zero data retention by default for new accounts, and tighter rules for its coding agents. Together hasn’t said which coding agent it was (same sources).

Separately, security firm Dragos sent nearly two million AI prompts containing unique, trackable fake secrets to AI providers and watched where they surfaced. It found evidence that data from at least three AI providers was exposed (Dragos).

After those findings, OpenRouter, a service that routes requests to many AI providers, removed three providers and pulled 125 endpoints from its zero-data-retention list, while saying the findings didn’t show a breach of OpenRouter itself (Unite.AI).

I give Claude Code full access to my local environment. Where I’m strict is what leaves it.

  • Nothing reaches git unchecked. Before each commit, the .gitignore and the file types being committed get validated, so no unwanted file is ever published.
  • New files need my approval. If a change creates a new file, I have to approve it. It’s tedious, but it keeps me in control.
  • Only the context it needs. I write my agents with only the context their job requires. If something falls outside what’s clearly defined in the CLAUDE.md, the agent has to ask me to validate it first.

And so far, no agent has ever tried to commit or expose something it shouldn’t, at least not without asking for my validation first.

If you want to set up the same kind of rules, my guide to CLAUDE.md, skills, hooks and MCP explains which tool does what, and the free CLAUDE.md Checker flags leaked secrets in your instructions file.

Does this change how close I let agents get to real data?

Section titled “Does this change how close I let agents get to real data?”

Yes, but not by cutting them off. In my data work, the agent that touches the data directly has one job: summarise, when an orchestrator agent asks it to. It’s highly limited by design.

So my answer to incidents like this is extra precautions, not refusing to connect at all.

  • This isn’t really an AI problem. People have pushed secrets to public repositories for as long as GitHub has existed. The root causes here were a long-lived token and a missed check, which a human could have caused just as easily.
  • No specific tool is to blame. Together didn’t name the agent, so this says nothing about Claude Code or any other product in particular.
  • Together handled it the way the industry asks. It caught the commit, disclosed in detail and changed its defaults.
  • Approving every new file doesn’t scale. It works for my solo projects. A big team shipping dozens of changes a day would lean on automated secret scanning and scoped tokens instead, because people start clicking “approve” without reading.

New to Claude Code and agents? Start with my Getting Started with Claude guide.