Case study

Spain: Endesa, and the first breach report blamed on an AI agent

An energy company's commercial platform, and a breach report where the attacker was described as an AI agent working on its own.

Editorial photo for the article

Spain produced two of the most instructive breach reports of 2026. The first, at the energy company Endesa, is a familiar story: customer data taken from a commercial web platform, and a slow public response. The second is new: a breach notification to the Spanish data protection authority in which the attacker was described as an AI agent that explored the application on its own.

This case study covers both. Facts are linked to their sources. Where we reason beyond the reporting, we label it as analysis.

What happened at Endesa

In January 2026, Endesa, one of Spain's largest electricity companies, confirmed that attackers had accessed its commercial platform. According to Xataka's reporting:

  • The data taken included customer contact details, national identity document (DNI) numbers and IBAN bank account numbers, as confirmed by the company.
  • The attacker claimed to have needed less than two and a half hours and to hold data on more than 20 million people. These claims have not been independently verified.
  • It took Endesa almost a week to acknowledge the breach publicly.

Sources: Xataka Red Seguridad, 12 January 2026

Endesa has not published technical details of the method, and no cost figure has been published.

The breach blamed on an AI agent

INCIBE-CERT, Spain's national cybersecurity incident response team, summarised a personal data breach notified to the AEPD, the Spanish data protection authority, on 14 September 2026. The notification linked the attack to an AI agent. According to INCIBE's summary, the agent:

  1. searched generic files for vulnerabilities;
  2. logged in to the application;
  3. explored the application on its own;
  4. found a flaw that let it modify personal data and access invoices.

INCIBE notes that the investigation had not yet reached definitive conclusions. The affected organisation was not named.

Source: INCIBE-CERT, Personal data breach reported in Spain linked to an attack carried out by artificial intelligence

Our analysis: this is, to our knowledge, one of the first public breach notifications in Europe where the regulator was told the attacker was an AI agent. It fits what threat-intelligence teams reported during the same year. Anthropic said most of the attacks it disrupted between December 2025 and August 2026 were run or orchestrated by AI.

Source: Anthropic, Threat Intelligence Report, September 2026

The likely attack paths

Our analysis. Neither organisation has published the technical detail, so these are the paths that best fit the reported facts, not confirmed findings.

Endesa: a commercial platform with broad data access

A "commercial platform" at a utility typically serves sales staff, partners and agencies who sign up new customers. Those users need to create contracts, which means entering ID numbers and IBANs. If the attacker's claim of under two and a half hours is accurate, it suggests they did not need to defeat many controls once inside. The common patterns are a valid partner or employee login obtained elsewhere, combined with an application or API that lets one account search or list far more customers than its role needs.

The AI-agent case: exploration as the attack

The INCIBE summary describes the same loop a human pentester runs: find a way in, log in, map what the application lets you do, then try each action in ways the developers did not intend. The flaw that allowed changing personal data and reaching invoices is consistent with broken object-level or function-level authorization, the first and fifth items on the OWASP API Top 10, or with a business-logic flaw in a multi-step flow.

The important change is economics. Exploring an application thoroughly used to cost an attacker days. An agent does it continuously and in parallel against many targets, as we describe in AI agents now hack web apps.

What testing would have caught

Our analysis.

  • Over-broad partner and staff access. A grey-box test with partner and agent accounts checks how many customer records each role can search, view and export, and whether the API behind the screen enforces the same limits.
  • Authorization flaws that let one user change another's data. Testers replay every write request with a second account's session. Reaching another customer's invoices or editing their details is a critical finding that is easy to prove.
  • Exposed files with useful information. The AI agent reportedly started with "generic files". Recon in a pentest looks for exactly these: backup files, configuration files, exposed source maps and documentation left on public servers.
  • Logic flaws in multi-step flows. Skipping steps, repeating them, or changing values between them. Scanners rarely find these; see why scanners miss business-logic flaws.

What testing does not replace is fast disclosure. A week to acknowledge a breach of ID numbers and IBANs leaves customers exposed to fraud calls in the meantime. Under GDPR, the regulator must be notified within 72 hours of becoming aware of a breach.

Source: GDPR Article 33

Lessons for smaller companies

  1. Assume your app will be explored by an agent. Every action a logged-in user can take will be tried in every order and with every id.
  2. Test with the same approach. Use several accounts across roles and organisations, and test every write action as well as every read.
  3. Remove files that should not be public: backups, .env files, source maps and old documentation.
  4. Limit partner and staff roles to the records they actually need, and put rate limits on search and export.
  5. Prepare your breach response so you can notify within 72 hours and tell customers what to watch for.

Defenders can use the same technology. We use AI agents to explore your application the way the agent in the Spanish case did, with your permission and within an agreed scope. Senior pentesters then review every finding before it reaches your report.

Frequently asked questions

What data was taken from Endesa?

Endesa confirmed that customer contact details, DNI numbers and IBANs were taken from its commercial platform. The attacker's claims about the total number of people have not been verified.

Was the Spanish breach really carried out by AI?

The notification to the AEPD linked the attack to an AI agent, according to INCIBE-CERT. INCIBE notes that the investigation had not reached definitive conclusions.

How can a company defend against AI agents?

Fix the bugs agents find most easily: authorization checks on every read and write, exposed files and secrets, and missing rate limits. Testing with the same exploratory approach finds them first.

See what an attacker would find in your app

Our AI agents attack your web app or API with your permission, prove each finding with a working exploit, and senior pentesters review and sign the report.

15-minute call

Talk to our team

A 15-minute call about your app, your deadline and what your auditor, insurer or customer needs to see.