01What the breach report actually establishes
On 17 October 2026, OpenCode said a security breach associated with what it called a “large scale distillation attack” affected 1.4% of OpenCode Console users. It said those users had external model providers connected and had been emailed. The public statement does not identify the entry point, the number of exposed keys, a confirmed extraction mechanism or how the distillation activity relates to the breach. Read OpenCode’s statement.
Reporting on the customer notification says an unauthorized party accessed a legacy Console system being retired and that provider keys stored in affected workspaces may have been exposed. That wording supports urgent rotation; it does not prove that every key was copied or used. Cyera’s incident summary and the notification analysis describe the same scope.
| Statement | Evidence level | Operational reading |
|---|---|---|
| 1.4% of Console users with external providers were affected. | OpenCode’s public statement | A percentage of Console users, not all OpenCode installs or a count of keys. |
| Provider keys in affected workspaces may have been exposed through legacy-system access. | Customer notification as reported by recipients and researchers | Treat named keys as potentially compromised; preserve the exact notice for scoping. |
| Every affected key was extracted and used for model distillation. | Unconfirmed | Do not publish this as a proven attack chain. |
| MCP caused the breach, or local CLI credentials were stolen. | Unsubstantiated | Keep the optional tool plane and local storage separate from the hosted Console incident. |
02What OpenCode is, and why “agentic” matters
OpenCode is an open-source coding assistant available through terminal, desktop and IDE experiences. A coding agent accepts a goal, asks a model to propose next steps, supplies context, and may call tools to read files, edit code, run commands or query services. The model’s text is a proposal; an operation occurs only when OpenCode’s runtime passes that proposal through its permission and execution path. OpenCode documents built-in agents, tools and per-tool permissions. Agent documentation · tool documentation.
“Agentic” describes that iterative decide–tool–observe loop. It does not mean the model has its own operating-system identity or that it autonomously bypasses authorization. The relevant security questions are which tool is reachable, which process executes it, whose credentials it carries and what policy checked the call.
Does OpenCode use MCP?
Yes, it supports MCP, but an MCP server is optional. OpenCode can register local or remote MCP servers and expose their tools beside built-in tools. A particular installation uses MCP only if its configuration enables a server or a hosted integration supplies one. The current Console credential incident has not been attributed to MCP. OpenCode MCP documentation describes the transports and tool configuration.
MCP expands the trust boundary: a tool server can supply tool descriptions and accept structured arguments, while the executing service has its own identity and permissions. An agent policy such as ask for a matching MCP tool is a useful control, but the server must still authorize the caller and protect downstream credentials. Do not infer that a prompt, tool description or model output has authority simply because it appears in an agent trace.
03OpenCode’s layered architecture and credential boundaries
The diagram below combines documented product interfaces. It is an architectural model for investigation, not a reconstruction of the undisclosed legacy system. Select a layer to read its trust boundary. The two credential routes remain separate.
Two documented paths. Select a node for its security boundary. The legacy incident system is unplaced because its topology has not been published.
Local agent execution plane
01 · Human and interfaceTerminal · desktop · IDE
The user’s request enters a local OpenCode session. The UI is not the process identity used by a provider or tool service.
02 · Agent loopContext → model proposal
OpenCode selects a provider/model, submits context and receives proposed output or a tool call. Model text has no independent OS authority.
03 · Execution boundaryPermission gate → built-in tools or optional MCP
The runtime interprets a tool request. Configured permissions may allow, deny or ask. A remote MCP server applies its own identity and authorization.
04 · Local credential pathClient credential → provider API
A directly configured key is held by the local client path described in the provider docs. Its exact location depends on release and setup.
Hosted Console provider plane
A · Workspace identityMember or administrator → Console
Workspace membership and provider administration define who may connect and use hosted models.
B · Secret custodyConsole stores provider credential
Official Console documentation says a connected provider’s key is stored by Console, while members use its models without seeing the raw key.
C · Provider authorizationGateway → external model API
Console’s gateway supplies the workspace credential to the provider. Provider side authorization and billing occur at this boundary.
Reported unauthorized access to a system being retired. Public material does not locate it within the current service graph or establish which keys it could read.
Text path: local request → agent/model → permission gate → built-in or optional MCP tool; separately, Console workspace → stored provider connection → gateway → provider API. The legacy system’s precise connection is unknown.
Two different places to keep provider credentials
OpenCode’s documented local /connect flow stores provider credentials in a local application data file for the client release described in its provider guide. The Console’s provider guide describes a separate hosted path: workspace administrators connect providers, Console retains credentials and a gateway forwards member requests without revealing raw provider keys to members. Version, deployment and integration determine which path applies.
The trust boundary shifts when a provider key enters hosted infrastructure. A compromised endpoint may threaten local credentials; unauthorized access to a Console component may threaten keys reachable there. The public record does not show where the legacy system sat in the current gateway topology, what it could read, or how it was entered. Console’s Providers API documentation explains gateway substitution of workspace credentials for requests.
04Protocol and context boundaries: where agentic risk actually lives
The diagram separates four documented or optional routes. It is a review model, not OpenCode’s undisclosed Console incident topology. The local coding agent, optional MCP services, repository context and hosted provider credentials have different owners and controls. A weakness in one route does not prove compromise of another.
- Human / clientTUI, desktop, IDE or a client of the local HTTP serverBoundary: session owner and server exposure
- Agent loopContext assembly → model proposal → permission decisionModel output is not a tool action
- Tool routerBuilt-in read/edit/bash tools or optional MCP toolsBoundary: tool permission and executor identity
- Effect and recordFilesystem, external service or remote MCP resultVerify actual result, not a model summary
OpenCode documents a local HTTP server, built-in tools and permissions, and optional local and remote MCP servers. The local server defaults to loopback; exposing it changes the threat model and requires explicit authentication and network review. The MCP protocol describes a connection, not automatic authorization of every downstream action.
| Boundary | Protocol or transport event | What an assessor must validate |
|---|---|---|
| Connect and authenticate | Local stdio process or remote HTTP; remote authorization may use OAuth or configured headers. | Server origin, launcher/package provenance, token issuer/audience/scope and the identity behind the connection. |
| Discover capability | tools/list exposes tool names, descriptions and schemas. | Tool descriptions are untrusted context; compare advertised capability with allowed backend operation. |
| Request execution | tools/call carries a named tool and arguments. | Log the user/task, proposal, OpenCode permission decision, server-side resource authorization and effective executor. |
| Return result | Tool result becomes model context; some operations may be asynchronous in supported extensions. | Separate returned text from durable side effects; keep result provenance and independent API/object evidence. |
MCP lifecycle and session semantics evolve by protocol version; do not assume a legacy initialize handshake or session header exists in every deployment. Pin and inspect the negotiated version. See the official specification changelog and OpenCode’s MCP configuration guide.
MCP is an optional extension, not the reported breach vector
- Tool discovery: a server supplies tool names and descriptions to the client/model. Treat those descriptions and results as lower-trust content; verify server identity and provenance.
- Tool call: OpenCode’s permission configuration governs its own tool invocation. The MCP server still needs independent authentication and authorization for the requested resource and tenant.
- Remote delegation: check issuer, audience, expiry, scope, consent, session owner and whether downstream credentials are reused. A bearer token in configuration is not a substitute for least privilege.
- Local subprocess: the configured command inherits a process environment and host access. Pin the server package, review its command and environment, and avoid unrestricted shell or credential mounts.
Incident boundary: no public evidence cited here attributes the Console key exposure to MCP, a tool description, local server access or an agent prompt. These are architectural review questions, not facts about the breach.
Retrieval and RAG: separate context integrity from access control
OpenCode can use file-reading and search tools to place repository or external content into model context. That is retrieval; it does not establish that every OpenCode installation runs a conventional vector-database RAG pipeline. If a team adds documentation search, memory or a third-party retrieval MCP server, the extra data store and its tenant filters become separate security boundaries.
- SourceRepository file, issue, web page or optional knowledge store
- RetrievalQuery, result permissions, tenant filter and document version
- ContextQuoted source text enters the model with provenance
- ProposalModel suggests an edit or tool call; source text has no authority
- GateClient permission plus server-side resource authorization
Failure mode: a poisoned document can be treated as an instruction, or a cross-tenant result can leak data before any tool call. The defense is provenance, retrieval ACLs, tenant isolation, constrained tools and independent result verification—not a prompt that merely says “ignore malicious text.”
- Test ingestion: who can write or replace a document, and is source/version provenance preserved?
- Test retrieval: can a lower-privilege session obtain another tenant’s file or stale memory item?
- Test instruction boundary: does retrieved text alter tool arguments or approval decisions beyond the user’s task?
- Test impact separately: did an authorized executor perform the proposed action, and under which identity?
05Reconstruct the incident without filling in missing edges
- 16–17 OctoberOpenCode described a breach on the previous night. No public start minute or initial access technique was supplied.
- 17 OctoberOpenCode notified affected Console users and described the affected group as 1.4% of Console users with external providers.
- Customer noticeResearchers report warning language about unauthorized access to a legacy system and provider keys that may have been exposed.
- 18 October reviewKey extraction, misuse, attacker identity, persistence and the technical link to distillation remain publicly unresolved.
This is a credential exposure incident for responders even while forensic details are incomplete. A copied provider key can remain valid after a Console password change or after removing a connection from a workspace. Revocation must occur at the provider that accepts the key. Conversely, provider usage spikes alone cannot prove that this incident caused them; correlate the key identifier, project, time, known workload and billing record.
The Console percentage does not translate into a number of installations, organizations, keys or dollars. Reported individual charges are leads for investigation, not aggregate impact. OpenCode’s local CLI, Console gateway, optional MCP servers and the legacy system are different components; do not collapse them into one compromised “agent.”
06Distillation attacks: the model, the credential and the data
Knowledge distillation normally trains a smaller “student” model to imitate a stronger “teacher” model’s responses. It is a legitimate technique when the operator has the rights to use the teacher and its output. An unauthorized extraction campaign instead collects a large response corpus from a model service and trains or evaluates another model against it. This is behavioral replication, not necessarily theft of model weights, source code or the teacher’s training data. NIST’s model-extraction taxonomy and Anthropic’s first-party analysis describe the distinction.
- Identity boundaryAccount or provider keyAuthorizes and bills requests. A stolen key changes who pays and which usage record appears.
- Model API boundaryTeacher model respondsPrompts and outputs form examples. Request volume alone does not establish the purpose.
- Data and training boundaryResponse corpus → studentA separate actor could curate examples and train or benchmark a model. This stage requires independent evidence.
Why a provider key matters
A provider API key is an authorization credential for a separate service. If copied, it may let a third party make billable requests within its scope without controlling the original developer’s OpenCode session. The key’s permissions, project boundaries, quotas and provider records determine the actual consequences. Console’s own budget applies to traffic mediated by Console; direct calls with a copied provider key can fall outside that budget. Cyera explains the response consequence.
How to distinguish extraction from heavy legitimate usage
Look for coordinated request patterns across accounts or keys, repeated task families and variations, unusually high output collection, shifts in model mix, unfamiliar client or network context, and divergence from a known workload baseline. Preserve raw provider records under privacy controls and compare them with authorized batch jobs or evaluations. None of these signals by itself proves model training. Training artifacts, actor infrastructure or corroborating provider intelligence would raise confidence. Anthropic’s October 2026 research discusses account and behavior based detection, along with false positive tradeoffs.
OpenCode has not published a technical mapping from its reported legacy-system access to a particular key, provider request or student training job. The page therefore treats distillation as the vendor’s incident characterization, not a fully demonstrated chain for this case.
07Attack path intelligence: inspect every claimed relationship
Use the controls to inspect three related but differently supported paths. A documented edge describes a product feature; a reported edge relies on the incident notice; an inferred edge is a testable hypothesis. “Disproven” requires evidence that the particular candidate path did not occur, not merely a lack of logs. Compare all paths to see why the incident should not be flattened into a single arrow.
All relationships are readable below without JavaScript.
Documented · Console credential path
- Workspace administrator CONNECTS provider account
- Console STORES provider credential
- Console gateway CALLS provider model API
Source: OpenCode Console provider documentation. Boundary: raw secret custody moves into the hosted Console. This describes a product feature, not evidence of the breach entry point.
Reported · legacy-system access and possible exposure
- Unauthorized actor ACCESSED legacy Console system (reported notification)
- Legacy system MAY HAVE EXPOSED workspace provider keys
- Specific keys EXTRACTED? Publicly unresolved
Source: reported customer notice. Required proof: system inventory, secret-read access, key identities, timestamps and exfiltration or unauthorized usage evidence. Do not mark the final edge observed.
Hypothesis · copied key to model extraction
- Copied provider key AUTHORIZES? model requests
- Responses COLLECTED? into a dataset
- Dataset TRAINS? a student model
Status: technically plausible and consistent with the term “distillation,” but not demonstrated for this incident. Required proof: provider request records linked to a compromised key, response corpus or actor infrastructure, and training or evaluation evidence. A spend spike alone supports only a usage investigation.
For a defensible incident graph, preserve the source and time of each edge: workspace → stored provider connection; legacy system → ability to read a specific secret; that key → provider requests; those responses → a corpus. The first edge is documented product design. Public evidence for the remaining edges is incomplete. Absence of evidence may reflect missing telemetry, so attach a coverage assessment before marking an edge disproven.
08Detect misuse across the Console and provider boundary
| Lead | Validate | Alternative |
|---|---|---|
| Provider usage after possible key exposure | Key/project identifier, model, time, billed volume, available origin metadata and known owner. | Authorized CI run, scheduled evaluation or another shared consumer. |
| High-volume, structurally similar model requests | Approved workload purpose, distribution across identities, prompt family and provider intelligence. | Benchmarking, batch inference or regression testing. |
| Console access to linked credentials | Admin and service identity, workspace scope, secret-read event, object identity and result. | Authorized rotation, connector validation or support workflow. |
| Missing or unexpectedly quiet logs | Retention, clock sync, audit policy, data-plane coverage and dropped events. | Logging gap; never “no misuse” by default. |
Correlate provider billing with the Console workspace and each legitimate consumer of the same credential. If a key is shared with CI or an internal service, record those consumers before rotation so outages and misleading anomalies can be explained. Console request logs describe traffic through its gateway; provider-side usage is needed to evaluate direct use of a copied key. Neither view necessarily contains the actor’s intent.
09Rotate exposed keys and close the credential path
- Identify: use the exact OpenCode notice and Console workspace inventory to enumerate linked providers and key owners. Do not paste keys into tickets or scanners.
- Revoke at each provider: disable potentially exposed keys in official provider dashboards or supported APIs. Removing the Console connection alone may leave a copied key valid.
- Replace consumers: create narrowly scoped keys or short-lived credentials where supported, update authorized CLI, CI, gateway and service consumers, and verify the retired key fails.
- Review activity: preserve provider usage and billing around the suspected window; compare with known workloads, and escalate unexplained requests to the provider and OpenCode.
- Review Console access: reset Console account credentials or sessions where indicated by the notice, inspect provider connections and access policies, and remove unused linked providers.
- Retire legacy storage deliberately: inventory credentials in backups, caches, logs and replicas; revoke any key whose copies cannot be accounted for.
Key rotation addresses the credential risk. It does not establish how the legacy system was entered or whether a model extraction operation occurred. A later incident report should update the edge labels in the attack-path diagram, not quietly rewrite an unknown into a proven fact.
Agentic execution
User → model proposal → permission decision → built-in or optional MCP tool → observed effect.
Local credentials
Documented client storage. Check release, endpoint, filesystem permissions and whether a key ever entered a hosted workspace.
Hosted Console
Workspace providers and gateway create a separate credential boundary. Legacy-system placement remains undisclosed.
Distillation
Teacher requests can form a response corpus for a student. This does not prove weight theft or establish the OpenCode incident chain.
Evidence
Record source, timestamp, key scope, provider usage and coverage for each proposed edge.
Containment
Revoke at provider, update consumers, confirm old keys fail, then resolve root cause and retention.
Incident review checklist
0 controls verified
The checklist is a local reading aid. It does not verify your provider keys or access the Console. This article was reviewed on 18 October 2026 against the cited statement, vendor documentation and incident reporting.
Related K8SEC research: Anatomy of a Modern Agentic Attack and Hermes agent trust boundaries.
The useful question is not whether the assistant is “agentic.” It is which service held a provider credential, who could read it and what the provider accepted afterward.
Follow the credential across each execution and authorization boundary, then mark every missing edge.
Riad DAHMANI — K8SEC Security Research
Map the real boundary.
Explore K8SEC research relationships, then validate each proposed incident edge with its source evidence.
Explore K8Map research