Estonia's government faced a costly error due to a wording mistake in legislation. Now, AI is being leveraged to prevent such issues in the future.
New Delhi, India Jul 9, 2026 ALN: Estonia’s AI embarrassment began with a single wrong phrase.
In December, the Riigikogu, Estonia’s parliament, passed changes to the country’s Gambling Tax Act meant to lower the tax rate on remote gambling. However, the wording of the law referred only to “skill games” for that year, excluding games of chance or remote gambling. Estonia’s entire gambling industry is worth around €300 million ($343 million), and its online gambling market is one of the fastest growing in the EU.
This single blunder meant online casinos were accidentally left outside the tax net for an entire year, resulting in a loss of €24 million ($27.4 million) in gambling revenues for the government.
The error was initially spotted by a legal counsel for a gambling operator. The situation escalated when Luukas Ilves, former undersecretary for digital transformation, ran the legislation through AI systems Claude and Gemini. Both systems immediately identified the inconsistency.
Within hours, Ilves had built a prototype tool—called Apsakaleidja, or “Fuckup Finder”—that could pull draft bills from the Riigikogu website and flag problems such as broken references, contradictory wording, arithmetic errors, and impossible dates. It categorizes the problems as high, medium, or low risk—of the 112 bills currently listed, 102 are rated high risk. One example highlighted by the Fuckup Finder suggests contradictory wording in draft text. Ilves even demonstrated it on national TV, to the host’s amazement.
The blunder was embarrassing but also triggered a revelation within the government. “The situation demonstrated that AI can be an incredibly useful assistant,” Kristen Michal, Estonia’s prime minister, stated. “And—in the form of a vibe-coded platform to check draft legislation created in response to the incident—we saw an example of how agentic tools can empower civil society and individual citizens.”
In response, Estonia doubled down on the use of AI in government. In January, Michal suggested the country might use tools like the Apsakaleidja to draft legislation to preemptively find and fix loopholes. He launched the Eesti.ai program designed to skill up Estonians in AI use, with the goal of doubling productivity within the country by 2035. Among the advisers to the Eesti.ai initiative are Bolt founder Markus Villig and Ilves, creator of the Fuckup Finder.
In April, the country’s parliament received a bill from the government that would grant state and local governments the right to use digital solutions, including AI, to automate administrative processes. This bill is currently under debate, with the intention of becoming law. In June, Michal told an Eesti.ai meeting that, if everything goes as planned, "Estonia will become the first country in the world to create official digital identities for AI agents.”
“This is a new environment for the public sector,” Michal explained. “It demands agility and the ability to adapt as technology changes.” Estonia is better positioned than many countries to adapt to these changes: it has led the way on integrating digital identity thanks to a digital-first state, with 99 percent of public services already online. Michal notes that Estonia is often cited as a model for running a modern digital state, which has laid the groundwork for easier AI adoption. “Those investments now allow us to move faster and more confidently into the AI era,” he added.
Catherine Flick, who researches technology ethics at the University of Staffordshire, raises a fundamental question regarding the gambling tax error: “Why are humans not doing this review process as part of the legislation drafting procedure?” she asks. “At some point, someone has to sit down and read through the whole thing, with an understanding of the context, to ensure that this is a decent law.”
This final element—the human in the loop—is currently being debated by representatives in the Riigikogu. The bill is intentionally drawn broadly, explains Kirke Maar, team lead of Eesti.ai.
Estonia’s current thinking is that choices can be broadly divided into two categories. “The natural dividing line is between rule-bound decisions and discretionary ones,” she states. “Where the law determines the outcome from verifiable facts—you meet the criteria, you get the result—automation is appropriate.” If the state already has the data needed to establish that someone qualifies for a benefit, Maar and Ilves argue, the person should not necessarily have to fill in a form at all; they could simply be informed of their qualification. Tax declarations, which in Estonia are already prefilled, could transition from citizens checking and confirming a form to an agent preparing and filing more complex declarations end-to-end, with the citizen confirming or intervening where needed.
When situations are more complex, and “a decision requires genuinely weighing competing interests or judgment about a person's specific circumstances, a human belongs in the loop from the start,” says Maar.
At any point during an AI decision-making process, a person would be able to invoke their right to be heard, at which point the automated procedure would end and a human official would take over. Automated decisions would also be ruled out where a citizen disputes a decision. Additionally, every automated administrative decision would need to leave an audit trail detailing what data was used, which rule was applied, when the decision was made, and how the citizen could challenge or correct it.
“The purpose of Estonia’s digital state has never been to remove the human from government,” Maar asserts. “It has been to make services more accessible, faster, and less burdensome.”
Accountability is also a central aspect of the AI process, and an area that those working with the government on other digital interactions with citizens are well aware of. “The key risk is AI systems acting at scale without accountability—where actions cannot be traced back to a responsible party, permissions are unclear, or misuse goes undetected,” warns Liina Vahtras, managing director of e-residency, Estonia’s program that provides nonresidents with a government-issued digital identity to access Estonian business services online. “This is what we’re working to prevent.”
“As AI agents begin to interact with public services, banks, registers, and other digital systems on behalf of people and companies, it must be clear who the agent belongs to, under whose authorization it acts, what it is allowed to do, and who remains responsible for its actions,” Vahtras emphasizes. “The idea behind the agent code is to make the chain of responsibility visible.”
Prime Minister Michal shares these concerns, carefully distinguishing between AI as an assistant in Estonia and AI as an authority. “AI does not replace democratic institutions, the constitution, or the will of voters,” he states. “If AI identifies a mistake in legislation, it is no different from a human spotting one. The responsibility to correct it remains with parliament, the courts, or the public administration.”
To learn more about the latest developments in AI & Robotics Innovations, stay updated with our exclusive reports and analyses on AiLensNews.