Vicens Advisors

The Spanish Tax Agency's AI: What It Already Does in Income Tax and Corporate Tax, and Why Keeping It Secret Matters to Taxpayers

Corporate Income TaxPublished on 8 min read

This article is also available in: Español · Deutsch · Svenska

Tax Agency AI

The Spanish Tax Agency (Agencia Tributaria, AEAT) is not studying whether it might one day use artificial intelligence. It already uses it, and extensively: in the Personal Income Tax (IRPF) campaign, in Corporate Income Tax (CIT) control and in the very planning of whom it will audit. The debate that has opened is not about whether it should use these tools, but about something different: that it does not explain how it does so, and that a bill currently going through Parliament seeks to reinforce the secrecy surrounding these systems, just as the artificial intelligence rules and the most recent case law point in the opposite direction.

What the Tax Agency Is Already Doing with Artificial Intelligence

The most everyday example is in the income tax return. The Agency itself has explained that, in Renta WEB, its systems analyse the changes the taxpayer makes to the draft return. If a box that was already pre-filled with tax data is modified, for example by reducing an item of income, the system detects it and displays a warning, because it interprets that there may be an unintentional or intentional error. Trying out amounts and adjusting boxes is therefore not an operation that goes unnoticed.

The use extends to tax control as a whole. The 2025 Annual Tax and Customs Control Plan, approved by Resolution of 27 February 2025 and published in the Official State Gazette (Boletín Oficial del Estado, BOE) on 17 March 2025, expressly included the study of projects to apply artificial intelligence across the different areas of the Agency. The 2026 Plan, published in the BOE in March 2026, has taken that line further, with predictive models, mass data analysis and taxpayer-selection algorithms aimed at the profiles most likely to be non-compliant. Among the applications described, the following are worth noting:

  • Detection of recurring errors. Based on assessments issued in previous years, the system identifies taxpayers who may make mistakes again in certain boxes, often self-employed individuals who do not report all of their income.
  • Corporate Income Tax. Control is being strengthened over incentives that affect the tax liability, such as R&D&I deductions, and over the use of shell or instrumental companies to divert personal expenses or conceal income, as well as the correct application of the exemption in Article 21 of the Corporate Income Tax Act (Ley del Impuesto sobre Sociedades).
  • Mass data cross-checking. Information from banks, from digital platforms reported under the DAC7 Directive, from registers and from consumption is compared with what has been declared. Tourist rentals and non-residents receive specific attention.

One nuance that the Agency itself points out deserves emphasis, as it brings balance to the issue: artificial intelligence is not the final decision-maker. Any action remains subject to human supervision. These tools assist, raise alerts and set priorities, but they do not assess tax or impose penalties on their own. The reference framework is the Tax Agency’s Artificial Intelligence Strategy of 2024, within the provisions of Articles 85 and 96 of the General Tax Act (Ley General Tributaria, LGT).

The Problem: An Artificial Intelligence That Does Not Explain Itself

This scenario is affected by the Draft Organic Act for the proper use and governance of artificial intelligence, which adapts Regulation (EU) 2024/1689 and was published in the Official Gazette of the Spanish Parliament (Boletín Oficial de las Cortes Generales) on 12 June 2026. Its first final provision amends Article 116 of the LGT.

At present, that article merely states that the Tax Control Plan is confidential, although its general criteria may be published. The reform extends that confidentiality to the automated, algorithmic and artificial intelligence systems used against fraud, so that this information would not be subject to publicity or public access, nor would it be disclosed to taxpayers or to bodies not involved in the application of taxes. The result is stronger secrecy over how these tools work, precisely when their weight in the selection of audits is at its greatest.

A Contradiction with the Artificial Intelligence Rules Themselves

The paradox is obvious. The law that provides cover for secrecy is, at the same time, the one that transposes the European Artificial Intelligence Regulation, whose declared aim is trustworthy, ethical, transparent and human-centred artificial intelligence. While the bill imposes on the private sector a demanding regime of compliance, documentation and penalties, it reserves a space of opacity for the tax authorities.

