December 11, 2025
Ai looks at our digital patterns

Spain’s tax agency lets AI watch your finances 24/7

Spain’s tax agency, Agencia Tributaria, has fully stepped into the AI era. Human “gut feeling” is increasingly being replaced by algorithms that work around the clock, cross-checking huge data sets – and deciding which taxpayers should be examined more closely.

Background: from random checks to risk profiles

Over the past few years, tax authorities around the world have been moving away from classic random audits toward more data-driven risk analysis. Spain is now one of the clearest examples of this shift.

According to former Hacienda employee Emilio Baena, who worked ten years at Agencia Tributaria, every taxpayer in Spain now has a “risk profile” score that is updated in real time. This profile is based on a wide range of data points: filing history, income, spending patterns, bank transactions, business interests, international links and much more.

The end result: it is no longer a human caseworker who first decides whether something looks suspicious – it is an AI-driven algorithm.

How the systems work – in broad strokes

The picture emerging from Spanish media and expert commentary can be summed up in a few points:

  • The algorithm works 24/7
  • Big data as the engine
  • Tools like HERMES
  • Humans only step in after the algorithm flags a case

Red flags: which moves trigger an AI audit?

Baena’s warnings, as reported in Spanish media, give a clear picture of what kind of behaviour can attract the attention – or concern – of Spain’s tax authority. Roughly speaking, it falls into six categories:

1. Spending that doesn’t match your income

If your lifestyle – travel, purchases, investments – sits well above the income you declare, the algorithm reacts. This applies to both individuals and business owners.

2. Unclear money moving between accounts

Large or frequent transfers between your own accounts or those of close relatives, without clear economic logic or documentation, can be seen as attempts to hide where money comes from or what it is really used for.

3. International transactions and cryptocurrencies

Cross-border payments, use of platforms in other countries and crypto trading rank high on the risk radar, especially if they aren’t backed up by what you report in your tax return.

4. Cash and odd invoicing patterns

An unusually high share of cash transactions, “creative” invoices or recurring patterns that deviate from normal practice in your sector (for example many small invoices to stay below reporting thresholds) can trigger automatic follow-ups.

5. Links to foreign company registers

If your name appears in international company registers, trust structures or other ownership databases, it is factored into your risk profile – especially if it doesn’t show up clearly in your tax filings.

6. Contradictions with data from banks and platforms

The tax agency receives data directly from banks, employers, payment platforms and sometimes even marketplaces. If what you report yourself differs too much from these sources, there’s a good chance the AI system will flag your case.

In short: the old belief that “no one looks at minor discrepancies” is becoming less and less true – even relatively small deviations can be detected automatically if they match certain risk patterns.

“AI doesn’t get tired, distracted or forgetful”

Baena stresses that the difference from the old, manual model is psychologically important. A human inspector can change priorities, miss details or simply run out of time. An AI system:

  • analyses all available data points in a consistent way,
  • does not forget historical irregularities,
  • and keeps updating the risk profile as long as new information comes in.

The message to taxpayers is therefore not only “follow the law” but also “be consistent and transparent in everything you do”. If your tax returns, account movements and actual economic reality line up, the chances decrease that the algorithm will classify you as a risk – even if you haven’t done anything illegal.

Legal certainty and privacy – a growing debate in Spain

While the AI push is being highlighted as an effective way to combat tax fraud, it is also causing concern among tax lawyers and advisers, mainly around:

  • Transparency: How do the algorithms work? What factors weigh most in the risk score?
  • Bias and error sources: Is there a risk that certain industries, regions or behaviours are over-audited because of how the model was trained?
  • Right to information and appeal: How much can an individual taxpayer find out about why they were selected for an audit?

Several Spanish tax experts are calling for clearer rules on how AI may be used in the selection of tax cases, as well as mechanisms to detect and correct systematic errors or distortions.

What does this mean for “ordinary” taxpayers?

For people who manage their finances properly, this development is essentially a logical continuation of something that has been around for years: automatic reporting from banks, employers and insurance companies.

But the AI step does have some practical consequences:

  • Careful documentation becomes more important
  • Think about the whole picture, not just the form
  • Crypto and digital platforms are not invisible

For readers in other European countries, Spain’s example is a preview of how tax administration may soon look across the continent: more data, more AI, less randomness – and a much greater need to understand what our economic “digital shadow” actually reveals.

Source articles

  • Idealista: La IA te vigila: los movimientos que hacen saltar las alarmas de Hacienda
  • Diario AS: interview with Emilio Baena on how algorithms watch taxpayers 24/7
  • El Confidencial: background on how Agencia Tributaria sharpens its controls with big data and AI
  • Fiscalblog: analysis of HERMES and the use of AI within Agencia Tributaria
Estity Logo

Our solution helps you get better control of your property. From organizing files, renting out your property and declaring related taxes in Spain — all in one seamless platform.