← Back to all posts
Published on · by Renaud Deraison

The key was planted

On November 16, someone in Bucharest pointed OpenCode, a free coding agent, at a US financial firm. In 5 minutes 44 seconds it read the API documentation, followed a link only an agent would follow, found a key and tried it with curl. The key was a decoy Jesta had planted, so nothing was taken. In Bromure Agentic Coding, every key your own agent holds works the same way: a stand-in that authenticates only through your Mac, and that trips an alarm when it heads anywhere else.

"If that key had been real, it would have been in." The attacker's agent tried a planted key because it had no way to spot the fake. Your agent has the same blind spot, and Bromure puts it to work for you.

At 4:24:57 a.m. Eastern on November 16, a machine on an ordinary DIGI Romania business line in Bucharest sent a request to a system belonging to a large US financial services company. Five minutes and 44 seconds later the visitor gave up, and nothing had been stolen. The Register reported the incident on November 24, from a write-up by Jesta, a Tel Aviv security startup that counts the firm as a customer. Jesta didn't name the firm. Jesta and its customer have reported the activity to law enforcement.

The visitor was OpenCode, an open-source coding agent that developers install to write software. It drove two other tools: Chrome, and the curl that comes with every Mac. The attacker used no exploit and no vulnerability. The agent did what Jesta's CTO, Lior Finkelshtein, says it was built to do: "It read the API docs and did what they said. It found a key and used it."

Five minutes and 44 seconds

The run, as Jesta reconstructed it:

  • The agent asked for the front page of one of the firm's systems from Chrome on a Mac. Refused.
  • Six seconds later, from the same address, it tried again posing as a Pixel 10 phone. Refused.
  • It asked for the system's API definition. Refused.
  • Five seconds later it tried a different address. That one was a decoy set up by Jesta, and it answered with a readable file describing the API.
  • Thirteen seconds after that, the agent followed a link inside the document. Jesta says it was "a link that only existed inside an API doc", one no person browsing the site would have found.
  • At 4:26:01, Jesta flagged the visitor as an AI agent. From then on, everything the agent touched was a fake environment, including a phony key.
  • The agent put that key into a curl request. It ran three tests to see whether the API was real: the decoy key, no key, and a key it made up. Then it stopped.
November 16, Eastern time: OpenCode + Chrome + curl, from one address4:24:57Chrome on a Mac: refused"Pixel 10": refusedAPI definition: refusedDecoy host answerswith a readable APIdocument+13 sFollows a link thatexists only insidethe document4:26:01Flagged as an AI agent.Everything from here onis fake, key includedcurl, three ways:planted keyno keymade-up key5 min 44 sGives up.Nothing stolen. Theaddress was on no feed."It checked whether the lock was real, then made up a key of its own and tried that." (Lior Finkelshtein, Jesta)
The November 16 run as Jesta and The Register describe it. A Chrome request, a fake phone, an API document from a decoy host, a link only an agent would follow, then a planted key tried three ways with curl. The decoy key is the only reason the run ended with nothing taken.

No threat feed the customer used knew the address. "No blocklist would have helped," Finkelshtein said. What gave the visitor away was its behavior: a desktop browser, a fake phone and curl from one address within minutes, a link that only software reading the document would follow, several keys tried within seconds. OpenCode's web fetch tool also identified itself in the traffic, which is how Jesta knew an agent was at work.

The defense that worked was a key. The agent had no way to know the key was planted, so it tried it. "If that key had been real," he said, "it would have been in."

Agents can't tell a planted key from a real one

A coding agent sees a token as a string. If the string has the right prefix and length, the agent uses it. That is what made Jesta's trap work, and it holds for every agent, including the one on your laptop.

The attack needed no special software. Jesta doesn't know which model was behind it: OpenCode can talk to more than 200 model providers. The attacker's kit was a coding agent, a browser and curl, which is the kit you give your own agent every day. "The bar for doing this is now installing an app," Finkelshtein said.

If you run coding agents, ask where your real keys sit and what happens when an agent picks one up. Keys leak in two directions.

Keys going out. The Bucharest agent was hunting for a key it could use. Coding agents keep leaving keys where such hunters look. On November 22, InfoQ summarized GitGuardian's count of 31,088 secrets in .claude/settings.local.json files on public GitHub, 5,343 of them still valid when found, after Apiiro had traced the same leak to the "don't ask again" button (our write-up). Stony Brook's honeypots showed a key in a public Docker image used 7.86 seconds after it went up. An attacker with a free agent and an afternoon will find those files.

