Skip to content

Bruce Hart

Latest

Jan 29, 2026 2 min read

A Word of Caution: Tools Can Leak Secrets

A quick story about a near-miss where automation leaked API keys into GitHub comment history, plus a few mental models and guardrails to avoid the same trap.

The scary part was not the leak. It was how easy it was to miss.

Automation can turn tiny slips into durable artifacts.

Yesterday I asked Codex to turn a list of items into GitHub issues. It generated a shell script and made a mistake. Part of my ~/.bashrc landed in a comment, including a Replicate API key and internal keys. It fixed the comment on its own, but the keys stayed in the comment history. I only saw them by opening the history on a specific issue. Replicate's scanner caught it and revoked the key. I rotated everything else, including this blog's keys. Total time under five minutes, no damage, but a real lesson.

Comment history is an audit log, even when you do not mean it to be

I treated the comment as a scratchpad. GitHub treated it as a permanent record with a hidden trail. That is the mismatch. When we work in tools that preserve history, the safest assumption is that every edit is forever. That means any credential exposed once is exposed for real, even if the current view looks clean.

Automation shifts failure modes, not just speed

The point of automation is leverage. The downside is that leverage multiplies mistakes too. We will trade human typos and manual slips for new classes of errors like misplaced secrets, unintended logs, and silent persistence in systems that keep history. The risk profile changes.

Secrets are radioactive, so handle them like material, not text

If a tool might touch your local config, treat it like a hot zone. Minimize the surfaces that can appear in prompts or generated output. It is safer to constrain the data than to rely on post hoc cleanup. Cleanup is useful, but it is reactive and it never reaches every copy.

Fast revocation loops are part of the product

The real save here was speed. Scanners triggered, keys were disabled, and rotation happened quickly. That is the muscle to build. If these incidents increase, the winners will be teams who can revoke and replace in minutes without drama.

I expect more of this. The systems we build will make some errors rarer and others more common. That is fine, but only if we design for it.

If you have your own story or a better set of guardrails, I want to hear it.

Read the full piece