Agents hold credentials, send mail, and move money. The permission the agent holds is the blast radius — so scope it before the first run, not after the first incident.
November 19, 2026 · 6 min read
Every agent deployment is, underneath the cleverness, a credential deployment. The agent needs a key to call the model, a key to read the inbox, a key to post to the channel, a key to touch the database. Each of those keys is a door, and the agent walks through all of them on your behalf, at machine speed, without getting tired or suspicious.
The question is not whether the agent can be trusted with a key. The question is what happens when the key is misused — by a bug, by a poisoned input, by a compromised tool, or by the agent confidently doing the wrong thing. The answer is decided before the first run, in how the keys were scoped.
In October, OpenCode disclosed that attackers had reached a legacy system in its hosted console, and that stored provider API keys for roughly 1.4% of Console users may have been exposed. The open-source agent itself was not breached. The hosted convenience layer was — the place where users had stored their keys so they did not have to manage them.
That distinction is the lesson. The code you run is one risk. The place your keys live is another, and it is usually the bigger one. A key stored in a hosted console, in a shared environment file, or in a chat transcript is a key that can leave through a door you were not watching. Scope is not just about what the key can do. It is about where the key can be read from, and by whom.
The rule that does the most work is also the simplest: no shared keys. Each agent gets its own credential, scoped to the one job it does, and nothing else. A support agent that reads tickets does not get a key that can delete them. A research agent that searches the web does not get a key that can send mail. A billing agent that reads invoices does not get a key that can issue refunds.
Separate keys do two things at once. They limit the damage when any single agent is compromised, and they make the audit trail honest: when a key is used, you know exactly which agent used it, for what, and when. A shared key tells you none of that. It tells you only that somebody, somewhere, used the master key.
Some actions should never be a single tool call away. Sending money, deleting data, publishing to customers, changing permissions — these deserve a second gate. That gate can be a human approval, a spending cap, an allowlist of recipients, or a dry-run that shows the effect before it happens. The form matters less than the fact that the gate exists outside the agent, where the agent cannot talk its way past it.
Allowlisting beats blocklisting here, every time. A list of the five recipients an agent may email is a control. A list of the recipients it may not email is a hope, because the sixth recipient is always the one nobody thought of. The same holds for file paths, domains, and API endpoints: name what is allowed, and deny the rest by default.
Keys that never rotate are keys that have been quietly copied somewhere. Rotation should be scheduled, automatic, and boring — and it should also happen immediately after any incident, any suspicious use, and any departure of a person or system that could have seen the key. A rotation that takes a week of manual work will be postponed until after the breach. A rotation that takes a command will happen on time.
And when a key does leak — because eventually one will — the response should be a procedure, not a panic. Revoke, rotate, check the audit trail for what that key touched, and tell the people affected. The teams that recover fastest are the ones that rehearsed this before they needed it, with keys scoped tightly enough that the answer to "what could it have done" is a short list.
None of this is glamorous work. It is the license to operate: scoped permissions, guardrails on sensitive actions, and a complete audit trail. An agent fleet without them is not a deployment. It is a set of keys walking around looking for a door.
← Back to all posts