Spain's Organic Bill for the proper use and governance of artificial intelligence incorporates a far-reaching tax reform that strengthens protection for the algorithms used by the Tax Agency to prevent tax fraud.
The text, published in the Official Gazette of the Cortes Generales on June 12, 2026, amends the General Tax Law, limits the information that may be made public about these systems and regulates an exceptional mechanism for accessing tax data in investigations related to artificial intelligence.
Adapting the legal framework
The reform responds to the emergence of disruptive technologies in the public administration and to the need to adapt the traditional legal framework to the growing use of algorithmic systems in the public sector. In the tax field, the bill seeks to balance the transparency requirements imposed by artificial intelligence regulation with the need to preserve the secrecy that has historically surrounded anti-fraud actions.
To achieve this, the legislation is built on three pillars: the amendment of the General Tax Law, the creation of a special regime for the artificial intelligence systems used by the Tax Agency within the state sector's public inventory, and the establishment of an exceptional procedure for the transfer of tax information.
The secrecy of the Tax Agency's AI in Spain
The main novelty is found in the First Final Provision of the bill, which amends article 116 of the General Tax Law, dedicated to the Tax Control Plan. The text maintains that this plan will continue to be confidential, although only the general criteria guiding the Administration's actions may be made public.
Spain's Tax Agency will use AI as a weapon of mass surveillance of citizens
The reform expressly extends that protection to partial inspection plans, computer information-processing tools, taxpayer selection systems and, in particular, to all automated, algorithmic, analytical or artificial intelligence systems used in the prevention and control of tax fraud when their disclosure could compromise the effectiveness of the actions or facilitate tax evasion.
The bill further establishes that this information may not be subject to publicity, communication or public access, nor be made available to taxpayers or to bodies outside the application of taxes. However, the Administration may disseminate general, aggregated or descriptive information about these systems, provided that such information does not reveal how they operate or compromise the effectiveness of tax actions.
Overall, the amendment creates a reinforced confidentiality regime for the algorithms and artificial intelligence tools used by the Tax Agency in the fight against fraud.
An exception for the Tax Agency
The bill also introduces an exception within the general transparency regime applicable to artificial intelligence systems in the state public sector. Although article 12 establishes as a general rule the obligation to register and inventory the AI systems used in electronic administrative procedures, article 12.5 sets out specific treatment for the tools used in the prevention and control of tax fraud.
The inclusion of these systems in the public inventory may only be carried out when it is compatible with the confidentiality recognized by the General Tax Law. In addition, the bill prohibits including any description, metadata or technical information that would allow the operation of the algorithms used by the Tax Agency to be known, reproduced, inferred or circumvented.
In this way, the legislator seeks to prevent the general transparency obligations on artificial intelligence from becoming an indirect channel for revealing how the selection systems used by the tax Administration operate.
Requesting tax data in exceptional cases
The third amendment with a tax impact is found in the sanctioning regime envisaged for artificial intelligence operators and providers. Article 36 authorizes preliminary investigation actions before the formal opening of a sanctioning file in order to identify possible responsible parties.
Within that procedure, paragraph 3 empowers the market surveillance authority, such as the Spanish Agency for the Supervision of Artificial Intelligence (AESIA), to request information from public administrations, including tax administrations and Social Security, when it has not been possible to identify those responsible by other means.
According to the bill, only the data strictly essential to determine the identity of the presumed responsible party may be requested, and exclusively for that purpose. In this way, the future law incorporates an exceptional mechanism for the transfer of tax information, limited by the principles of subsidiarity and specialty, by reserving this access only for those cases in which the ordinary identification mechanisms have proved insufficient.
The reform thus places the Tax Agency among the public bodies that may keep under a special confidentiality regime the artificial intelligence systems used to prevent fraud, while adapting the tax framework to the new obligations arising from the future Spanish regulation on artificial intelligence.