A data breach is any event in which someone gets unauthorized access to data that an organization or person is supposed to protect. That access can mean reading, copying, changing, or using the data, and it can be deliberate, accidental, external or internal. The word covers everything from a stolen laptop to a leaked cloud key.
If you build with AI, the definition matters more this month than it did last month. On October 16 to 17, 2026, OpenCode disclosed a breach in which stored provider API keys may have been exposed, and users reported bills they did not run up. Our full OpenCode Console breach coverage walks through that case. This guide steps back and answers the general question: what counts as a breach, what types exist, and what you do about each.
TL;DR: breach basics in one table
| Question | Short answer |
|---|---|
| What is a data breach? | Unauthorized access to protected data, whether or not anything was publicly leaked |
| Breach vs incident? | An incident is any security event; a breach is when protected data was actually accessed or disclosed |
| How many main types? | Nine common ones, listed below; real attacks often chain several |
| Is a leaked API key a breach? | Yes, if an unauthorized party got it, because a key is delegated authority |
| Is ransomware a breach? | Usually yes, since most groups steal data before they encrypt it |
| First move after a breach? | Contain: revoke credentials at the source, then investigate and notify |
| Biggest AI-era change? | Credentials now belong to software that acts on its own, so one leak can mean unattended spending |
What counts as a data breach?
Three ingredients make a breach: protected data, an unauthorized party, and access. Take any one away and you have something else, such as an attempted attack or an outage.
"Protected" is broader than people assume. It includes personal information, health and payment records, source code, internal documents, and, increasingly, credentials. A password list is data. So is a cloud key, an OAuth token, or a session cookie. When the data is a credential, the breach is not only about what was read; it is about what the attacker can now do.
"Access" does not need to be a break-in. A storage bucket left open to the internet is a breach the moment someone outside your organization reads it, even if no one attacked you. Regulators in many jurisdictions treat accidental disclosure the same as theft.
Breach, incident, leak, hack: what is the difference?
People use these words loosely. A precise vocabulary helps when you write a report or talk to a provider's support team.
- Security incident: any event that threatens confidentiality, integrity or availability. Blocked phishing emails and DDoS attacks are incidents.
- Data breach: an incident where protected data was accessed or disclosed without authorization.
- Data leak: exposure without an active attacker, often through misconfiguration. Usually still a breach for legal purposes.
- Hack: an intrusion method, not a category of harm. A hack may or may not produce a breach.
- Compromise: a system or account is under attacker control. It becomes a breach once data is touched.
The OpenCode wording shows why this matters. The company called its event a "security breach" tied to a "large scale distillation attack." Distillation describes a possible motive; breach describes the harm. Keep those two separate when you read incident reports.
The nine main types of data breach
Security teams group breaches by how the attacker got in. The categories overlap, and most serious incidents use more than one. Here are the nine you will meet most often, each with a recent example where we have one.
1. Phishing and social engineering
The attacker tricks a person into handing over credentials or running malware. Email is the classic channel, but fake ads, fake installers and fake support chats now work just as well. We documented one version in fake Codex installer ads that delivered the AMOS stealer and another in a fake Claude app that carried RevStealer malware. Developers are a favorite target because their machines hold keys.
Defense: hardware security keys, install software only from the vendor's own site, and treat urgency in any message as a red flag.
2. Stolen or leaked credentials
Passwords, tokens and API keys obtained from an earlier breach, a paste site, a public repository, or a log file. This type is the quiet engine behind many others. A key committed to a public repo can be scraped within minutes by automated bots.
Defense: secret scanning in your repositories, short-lived tokens, and per-project keys that are cheap to revoke.
3. Credential stuffing and brute force
Attackers take username and password pairs from one breach and try them on other sites, betting that people reuse passwords. No vulnerability is needed, only volume.
Defense: unique passwords from a manager, multi-factor authentication, and rate limiting on login endpoints.
4. Malware and ransomware
Software that steals, spies or locks. Infostealers lift saved passwords and session cookies. Ransomware encrypts files and demands payment. Most ransomware crews now run double extortion, stealing data first and threatening to publish it, so a ransomware event is normally also a data breach. Our report on the FBI arrest of a ransomware negotiator shows how tangled that ecosystem has become.
Defense: offline, tested backups, endpoint detection, and network segmentation so one infected laptop cannot reach everything.
5. Misconfiguration
Dependency audit of a project, a defense against data breach through misconfiguration and exposed components
A database, bucket, dashboard or admin panel exposed to the internet by mistake. No attacker skill is required; the data is simply reachable. Cloud defaults, forgotten test environments and over-broad permissions cause most of these.
Defense: infrastructure-as-code reviews, continuous configuration scanning, and deny-by-default access policies.
6. Insider threat
A current or former employee, contractor or partner misuses legitimate access, either maliciously or by accident. Accidental cases are far more common: the wrong email recipient, a file shared publicly, a laptop left in a taxi.
Defense: least privilege, access reviews when roles change, and prompt offboarding that includes revoking keys.
7. Supply chain compromise
A chain link in a software supply chain, illustrating a data breach through a trusted dependency
The attacker goes after something you trust: a dependency, a build tool, a vendor, a plugin. You are breached through someone else's weakness. Our coverage of the TeamPCP open-source supply chain arrest shows how far a poisoned package can travel.
Defense: pinned and reviewed dependencies, software bills of materials, and asking vendors where they store your credentials.
8. Physical loss or theft
A lost phone, a stolen laptop, a discarded drive. Unglamorous and still common. Full-disk encryption turns most of these into non-events.
Defense: device encryption, remote wipe, and not keeping long-lived secrets on laptops.
9. Exposed secrets and third-party key stores
This one deserves its own entry in the AI era. Services that hold your API keys on your behalf, such as hosted consoles, proxies, gateways and agent platforms, are concentrated targets. One intrusion yields many users' billing authority at once. That is the pattern in the OpenCode Console case: according to the company, the affected group was Console users who had external providers linked.
Defense: keep keys in your own secret manager, give hosted tools the narrowest key you can, and set provider-side spending limits. See the free Claude Code proxy risk analysis for how third-party routing changes who can see your prompts and keys.
Why API keys changed what a breach costs
Old breaches leaked records. The harm was identity theft and embarrassment, and it usually arrived slowly. A leaked LLM API key is different because it is live spending power.
An attacker with a frontier-model key can run large volumes of requests immediately and bill them to you. They might do it to resell access, to run abusive workloads, or to harvest model outputs at scale. Users in the OpenCode incident reported unexpected charges on OpenAI and Anthropic accounts within hours, and Anthropic-affiliated staff said on X that affected Claude keys were being revoked.
Three features make this harm unusually fast:
- No human gate. An API call needs no approval, no second factor, and no delivery address.
- Machine speed. Automated clients burn through a budget in hours, not weeks.
- Low attribution. Requests look like ordinary traffic from an ordinary key, so spotting abuse needs per-key monitoring.
The practical response is blast-radius control: one key per project, a hard monthly cap on each, and alerts at a fraction of that cap. A stolen key with a 50-dollar ceiling is an annoyance; one with no ceiling is a crisis.
How AI agents add new breach paths
Agents change the picture in two ways. First, they hold credentials and act on them without waiting for you. Second, they read untrusted content, which opens routes that classic software does not have.
- Over-permissioned tools. An agent given a broad token can do broad damage if it is hijacked or simply wrong. We saw the consequence of loose permissions in the Claude Code rm -rf incident.
- Prompt injection. Text inside a web page, email or file can instruct the agent to leak data or call tools. The attacker never touches your network.
- Credential sprawl. Every agent, plugin and MCP server that holds a key is another place the key can leak. Our MCP guide explains why each connection deserves a least-privilege review.
- Weak frontier-lab security habits. Commentary like this analysis of labs skipping security basics argues the bigger risk is ordinary hygiene, not rogue models.
This is the problem AgentBeam was built for. It is the agent security platform from the explainx.ai team, and it stops AI agents before they take dangerous actions, which limits what a compromised agent or a leaked credential can actually do. Our Beam CLI security skills guide shows how to start with agent guardrails in a terminal workflow.
Breach lifecycle: what happens and when
Knowing the usual shape of a breach helps you act at the right moment.
| Stage | What happens | What you should do |
|---|---|---|
| Initial access | Phishing, stolen key, exposed service, or vendor compromise | Reduce the surface: MFA, scoped keys, patching |
| Foothold | Attacker keeps access and explores | Alert on new logins, new devices, new regions |
| Collection | Data or credentials are copied | Log and rate-limit bulk reads and exports |
| Exploitation | Keys spent, data sold, files encrypted | Hard spending caps, offline backups |
| Discovery | You or a provider notice odd activity | Fast triage, evidence capture |
| Disclosure | Company tells users and sometimes regulators | Verify notices at the source before acting |
The gap between collection and discovery is where most damage happens. Breaches commonly go unnoticed for days or weeks, which is why monitoring and caps matter more than perfect prevention.
What to do in the first hour
Whatever the type, the first hour follows one order. Contain, preserve, scope, then communicate.
- Contain. Revoke exposed credentials at the issuing provider, not only inside the tool that held them. Deleting a key in a console does not stop someone who already copied it. Reset passwords and sign out other sessions.
- Preserve. Export logs, usage pages and emails before anything rotates out. You will need timestamps for disputes and, if required, for regulators.
- Scope. Decide what the exposed credential could reach. List the services, data and budgets tied to it. Look back to the earliest plausible date.
- Limit. Add spending caps, IP allowlists and alerts so a second leak is bounded.
- Verify notices. Breach emails are common phishing bait. Open each provider's dashboard by typing the address, not by clicking a link in the message.
- Communicate. Tell affected users and, where the law requires, regulators and card networks. Be specific about what is known and what is not.
- Review. Once stable, write down how it happened and which control would have caught it earlier.
Individuals can use a trimmed version: change the password, enable a hardware key or authenticator, check account activity, and freeze credit if identity data was exposed.
What people are asking about breaches
Is every ransomware attack also a data breach?
Usually, yes. Most groups exfiltrate data first to pressure victims, so you should assume data was copied unless forensics prove otherwise. Treat encryption as the loud part of a quieter theft.
Does it count as a breach if the data was encrypted?
It depends. If the attacker got encrypted data but not the keys, many laws treat the event as lower risk or non-notifiable. If they also got the keys, the encryption protects nothing.
How do I know if my API key was used by someone else?
Check per-key usage in the provider dashboard for unfamiliar models, large token counts, odd hours and unfamiliar regions. Issue a replacement key with a new name, then watch for traffic on the old one.
Can I get money back for fraudulent API charges?
Sometimes. Providers decide case by case, and policies differ. File a billing dispute quickly, with usage exports and the timeline. In the OpenCode case we found no public refund commitment from any provider.
What is the difference between a breach and a vulnerability?
A vulnerability is a weakness. A breach is what happens when someone uses it, or when data is exposed without any exploit at all. You can have many vulnerabilities and no breach, and a serious breach with none.
Are open-source tools less safe than closed ones?
Not by that fact alone. The OpenCode agent runs locally; the reported weak point was a hosted Console system. The safer question is where your secrets live and who can reach them, which applies to any tool.
Quick prevention checklist
- Use a password manager and hardware-backed MFA on every account that matters.
- Keep one scoped API key per project, each with a provider-side spending cap.
- Store secrets in a manager and inject them at run time instead of pasting them into hosted dashboards.
- Scan repositories and logs for secrets, and rotate on a schedule.
- Review third-party vendors for where they keep your credentials.
- Run agents with least-privilege tokens and add an action guard such as AgentBeam between the agent and dangerous operations.
- Practice the first-hour plan once, so the real day is not the first time.
Bottom line
A data breach is unauthorized access to protected data, and the nine types differ mostly in how the attacker gets in. The AI era does not invent new categories so much as raise the stakes of an old one: leaked credentials now carry spending power and run at machine speed. The defense is dull and effective. Scope every key, cap every budget, verify every notice, and keep agents on a short leash.
Related reading
- OpenCode Console breach: stored provider keys and what to do
- Fake Codex installer ads and the AMOS stealer
- Fake Claude app and RevStealer malware
- TeamPCP open-source supply chain arrest
- FBI arrests a ransomware negotiator
- Claude Code rm -rf incident and sandbox guide
- Beam CLI open-source agent security skills guide
- What is MCP: Model Context Protocol guide
- AgentBeam: agent security platform
Details are accurate as of October 18, 2026. Incident facts, especially for the OpenCode case, may change as more is published.
