We have some good news on the democratic front regarding a better AI! The news comes from Spain, but its importance is global.
Parliaments and governments do not always fulfill their role in protecting individual rights within democratic systems. Fortunately, courts sometimes step up to fill this gap, living up to our democratic principles and extending legal protection to citizens.
This is precisely what happened in Spain on September 11th, 2025, when the Supreme Court recognized the right of Civio, a non-profit organization working to improve the quality of democracy, to access the source code of Bosco. Bosco is an algorithm used to determine citizens’ eligibility for a social benefit known as the “social bonus.”
The Supreme Court’s judgment is a landmark decision with crucial implications for Spanish democracy, as well as indirect but tangible effects on other democratic systems. It helps to close some of the loopholes left by the European AI Act while also correcting the Spanish government’s malpractice.
Ultimately, this ruling is only one chapter in the growing series of judicial battles over AI regulation that will proliferate in the years ahead.
Algorithmic Transparency
The ruling gives direction to how algorithms and AI evolve, at least in their public uses. It safeguards and promotes a more legitimate vision of “digital democracy,” as the Court calls it.
It also aligns with other recent judicial decisions, such as the judgment by the European Union's Court of Justice, on February 27th, 2025, which established a “right of explanation” in cases of automated decision-making by private entities, prioritizing algorithmic transparency over trade secrets.
The Spanish Supreme Court’s decision takes the February 2025 ruling a significant step further in advancing algorithmic transparency
The general case for algorithmic transparency is clear and simple. Public administrations increasingly use algorithms to support decisions of many different kinds, sometimes fully automating them, sometimes only providing input to officials. This distinction is not always easy to draw. In any case, citizens have the right to know what their government is doing, how it is doing it, and why.
Without such transparency, people cannot effectively defend their rights or exercise the ultimate democratic control over government decisions that democracy requires.
Algorithmic transparency also forms part of the broader ideals of Open Government and Digital Governance. When algorithms determine or influence important outcomes—such as access to benefits, opportunities, rights, or duties—the case for transparency becomes even stronger.
This principle is firmly grounded in human rights, including Article 19 of the Universal Declaration of Human Rights; Article 19 of the International Covenant on Civil and Political Rights; Article 42 of the Charter of Fundamental Rights of the European Union; and most national Bills of Rights worldwide.
In short, algorithmic transparency is fundamentally a matter of individual rights and democracy.
The Bosco Case
Bosco is an algorithm created by the Spanish Ministry of Ecological Transition to determine which citizens are eligible for a subsidy on their energy bills known as the bono social eléctrico or “electric social bonus.” Bosco’s recommendations quickly produced errors—both false negatives and false positives—about who qualified for the benefit. Yet the opacity of the algorithm made external scrutiny impossible.
Civio, a civic organization dedicated to protecting citizens’ rights and “improving the quality of democracy in Spain,” has long specialized in data analysis and journalism, software development, communication, and institutional advocacy. In 2018, Civio initiated what became a long legal battle.
That year, Civio filed a request through the Government’s Transparency Portal for access to Bosco’s source code and other technical details. The request went unanswered. Civio then appealed to the Council of Transparency and Good Government, which granted access to some technical information, but refused to release the source code, citing privacy concerns and the Ministry’s copyright, among other reasons.
Civio went to court. In 2021, the Juzgado Central de lo Contencioso Administrativo denied access on similar grounds. Civio appealed to the Audiencia Nacional, which also ruled against them in 2024. Finally, Civio filed a recurso de casación (an extraordinary appeal for reviewing lower judicial decisions) before the Supreme Court, and won.
The Supreme Court’s Reasoning
From a legal standpoint, the ruling is crucial. It not only secures Civio’s right of access to Bosco’s source code but also establishes a binding precedent (jurisprudencia) with erga omnes effects. This means that the ruling applies to all algorithms used by Spanish public administrations, at any level and in any field, if they have effects similar to Bosco’s.
The Bosco Case itself ends here, as the government has no realistic avenue for appeal, but the broader fight for algorithmic transparency in Spain has only just begun. More requests for access to public algorithms are certain to follow, and courts will be bound by this precedent.
The Court’s reasoning is especially notable. In Legal Ground 6.A (quoted here in my own translation), it explicitly defends algorithmic transparency. The ruling affirms that the right of access to public information is a constitutional right (Article 105.b of the Spanish Constitution) that deserves maximum protection because it underpins democracy and the rule of law. It is closely connected to other fundamental rights such as political participation, freedom of information, and due process.
The Court emphasizes that transparency is particularly vital in light of “the risks inherent in the use of new technologies by the administration in exercising political power or delivering public services.” While acknowledging the usefulness of such technologies, it insists they must come “with special requirements of transparency…providing citizens with the information needed to understand the basic features of their functioning, which may require access to the source code.”
The ruling thus enacts a “principle of algorithmic transparency,” which characterizes “imposing to public administration the duty to grant public information and facilitate access to citizens, in a larger or lesser extent, to the fundamental features of the algorithms being used in public decision making or to their source code, as a manifestation of the constitutionally protected principle of transparency.”
The Court further connects this principle to the idea of “digital democracy,” understood “not only as an extension of representative democracy, but the result of a genuine structural transformation in the democratic functioning of public powers. This transformation is characterized by the enforcement of the principles of transparency, participation, and accountability in a digital environment, where access to public information and algorithmic transparency hold an essential role to secure it.”
Algorithmic transparency, in this sense, is not just about access to information, but about the duty of public authorities to explain algorithmic functioning in comprehensible terms, so that citizens can understand, monitor, and participate in public decision-making.
The Court also addresses counterarguments raised by lower courts. For example, concerns about national security—such as the risk that hackers could exploit source code—are met by limiting access to public-interest organizations like Civio, subject to strict confidentiality. The Court even suggests that sharing code can strengthen, not weaken, security by encouraging more robust development.
As for privacy concerns and copyright protections, the Court recognizes their importance but insists they must be weighed against the overriding value of transparency in a digital democracy. On balance, it grants Civio access to Bosco’s source code, with certain safeguards
Conclusion
The Spanish Supreme Court’s ruling on the Bosco Case sets an excellent precedent for advancing algorithmic transparency in Spain, at least for algorithms used by the public administration. It provides a roadmap for courts in other democracies, taking a bold and decisive step in the right direction. More than that, it imposes direction, it points AI development itself toward the right path, putting AI at the service of democracy, rather than the other way around.