Keys going in the wrong direction. The Bucharest agent read a document and did what it said. Your agent does the same with every README, API reference and issue it reads, and it holds your keys while it does. A page written for your agent can tell it to send a key somewhere to "verify" it, the way the decoy document led the attacker's agent to its next request.

Every key in a Bromure VM is a planted key

Bromure Agentic Coding runs Claude Code, Codex, Grok, Kimi and omp in Ubuntu VMs on your Mac. It treats each of your agents the way Jesta treated the attacker's: every key the agent can read is a stand-in, and the real keys sit where it can't reach.

Each credential you configure is replaced inside the VM by a fake with the right shape. An Anthropic key is sk-ant-api03-brm-…, a GitHub token is ghp_ plus 36 characters GitHub never issued, a Docker password is brm-docker-…, and AWS gets the real access key ID with a fake 40-character secret. claude, gh, docker and the AWS SDKs accept them. The real values sit encrypted on the Mac. Every HTTPS request the VM makes goes through a proxy on the Mac, which swaps a stand-in for the real key only when the request is bound for the host that key belongs to. A key scoped to openai.com matches api.openai.com and never openai.com.evil.example. The details are in Credentials & the Wire Boundary.

The agent calls Anthropic, pushes to GitHub and deploys to AWS as before, with nothing real in its reach.

Bromure VMthe agent's whole worldANTHROPIC_API_KEY= sk-ant-api03-brm-…GH_TOKEN=ghp_…(fake)~/.aws: fake secretright prefix, right length,accepted by every tool,worthless on its ownProxy on your Macoutside the VMreal keys, encrypted,each bound to its hostscans every request fora stand-in headed to thewrong host1. To api.anthropic.comstand-in swapped for the real keyon the way out. The call works.2. To a host a document namedblocked with HTTP 451, no byte sent.VM paused. "This environment mayhave been compromised."3. Leaked: settings.local.json,a .env, an image layer, a logholds the stand-in, never the keySomeone else's agent finds it and runs curlno Mac in the path to swap it: Anthropic answers 401,AWS answers InvalidSignatureException. A decoy, by design.
One stand-in, three destinations. Bound for the host it was minted for, the proxy on the Mac swaps in the real key and the call works. Bound for a host a document named, it is blocked with HTTP 451 and the VM is paused. Committed to a public repository and tried by someone else's agent, it authenticates nowhere, which is the Bucharest outcome, by construction.

The keys hunters find are stand-ins

Whatever the agent writes from its own environment holds stand-ins: an allow rule saved by "don't ask again", a .env it generated, a Dockerfile with an ENV line, a test fixture, a debug log. When one of those ends up on public GitHub, a scanner or someone's OpenCode run finds a well-formed key and tries it, as the Bucharest agent did. A request that reaches Anthropic without passing through your Mac's proxy carries sk-ant-api03-brm-… and gets a 401. An AWS call signed with the fake secret fails with InvalidSignatureException. A GitHub token GitHub never issued opens nothing. Whoever tries it gets the result Jesta gave the attacker in Bucharest, and you didn't have to plant anything.

A stand-in headed the wrong way trips the alarm

A stand-in also works as a tripwire. A fake Anthropic key has one legitimate destination family, Anthropic's hosts. The proxy scans every outbound request, headers and body, for any stand-in going somewhere else. Say a page your agent read tells it to check its key at an endpoint the page controls, and the agent complies. The request is blocked with HTTP 451 before a byte reaches that host. The VM is paused on the spot, and an alert titled This environment may have been compromised names the credential, the host it was minted for and the host it was sent to. Shut down is the default button. Save for Investigation exports the disk and home folder before shutting down. The event is a red Credential brokering row in the Security Timeline.

Keys the agent found are blocked too

The Bucharest agent used a key it found. Your agent can find keys too: in a log, in a config file someone committed, in a document planted for it. With Only allow credentials Bromure injects turned on in Guardrails, any request carrying a credential Bromure didn't put there is blocked and raises the same compromise alert. The manual names the case: "a key the agent found in a file, copied from a log, or brought in." Organizations can require this mode on every machine.

Behavior, not blocklists

