"Claude Code's 'Don't Ask Again' feature unintentionally scraped 1,122 public GitHub files and exposed passwords."
Yesterday, a Hacker News post revealed that Claude Code, Anthropic's code‑completion model, leaked credentials from over a thousand public repositories. The root cause? A seemingly innocuous "don't ask again" prompt that cached user input and then resurfaced it in unrelated completions. While the raw number (1,122 files) may sound modest, the underlying risk is anything but. It proves that AI assistants can become inadvertent secret‑leak vectors, a problem that will only grow as more developers embed AI into their daily workflow.
Why This Matters Right Now
AI assistants are moving from novelty to default – Tools like GitHub Copilot, Claude Code, and the newly announced LiveReview are being adopted by thousands of engineers daily. The frictionless experience encourages frequent use, increasing the attack surface.GitHub just rolled out a new Pull Request overview page – The feature aims to surface review comments, CI results, and code changes in a single view. While it improves productivity, it also centralises more context that AI tools can ingest.Secret‑scanning tools lag behind AI capabilities – Traditional regex‑based scanners miss patterns that AI models might generate or transform, especially when prompts manipulate the model's memory.A Deeper Look at the Failure Mode
The "don't ask again" prompt is essentially a short‑term cache. When a user typed a secret (e.g., an API key) to bypass the default screenshot tool, Claude Code stored that string in its session memory. Later, when another user asked the model to generate code for a similar task, the cached secret resurfaced as a suggestion. This is a classic example of
context leakage – the model fails to isolate user sessions.
How It Differs From Classic Secret Leaks
| Aspect | Traditional Leak | AI‑Assisted Leak |
|---|
| Source | Hard‑coded credentials, config files, or accidental commits | Prompt caching, model memory, or generated suggestions |
| Detection | GitHub secret scanning, trufflehog, git‑secrets | Rarely covered by static scanners; requires runtime monitoring |
| Scope | Usually limited to a single repo | Can span multiple users, projects, and even cloud services |
| Fix | Remove secret, rotate keys | Re‑engineer model isolation, add prompt sanitisation |
The Broader Trend: AI as a Double‑Edged Sword
Productivity Gains
Speed: Developers report up to 30% faster boilerplate creation.Quality: AI‑powered reviews (e.g., LiveReview) can catch style violations and suggest improvements.Accessibility: Newcomers can ask natural‑language questions and get instant code snippets.Security Risks
Secret Propagation: As shown, prompts can unintentionally store and replay secrets.Model Hallucination: AI may generate plausible‑looking but insecure code (e.g., disabling TLS verification).Supply‑Chain Exposure: If a compromised model suggests vulnerable dependencies, downstream projects inherit the risk.What Developers Can Do Today
Treat AI suggestions as untrusted – Always review generated code before merging. Use the new GitHub PR overview to see who suggested what.Never type secrets into AI prompts – Store keys in environment variables or secret managers; never paste them into a chat window.Enable GitHub's secret scanning – It now flags newly added secrets in pull requests, even in diff views.Adopt session isolation – Choose AI services that guarantee per‑user sandboxing. Look for providers that advertise "no‑memory" or "ephemeral" modes.Audit AI usage policies – Companies should define clear guidelines for when and how AI assistants can be used in production code.GitHub, Anthropic, and other platform owners must step up. Here are three concrete actions they should take:
Real‑time secret redaction: Intercept prompts containing patterns that match known secret formats and either mask them or reject the request.Transparent model logging: Provide developers with logs that show when a suggestion was influenced by prior user input.Dedicated security audits: Release regular reports on how AI features handle sensitive data, similar to SOC‑2 compliance.Looking Ahead: Will AI Assistants Ever Be Safe?
The answer is nuanced. AI will remain a powerful productivity lever, but safety cannot be an afterthought. Expect a wave of
AI‑aware security tooling in the next 12‑18 months:
Prompt‑sanitisation libraries that strip secrets before sending data to an LLM.Zero‑knowledge inference services that run models locally, eliminating network‑based leakage.Policy‑driven AI orchestration platforms that enforce company‑wide rules (e.g., "no secret generation").If the community embraces these safeguards, the net benefit of AI coding assistants will far outweigh the occasional slip‑up. Until then, every "don't ask again" button should be treated as a potential backdoor.
Bottom Line
Claude Code's mishap is not an isolated bug; it's a symptom of a larger, systemic issue. As AI becomes embedded in the software development lifecycle, security must evolve in lockstep. Developers should adopt a healthy skepticism, leverage GitHub's new PR overview for better visibility, and push platform providers toward robust secret‑handling guarantees. The future of coding is AI‑augmented, but the future of secure coding is AI‑aware.