cd /news/ai-agents/deleting-a-secret-from-your-docker-i… · home topics ai-agents article
[ARTICLE · art-130947] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=· neutral

Deleting a secret from your Docker image doesn't delete it from your build history

An autonomous hacking agent discovered a live GitHub admin token in Baseten's infrastructure by pulling a public Docker image and reading its build history, according to a writeup by Strix. The token, dating from March 2023, still retained repo scope and admin access to internal repositories in July 2026 because Docker preserves expanded secrets in the image config's history[].created_by field rather than in filesystem layers. Strix and Baseten reportedly handled the disclosure quickly, and the incident highlights that credentials passed through RUN or ARG commands persist in image metadata unless the image is rebuilt from a clean base.

by read1 min views1 publishedSep 16, 2026

An autonomous hacking agent found a live GitHub admin token in Baseten's infrastructure by pulling a public Docker image and reading its build history. The token was from March 2023, still had repo scope and admin on internal repos in July 2026. The writeup is a good read on its own, but the mechanism it exposes is the part worth internalizing.

The token wasn't in the filesystem layers. It was in the image config: a RUN command had expanded GITHUB_TOKEN directly into history[].created_by. Docker keeps a record of every build step that produced each layer, and that record is downloaded right alongside the image blobs. You can scrub the secret out of the layers, rebuild, even rotate it in the layer — the old build history object still contains the plaintext.

That gap matters for a specific reason. Most cleanup playbooks operate on files: unset the env var, scrub the .env, delete the config. But the threat surface here is metadata, not bytes. A credential that was ever passed through a RUN or ARG on a build machine is effectively immortal in that image's history unless you rebuild from a clean base and never inject it in the first place.

Three things worth doing:

Strix and Baseten handled this well and fast. Worth blocking out 20 minutes to read the play-by-play, because the lesson is cheap now and expensive when it's your build pipeline.

── more in #ai-agents 4 stories · sorted by recency
── more on @baseten 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/deleting-a-secret-fr…] indexed:0 read:1min 2026-09-16 ·