Jesta's second lesson was that the address meant nothing and the behavior gave the agent away. Bromure applies that lesson to your own agents, from outside the VM, where the agent can't interfere.

Allow-lists instead of blocklists. On a machine using the OpenShell + Sentry engine, everything is denied unless a rule allows it. The starter policy allows GitHub, npm and PyPI read-only plus Ubuntu's package mirrors, and Bromure adds the hosts your agents and credentials need. A host that appears in no threat feed is still refused if no rule names it. With Tell the agent when policy blocks it on, the agent learns the block is deliberate and is told to stop and ask you, not to look for another way round.

Every connection explained. With the kernel sentry running, each connection out of the VM has a network lineage in the Security Timeline: the prompt you gave, the agent's reasoning and stated intent, the tool call, the process chain from the agent down to curl, and the decision taken on the Mac. A connection that no tool call explains reads "Not traced to an agent's tool call." Jesta pieced the Bucharest run together from a browser, a fake phone and curl on one address. On a Bromure machine you open one Timeline row and read the whole chain.

A watchdog for the pattern. The agent watchdog scores a session as a whole: bursts of blocked requests, credentials that don't belong, new destinations after the session has settled, outbound volume far above its baseline. Several keys tried within seconds against hosts the session never used before is that pattern. In Quarantine mode the watchdog cuts the VM's network and pauses it within milliseconds, then shows you what it saw.

Stand-ins, not keys

Every credential in the VM is a well-formed fake. The real value lives encrypted on the Mac and is swapped in only for the host it belongs to.

451 and a paused VM

A stand-in headed for any other host is blocked before a byte leaves, and the VM stops while you decide.

Found keys refused

Strict credential mode blocks any credential Bromure didn't inject: a key from a file, a log or a document.

Lineage and watchdog

Each connection traces back to a prompt, a tool call and a process. A session that starts probing gets quarantined.

What to do this week

  • Search your public repositories, images and gists for .claude/settings.local.json, .env files and agent transcripts, and rotate any key you find in them. Someone else's agent may be searching them tonight.
  • If you publish API documentation, assume agents read it. Check what it links to and whether any example key in it works.
  • Look at your logs for one address that switches between a desktop browser, a mobile user agent and curl within minutes. That is the pattern Jesta caught.
  • Count the real keys sitting in your coding agents' environments today. Each one is the key the Bucharest agent was looking for.

Then move your agents onto machines where every key they hold is a planted one. Stand-ins and the compromise alert are covered in Credentials & the Wire Boundary, strict mode and the watchdog in Guardrails, and allow-list policies and network lineage in Sandbox Policy.

Related articles

The token was outside the vault

On November 25, 1Password disclosed that an attacker had used one employee's corporate GitHub account and a stolen token to copy private source code, reach its CI/CD system, and push code to backend services that downloaded customer account records. The vaults held. The credential that worked was a developer token, and developer tokens sit in plain files that every process on a laptop can read, coding agents included. In Bromure Agentic Coding, the GitHub token in the agent's machine is a stand-in, every push waits for you on the Mac, and the real token never leaves the Mac's encrypted store.

Agentic CodingNews & Analysis

The search result was the installer

AIR's WebSec Benchmark sent 4,719 ordinary coding-agent queries to eight search APIs and checked more than 282,000 results. Every API served known-malicious content, at rates between one search in 45 and one in 125, and the rates were highest for install and package searches. One top result was SolanaCry, a 286-star starter kit whose only install step pulls a remote access tool. In Bromure Agentic Coding, the agent can read whatever the search returns. The download host, the C2, the brand-new package and the injected instruction each hit a control on the Mac.

Agentic CodingNews & Analysis

The tests asked the blockchain

On November 24, SafeDep reported a 58-line Python loader planted in 375 GitHub repositories by PolinRider, a North Korea-linked campaign that Apiiro now counts in at least 7,609 repositories. In some of them it sits in conftest.py, so a plain pytest run reads an Ethereum wallet, decodes the newest transaction as JavaScript and hands it to Node.js, with every error hidden. Running the tests is the first thing a coding agent does in a new repository. In Bromure Agentic Coding, that first request to the Ethereum indexer meets a default-deny network on the Mac, the agent is told what its test run just tried, and anything that gets further finds stand-ins and a push that waits for you.

Agentic CodingNews & Analysis