# "OpenCode hack is INSANE." <!-- ref: @content/youtube/david-ondrej/opencode-hack-is-insane tags: [OpenCode breach, distillation attacks, API key theft, AI-assisted hacking, agent loops, automated security scanning, software factory] version: 2 updated_at: 2026-11-22T12:09:51.465Z --> **[Watch on YouTube](https://www.youtube.com/watch?v=YaK6cnET2IE)** # OpenCode hack is INSANE. *Synthesized from David Ondrej, 2026-10-18.* David Ondrej presents a solo video on a reported breach of the OpenCode coding tool and on how he automates security scanning. The transcript is a rough machine translation, so model names and figures are uncertain, and he builds the agent platform he demonstrates. ## Core Thesis David argues that the OpenCode incident, which he describes as a mass distillation attack using stolen user API keys, shows that ordinary users are now targets of AI-assisted attacks. Since attackers use agents, defenders must run security agents continuously and automatically rather than checking once. ## Key Insights - **The incident as David tells it.** OpenCode's official account said a system breach tied to a large-scale distillation attack affected 1.4% of its console users. An outdated system scheduled for shutdown was compromised; stolen API keys included OpenAI, Anthropic and Google. Users reported surprise charges of $168, $200 and $300, and one lost $1,700. He says evidence points to Chinese attackers because of Chinese-language queries on the stolen keys, but this is his inference. - **What distillation is.** Training a smaller model on a larger model's outputs against terms of service. Previously labs were targeted, for example Anthropic's report that DeepSeek, Moonshot and Minimax used over 24,000 fake accounts. David thinks stronger lab defenses (behavioral fingerprinting, plus agencies he lists as NSA, CISA and FBI) pushed attackers toward softer consumer targets. - **Anthropic's defenses.** He shows a chart in which an average of 8,800 times the quietest day (September 19) dropped to 135 after new protections, with a worst day at 56,000 times, on a logarithmic scale. - **Wider distillation.** He argues that all models are slowly distilled because AI-written text feeds later training data. He also says a new DeepSeek model often claimed to be ChatGPT when asked (about 26 of 30 tries in someone's test), suggesting it was distilled from a GPT model. - **Threat data.** He cites a16z charts showing rising high and critical vulnerabilities from the first or second quarter, and almost 90% of exploited CVEs being exploited on or before the day of disclosure. - **Defense pattern.** Run automated cloud agent loops: a system-health check every 15 minutes, a dependency check hourly (he later considers every 4 hours versus 1), a general security scan every 2 hours, a side-effects check on the last 24 to 48 hours of changes, and a user-feedback loop. Dependencies matter because compromised packages arrive via normal updates. - **Segment the codebase.** One loop over the whole repo lets a model fixate on favourite areas. Running a loop twice a day puts you ahead of most people, in his view; splitting the code into around nine segments with tuned models and frequencies goes further. Use the strongest model on critical segments and run less important ones less often. - **Prompt.** Ask the model for the top five cybersecurity vulnerabilities in the project, then build a loop for each. - **Isolation.** Each cloud agent thread runs in its own Linux sandbox; he says local worktrees compete for CPU, GPU and RAM and can eat 100 to 200 GB of disk. ## Actionable Takeaways 1. If you used OpenCode with your own API keys, check your email for the notice and rotate keys from OpenAI, Anthropic and Google. 2. Ask a model for your top five exploitable weaknesses, then schedule an unattended agent loop for each. 3. Add dependency checks on a short interval because supply-chain compromises arrive through updates. 4. Segment the codebase and give each segment its own model and schedule. 5. Treat agent security work as continuous, with a human reviewing results, tuning access and trimming over-sensitive findings. 6. Let an agent attack a sandboxed copy of your app, not the live site. ## Notable Quotes > "You need to break yourself before someone else does." — David Ondrej > "If someone is using uncontrolled, open- source AI models to attack you, you should also be using AI to defend yourself" — David Ondrej --- *Related: `@content/youtube/zazencodes/build-your-own-ai-software-factory-with-claude-code` · `@content/youtube/yifan-bth/i-reverse-engineered-claude-code-learn-these-agent-tricks` · `@content/youtube/cole-medin/ai-makes-us-way-faster-but-fries-our-focus-heres-what-i-do-about-it` · `@content/youtube/cole-medin/gpt-6-astra-just-made-ai-software-factories-real-here-s-how-to-run-one` · `@content/youtube/cole-medin/my-ai-software-factory-ships-hundreds-of-prs-a-week-heres-how-i-manage-it`* --- *You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).* *Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*