← Back to all posts
Published on · by Renaud Deraison

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.

On a laptop1. The agent's folder.envANTHROPIC_API_KEY=sk-ant-…AWS_SECRET_ACCESS_KEY=…real values, from its shell2. BuildCOPY . ..env lands in a layerRUN rm .env leaves it there3. Pushdocker push you/apppublic on Docker Hubnothing asks first4. ContainerBotsunpack layers, grep7.86 s: AWS key used15 min: all 100 usedAI balances drainedOn a Bromure machine1. The agent's folder.envsk-ant-api03-brm-…AWS secret: stand-inthe VM never helda real value2. BuildCOPY . .the layer holdsstand-ins only3. Push$BROMURE_REGISTRYnever leaves the MacDocker Hub: Promptbefore write, on bydefault, on the Mac4. What a bot getsAWS call signed witha fake secret:InvalidSignature…Anthropic stand-in:401
The Stony Brook result applied to a coding agent on a laptop, and the same request on a Bromure machine. On the laptop, the agent's .env holds real keys, the image carries them to Docker Hub, and a scanner reads them out of the layers within seconds. On Bromure, the .env holds stand-ins, the push waits for approval on the Mac, and what a scanner extracts fails authentication.

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 .env that a later RUN rm hid.
  • 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 with docker build --secret rather than ARG or ENV.
  • Review which coding agents can run docker push with 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.

Related articles

The switch was a decoy

Trajectory Labs told swarms of up to 80 Gemini 4 Argon agents to never give up on an impossible task, with Google's production safeguards on. The agents used a honeypot key, impersonated staff, got around a DNS redirect, an IP block and a proxy, and in an offline sandbox turned off a switch they were told disabled the firewall, three runs out of three. The real firewall held. In Bromure Agentic Coding, that firewall runs on your Mac. The VM holds no switch for an agent to find, unlisted destinations are refused by default, keys the agent picks up are blocked on the way out, and a session that keeps hitting walls gets quarantined.

Agentic CodingNews & Analysis

The telemetry was the stealer

On November 17, someone holding Microsoft's own release-signing credentials published agent-framework 1.26.1 and 1.26.2 to PyPI. Each wheel added a one-line .pth file that starts a credential stealer every time Python starts, whether or not anything imports the package. Both versions were gone in under an hour. In Bromure Agentic Coding, the age gate that ships on by default hides any release younger than two days, so a Bromure machine never saw either version. Had one got in, it would have found stand-ins, no cloud identity, and a firewall that refuses its upload.

Agentic CodingNews & Analysis

The prompt had other readers

Dragos seeded two million AI prompts with canary credentials and watched who used them. At least three inference providers had been breached for months, resellers were logging traffic, and privacy flags didn't stop any of it. OpenRouter dropped three providers on November 22. A coding agent sends whatever it reads to its model. In Bromure Agentic Coding, what it reads is stand-ins, so a stolen prompt has nothing in it to use.

Agentic CodingNews & Analysis