The image carried the key
At CCS this week, Stony Brook researchers reported what happens to credentials left in public container images. They published 300 honeypot images on eight registries. The first planted AWS key was used 7.86 seconds after its image went up on Docker Hub, and all 100 were used within 15 minutes. The planted OpenAI and Anthropic keys were drained. In Bromure Agentic Coding, the keys a coding agent can copy into a Dockerfile or a .env file are stand-ins, a push to Docker Hub waits for your approval, and Bromure gives agents a registry that never leaves your Mac.

7.86 seconds. That is how long one AWS key lasted on Docker Hub before someone used it.
At the ACM Conference on Computer and Communications Security this week, Billy Tsouvalas and Nick Nikiforakis of Stony Brook University presented a study of what happens to secrets left in public container images. BleepingComputer reported it on November 17, and SC Media and Dataconomy followed. The project page is containerbots.github.io.
The setup was simple. Over four months, the researchers published 300 images across eight public registries. Each one held planted credentials: AWS keys, OpenAI and Anthropic API keys, and decoy SSH and database logins. Then they watched who used them.
The numbers
- The images were pulled more than 75,000 times.
- The planted AWS keys received over 140,000 API calls from about 5,000 IP addresses.
- The fastest use of an AWS key came 7.86 seconds after its image went up on Docker Hub. The median time to the first API call was 51.19 seconds.
- All 100 AWS keys had been used within 15 minutes.
- The planted OpenAI and Anthropic keys were taken and used to drain the test accounts' balances.
- Docker Hub accounted for nearly all the AWS activity. Harbor saw some as well.
The callers went from checking whether a key worked to listing resources and, sometimes, spending them. The researchers call the scanners "ContainerBots" and stress that the name is a convenience: they found no sign that one operator ran them all.
Nobody ran the containers
The researchers had wired the images to report when someone built one, ran one or opened a shell in it. Few of those alarms went off. In their words, the scanners "overwhelmingly do so through static analysis, e.g., unpacking image layers or querying the registry API to extract filesystem contents, without ever instantiating the container."
A container image is a stack of tar archives. Anything that was in the
build context when COPY . . ran is in a layer: a .env file, a
~/.aws/credentials copied in for a build step, a config file with a
token in it. An ENV line in the Dockerfile is in the image config,
readable by anyone who pulls it. A RUN rm .env in a later step hides
the file from the running container but leaves it in the earlier layer.
A bot doesn't need to start anything. It downloads the layers, unpacks
them and greps.
Docker Hub also publishes a feed of new and updated images, so the bots
don't need to search. They watch the feed. That is how a key goes from
docker push to a live AWS API call in under eight seconds.
The researchers told Docker in May. They got an acknowledgment and no follow-up, and a smaller test in August found nothing had changed. Their suggestions are a secret scan before an image goes public, a warning to the publisher, and rate limits on the new-image feed.
Coding agents push images
"Containerize this and push it to Docker Hub" is a routine request for
a coding agent. The agent writes the Dockerfile, runs docker build
and runs docker push, and nobody reviews the layers. It builds from
the project folder it has been working in, which often holds
a .env with the keys the app needs to run. The agent put many of them
there itself, from the environment variables in its own shell.
A .dockerignore protects only the files someone remembered to list.
Pre-commit secret scanning looks at git, and the image never goes
through git. Revoking the key afterwards is the right move, but by the
time anyone notices, the bots have had it for minutes.
The same request in Bromure Agentic Coding
Bromure Agentic Coding runs Claude Code, Codex, Grok, Kimi and omp in Ubuntu VMs on your Mac, one VM per machine. Every connection a machine makes goes through a proxy on the Mac, outside the agent's reach. Credentials, write policies and the record of what happened all live in that proxy.
Say you ask an agent on a Bromure machine to containerize a service that calls Claude and reads from S3, then push the image.
The keys in the image are stand-ins
The agent writes a .env the way it would anywhere, from its own
environment. On a Bromure machine that environment holds stand-ins.
ANTHROPIC_API_KEY is sk-ant-api03-brm-…, OPENAI_API_KEY is
sk-brm-…, GH_TOKEN is a ghp_ token GitHub never issued, and
~/.docker/config.json holds a brm-docker-… password. AWS gets a
credential_process helper that hands out the real access key ID with a
fake 40-character secret. The real values sit encrypted on the Mac, and
the proxy swaps each one in only on requests bound for the host it
belongs to. The VM never holds them, so the agent has nothing real to
copy into the build context, an ENV line or a layer.
The service still works while the agent develops it. Requests from the
VM to api.anthropic.com carry the stand-in out of the VM, and the
proxy puts the real key on them on the way to Anthropic. AWS requests
signed with the fake secret are re-signed on the Mac with the real one.
A bot that unpacks the image gets those stand-ins. An AWS call signed
with the fake secret reaches AWS with no Mac in between to re-sign it, and fails with InvalidSignatureException. The Anthropic
and OpenAI stand-ins come back 401. The researchers' scanners went from
publish to API call in under a minute. Against this image they would
have gone from publish to an authentication error, and the balance
stays where it was.
The push waits for you
New Bromure machines start with the Prompt before write policy on every service, container registries included, and Docker Hub is covered whether or not you configured a login for it. Pulls go through. A push stops on the Mac with an Allow write on … from workspace …? dialog naming the registry and showing the HTTP method and path of the upload, so you see which repository the agent is about to publish to.
You choose Allow once, Allow for 15 minutes, Allow for the
rest of the session or Don't allow. Refused, the agent gets an
ordinary registry DENIED error ending "blocked by Bromure Guardrails",
and the Security Timeline gets a red Guardrails row with the method
and path. On a machine that should never publish images, set the
registry policy to Read-only and pushes are refused without a
question.
The dialog comes up before the first layer goes out, so you decide whether the image should be public while the keys in it are still yours alone.
Most images don't need to leave the Mac
Most of the time an agent pushes an image so a cluster can run it.
Bromure gives that push a destination of its own. Workspaces › Infrastructure › Create Registry… starts a
private Docker registry in a small VM on the Mac. The sheet describes
it: "Plain HTTP on the VM network; it never leaves this Mac." Machines
with push access trust it already and find its address in
$BROMURE_REGISTRY:
docker build -t $BROMURE_REGISTRY/myapp:dev .
docker push $BROMURE_REGISTRY/myapp:dev
kubectl run myapp --image=$BROMURE_REGISTRY/myapp:dev
Every Bromure Kubernetes cluster is set up to pull from it. Agents
learn about it through the bromure-infrastructure MCP server, whose
infrastructure_overview tool gives the registry's address and the
commands to push. So an agent asked to "build it and run it" has a
registry within reach that no feed publishes and no bot can list.
If a real key did get in
Sometimes someone pastes a real key into a session by hand. Two
safeguards still apply. Real-looking secrets in outbound Bearer or
x-api-key headers that the proxy didn't put there show up as leak
warnings in the Trace Inspector and in bromure-cli trace leaks, so you
learn a real secret is loose in the VM. With Only allow credentials
Bromure injects turned on in Guardrails, a request carrying a key
Bromure didn't put there is blocked outright and raises the compromise
alert. And the push still stops at the dialog.
Stand-ins in every layer
Environment variables, .env files, docker and git config in the VM all hold fakes. Whatever the agent copies into an image fails authentication everywhere except through your Mac.
Push waits on the Mac
Prompt before write is the default for container registries on new machines, Docker Hub included. You see the repository before the first layer leaves.
A registry that stays home
The Bromure registry runs in a VM on your Mac, feeds every Bromure cluster, and is never published anywhere a ContainerBot can watch.
Refusals on record
Refused pushes are red Guardrails rows with method and path. Real keys seen on the wire show up as leak warnings in the Trace Inspector.
What to do this week
- List the public images your team and your CI have pushed, and scan
every layer and the image config for secrets. A scanner that reads
each layer on its own finds the
.envthat a laterRUN rmhid. - Rotate any key you find, whether or not the logs show it was used. The study's median time to first use was under a minute.
- Add
.env,*.pem,.aws/and.git/to every.dockerignore, and pass build-time secrets withdocker build --secretrather thanARGorENV. - Review which coding agents can run
docker pushwith a logged-in Docker Hub account, and to which namespaces. - Check your Anthropic and OpenAI usage pages for spend you can't explain.
Then give your agents machines where every key they can see is a stand-in and a push to Docker Hub stops on your Mac first. Stand-ins are covered in Credentials & the Wire Boundary, write policies in Guardrails, and the Mac-local registry in Kubernetes Clusters & Registries.


