How Estonia turned a gambling tax error into an AI test
A wording error in Estonia’s Gambling Tax Act left online casinos outside the tax net for a year, costing the government €24 million ($27.4 million) in gambling revenues. The mistake helped inspire Apsakaleidja, an AI tool that checks draft bills for legal and technical problems.
Estonia’s latest experiment with AI in government began with a practical problem: a law said the wrong thing. A change meant to lower the tax rate on remote gambling instead referred only to “skill games” for that year, leaving games of chance and remote gambling outside the wording.
“This is a mostly practical government AI quality-control tool with little sign of autonomy, harm, or social deskilling.”Why it scores Neutral
The result was not an abstract drafting concern. Online casinos were accidentally left outside the tax net for an entire year, costing the government €24 million ($27.4 million) a year in gambling revenues. For a country whose entire gambling industry is worth around €300 million ($343 million), and whose online gambling market is one of the fastest growing in the EU, the error was large enough to reshape the conversation about AI and public administration.
A costly phrase in the Gambling Tax Act
In December, the Riigikogu, Estonia’s parliament, passed changes to the country’s Gambling Tax Act. The intended policy was to lower the tax rate on remote gambling. But the final wording narrowed the relevant reference to “skill games” for that year.
That distinction mattered. Because the text did not cover games of chance or remote gambling as intended, online casinos were left outside the tax net for the year. The error was eventually spotted by a legal counsel for a gambling operator.
The political embarrassment grew after Luukas Ilves, former undersecretary for digital transformation, tested the legislation with Claude and Gemini. Ilves said both AI systems immediately found the inconsistency. The episode suggested that AI tools could catch certain drafting failures before they become expensive public problems.
The rise of Apsakaleidja
Within hours, Ilves built a prototype named Apsakaleidja, or “Fuckup Finder.” The tool was designed to pull draft bills from the Riigikogu website and flag potential problems before they turn into real-world consequences.
Apsakaleidja looks for issues including broken references, contradictory wording, arithmetic errors, and impossible dates. It also sorts problems into high, medium, or low risk. Of the 112 bills currently listed, 102 are rated high risk.
The tool has already highlighted examples of contradictory wording in draft text, and Ilves demo’d it on national TV. Its importance is not that it replaces legal judgment, but that it shows how a relatively fast AI-assisted review can surface issues humans still need to examine.
Kristen Michal, Estonia’s prime minister, framed the episode as a lesson in useful assistance. “The situation demonstrated that AI can be an incredibly useful assistant,” he told WIRED. “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.”
From one mistake to a wider AI program
After the gambling tax mistake, Estonia moved further into AI use across government. In January, Michal suggested the country may use tools like Apsakaleidja to draft legislation in ways that help find and fix loopholes earlier.
He also launched the Eesti.ai program, which is designed to skill up Estonians in AI use. Its stated goal is doubling productivity within the country by 2035. Advisers to the initiative include Bolt founder Markus Villig and Ilves, the creator of the Fuckup Finder.
In April, the country’s parliament received from the government a bill that gave state and local government the right to use digital solutions, including AI, to automate administrative processes. That bill is going through parliament, where representatives are debating what changes it could introduce, with the intention of becoming law.
In June, Michal told an Eesti.ai meeting that, if things go to plan, "Estonia will become the first country in the world to create official digital identities for AI agents.”
Estonia has a strong starting point for this kind of shift. Michal says 99 percent of public services are already online, and the country has led the way on integrating digital identity through a digital-first state. “Those investments now allow us to move faster and more confidently into the AI era,” he explains.
Where automation stops
The key debate is not simply whether AI can help government move faster. It is where automation should be allowed to act, and where human judgment must be involved from the beginning.
Catherine Flick, who researches technology ethics at the University of Staffordshire, argues that the gambling tax mistake raises a basic governance question. “Why are humans not doing this review process as part of the legislation drafting procedure?” she says. “At some point someone has to sit down and read through the whole thing, with the understanding of the context and all that sort of stuff, in order to make sure that this is a decent law.”
Kirke Maar, team lead of Eesti.ai, says Estonia’s current thinking separates decisions into broad categories. “The natural dividing line is between rule-bound decisions and discretionary ones,” she says. “Where the law determines the outcome from verifiable facts—you meet the criteria, you get the result—automation is appropriate.”
That could mean a citizen does not need to fill out a form when the state already has the data needed to know they qualify for a benefit. It could also mean tax declarations, already prefilled in Estonia, move toward an agent preparing and filing more complex declarations end to end, with the citizen confirming or intervening where needed.
Maar draws the boundary at decisions that require judgment about individual circumstances. When “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.
Accountability remains the test
Maar and Ilves say people would be able to invoke their right to be heard during an AI decisionmaking process. At that 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.
Every automated administrative decision would need an audit trail showing what data was used, which rule was applied, when the decision was made, and how the citizen could challenge or correct it. That kind of traceability is central to Estonia’s argument that AI can assist public services without becoming an unaccountable authority.
Liina Vahtras, managing director of e-residency, says the central risk is scale without responsibility. “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,” she says. “This is what we’re working to prevent.”
Vahtras also connects accountability to the idea of agent identity. “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 says. “The idea behind the agent code is to make the chain of responsibility visible.”
Michal is also careful to limit what AI should mean inside government. “AI does not replace democratic institutions, the constitution, or the will of voters,” he says. “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.”
Read next