It is this contrast that has led the Spanish Association of Tax Advisers (Asociación Española de Asesores Fiscales, AEDAF) to send proposed amendments to the parliamentary groups on 24 June 2026, through its Observatory on Taxpayers’ Rights and Safeguards. AEDAF does not reject the use of artificial intelligence, which it considers useful against fraud. What it objects to is that fostering a false appearance of transparency clashes head-on with the governance objectives of the Regulation, and that a secrecy of such breadth could leave the very profiling and risk-selection systems outside the public register, and therefore outside scrutiny.

The Supreme Court’s Position: Algorithmic Transparency

The debate is not theoretical. The Supreme Court has already established doctrine on algorithmic transparency. In its Judgment 1119/2025 of 11 September 2025 (the BOSCO case), the Contentious-Administrative Chamber recognised the right to access the source code of a government application that took automated decisions on the granting of a benefit, and ordered the State to provide it.

The Court reasons that, when an automated decision affects rights, the Administration must provide the information needed to understand how it works, which may even require access to the source code in order to verify that the system complies with the rule it is supposed to apply. It rejects the idea that intellectual property, security or confidentiality, invoked in generic terms, are sufficient to justify total opacity, and it links algorithmic transparency to the principle of access to public information and to judicial review of the Administration.

The case concerned a social benefit and not a tax, and the Court itself recalls that access must be weighed case by case. But the direction it sets is unequivocal: opacity cannot be the rule when a public algorithm conditions rights. It is hard to reconcile that position with a reform that reinforces the secrecy of the Tax Agency’s systems.

The Rights at Stake

The underlying issue, which AEDAF and part of legal scholarship identify as a possible infringement of rights, rests on established principles of our legal system:

  • The statement of reasons for administrative acts. An assessment must explain the facts and legal grounds that support it (Article 103.3 of the LGT and Article 35 of Law 39/2015). What is not known can hardly be challenged.
  • Effective judicial protection under Article 24 of the Constitution and the exclusive jurisdiction of the courts under Article 117: the ultimate review of legality belongs to judges and courts, which cannot be sidelined by absolute secrecy.
  • Access to public information, recognised in Article 105.b of the Constitution, the cornerstone of the Supreme Court doctrine cited above.
  • Data protection and equality, relevant where selection relies on the processing of personal information and may incorporate bias.

What This Means for Taxpayers

The practical conclusion does not depend on the outcome of the parliamentary process. In the income tax return, it is advisable to check the tax data before accepting the draft and not to modify boxes without documentary support justifying the change. In Corporate Income Tax, the consistency of the information, the correct substantiation of deductions and incentives, and the real substance of corporate structures are the best defence against a control that is increasingly guided by data analysis.

For those with economic activity, significant assets or links with several countries, the level of scrutiny is higher, as these are profiles more likely to be flagged by a risk system. In these cases, specialist tax advice makes it possible to anticipate contingencies, organise documentation and respond rigorously to requests from the Tax Agency, for both residents and non-residents.

Conclusion

It is legitimate, and by now inevitable, for the Tax Agency to use artificial intelligence. The problem is not the tool but its opacity: keeping secret how it is decided whom to audit is hard to square with the artificial intelligence rules, which pursue precisely the opposite, and with the position the Supreme Court has already established. While the bill continues its passage through Parliament, the prudent recommendation for self-employed individuals, companies and private individuals is to strengthen their documentary organisation and the quality of their returns, so that any audit can be approached from a solid position.


info@vicensadvisors.com · +34 669 684 686 · www.vicensadvisors.com
Mallorca · Manacor

This content is for general information and educational purposes only. It does not constitute professional advice and is not a substitute for the individual analysis of each case. The application of the rules requires an individual study of the facts involved.

© Vicens Advisors, S.L. All rights reserved. Total or partial reproduction of this content, by any means or procedure, without the express written authorisation of its owner is prohibited. Any unauthorised use will constitute an infringement of intellectual property rights under the legislation in force.

Tax Agency AI