Provider API keys that 1.4% of OpenCode Console users had saved there may have been exposed. And OpenAI’s Codex CLI turned on, by default, a daemon that survives closing every window and updates itself. OpenCode said in a notice on X on October 17 that a breach the night before was related to a “large scale distillation attack.” On the Codex side, a user opened a GitHub issue on September 25 asking for the daemon to be opt-in. In this first Agent Security Note I follow both stories to see where the keys we use with coding agents actually live, and end with a checklist you can run today. I covered both briefly in one section of “A derpy chatbot or vertigo: why people talk past each other about AI”.

1.4%: keys left on someone else’s server
OpenCode is an open-source coding agent. Separate from the agent you run in a terminal or desktop app, there is a web service called OpenCode Console, where you can save API keys for outside providers such as OpenAI, Anthropic and Google. According to the notice, the people affected were a subset of Console users who had linked an outside provider, and the company emailed all of them. The email, which one user pasted on HN, said someone had gained unauthorized access to a legacy system the company was decommissioning, and that provider keys saved in a workspace may have been exposed. It asked people to revoke and replace those keys in each provider’s dashboard and to review recent usage.
The blast radius is narrower than the headline. According to the security news site The Hacker News, co-founder Dax Raad stressed that this was the OpenCode Console and not OpenCode itself. Keys you add in the terminal or desktop app are stored in a SQLite database on that machine and never reach the company. HN commenters were confused about this for a while: “Console” sounds like a terminal tool, and the notice never said what the Console was.
A lot is still unknown. As of October 21, there was nothing public on how the attacker got in, how many accounts were affected, or how the breach connects to the distillation attack the notice mentioned. Distillation means collecting a large model’s answers in bulk to train another model. On HN, people guessed the attacker used the stolen keys to run those queries. If so, the bill goes to the key’s owner. One commenter wrote that the email from OpenCode arrived alongside one from Anthropic saying they had used up their $20 of API credits for the month.
It is akin to handing your password or if you know crypto, your private key, to someone and letting them store it for you.
An HN commenter
A process that outlives the window
Nothing was breached on the Codex side. The problem is a default. In 0.156.0, released September 22, “Automatically start the background server” (daemon_auto_start) was an experimental feature you had to switch on yourself, and it was off by default. Three days later, in 0.157.0, OpenAI made it a stable feature and turned it on by default. The same day, a user opened issue #48195 asking for it to be opt-in. Here is what the issue says it does.
It keeps running after you close every window. It runs in its own session with no terminal attached and stays up until you stop it or reboot.
It makes its own 374 MB copy. It copies the whole platform package under
~/.codex/packages/app-server-daemonand runs from that copy, so its version can drift from the CLI you installed with npm.It updates itself every hour. A separate updater checks for new versions 5 minutes after start and then hourly, downloads them and restarts the backend, which can interrupt work in progress.
It holds on to the first session’s settings. It keeps the proxy variables of whichever session started it, and its outbound connections go through that proxy.
Stopping it can leave the updater behind. According to the issue,
codex app-server daemon stopstops the app server but leaves the updater running.

Run codex and the daemon starts on its own. It copies the 374 MB platform package and runs from that copy.
An updater that fetches new versions starts with it.

Close every Codex window and both the daemon and the updater keep running.
The updater fetches new versions after 5 minutes and then hourly, restarting the backend. The daemon keeps using the first session’s proxy variables.

According to the issue, daemon stop halts only the app server and leaves the updater running.
So turning it off means disabling auto-start, stopping the daemon, ending the updater separately and deleting the copied package.
HN was split. One commenter said fast-moving tools should update themselves the way browsers do; the reply was that their browser asks before updating. Another found old versions piling up to about 12 GB. One pointed out that Claude Code also leaves old versions and background tasks behind. In the issue, commenters noted that the official configuration docs don’t mention the setting and that the 0.157.0 release notes said nothing about a resident process, a package copy or hourly updates. One reported about 1.3 GB of background downloads over a few days.
On October 21 the issue was still open, with no reply from OpenAI in the thread. I opened the feature list in the public source: in 0.163.0, the latest stable release (October 15), and on the main branch, the feature is stable with default_enabled: true. The 0.163.0 configuration docs (docs/config.md) don’t contain the word daemon at all. Here is how to turn it off, collected from the issue and HN comments.
# Check the current state: name, stage and whether it is on
codex features list | grep daemon_auto_start
# Turn off auto-start (writes daemon_auto_start = false under [features] in ~/.codex/config.toml)
codex features disable daemon_auto_start
# Stop the running daemon; the updater can survive stop, so check for it separately
codex app-server daemon stop
pgrep -af 'app-server daemon pid-update-loop' && pkill -f 'app-server daemon pid-update-loop'
# Remove the copied package
rm -rf ~/.codex/packages/app-server-daemonThree places your keys live
Put the two stories side by side and you can see where the keys you use with coding agents actually live. The first place is your own machine: shell environment variables, a project’s .env, tool config files, the keychain. Agents run with your shell’s permissions, so in most setups an agent can read whatever you can. The second is the tool vendor’s server. If a web service like the Console, where you paste keys, is breached, your keys leak even though your machine is fine. The third is long-lived processes. A daemon inherits the environment of the session that started it and stays up after you close the window, still working long after you’ve forgotten what you gave it.


What to check today
Make a separate key for each tool. If one key is shared across tools, a leak anywhere means rotating it everywhere, and it’s hard to tell where it leaked. If your provider lets you set spending limits per key or per project, set them to what you actually use.
Keep a list of keys you’ve pasted into other people’s servers. You need to know which key went to which service to revoke it the moment an email like this arrives. Revoke keys left in services you no longer use.
If a key leaks: revoke, replace, review. That’s the order OpenCode’s email gave, too. Revoke the key in the provider’s dashboard, swap in a new one, update the apps that use it and check recent usage.
Look for processes left running. After closing every coding tool, check what’s still running with
ps. If something is there you didn’t want, find the setting that turns it off, and check whether that setting is documented.Keep production credentials out of the shell you launch agents from. If a production database password or a cloud admin key sits in an environment variable, the agent inherits it, and so does any daemon started from that shell.
Neither story involves a clever hacking technique. Both are closer to not knowing, or forgetting, what we had handed over and where. The next note turns the other way: instructions hidden inside text an agent reads, where no person would ever see them.