Government by algorithm (also known as Algorithmic regulation, Regulation by algorithms, Algorithmic governance, Algocratic governance, Algorithmic legal order or Algocracy) is an alternative form of government or social ordering, where the usage of computer algorithms, especially of artificial intelligence and blockchain, is applied to regulations, law enforcement, and generally any aspect of everyday life such as transportation or land registration. Alternatively, algorithmic regulation is defined as setting the standard, monitoring and modification of behaviour by means of computational algorithms -- automation of judiciary is in its scope.
Government by algorithm raises new challenges that are not captured in the e-Government literature and the practice of public administration. Some sources equate cyberocracy, which is a hypothetical form of government that rules by the effective use of information, with algorithmic governance, although algorithms are not the only means of processing information.Nello Cristianini and Teresa Scantamburlo argued that the combination of a human society and an algorithmic regulation forms a social machine.
In 1962, head of the Department of technical physics in Kiev, Alexander Kharkevich, published an article in the journal "Communist" about a computer network for processing of information and control of economy. In fact, he proposed to make a network like the modern Internet for the needs of algorithmic governance.
In 1971-1973, the Chilean government carried out the Project Cybersyn during the presidency of Salvador Allende. This project was aimed at constructing a distributed decision support system to improve the management of the national economy.
Also in the 1960s and 1970s, Herbert A. Simon championed expert systems as tools for rationalization and evaluation of administrative behavior. The automation of rule-based processes was an ambition of tax agencies over many decades resulting in varying success. Early work from this period includes Thorne McCarty's influential TAXMAN project in the US and Ronald Stamper's LEGOL project in the UK. In 1993, the computer scientist Paul Cockshott from the University of Glasgow and the economist Allin Cottrell from the Wake Forest University published the book Towards a New Socialism, where they claim to demonstrate the possibility of a democratically planned economy built on modern computer technology. The Honourable Justice Michael Kirby published a paper in 1998, where he expressed optimism that the then-available computer technologies such as legal expert system could evolve to computer systems, which will strongly affect the practice of courts. In 2006, attorney Lawrence Lessig known for the slogan "Code is law" wrote:
"[T]he invisible hand of cyberspace is building an architecture that is quite the opposite of its architecture at its birth. This invisible hand, pushed by government and by commerce, is constructing an architecture that will perfect control and make highly efficient regulation possible" 
Sociologist A. Aneesh used the idea of algorithmic governance in 2002 in his theory of algocracy. Aneesh differentiated algocratic systems from bureaucratic systems (legal-rational regulation) as well as market-based systems (price-based regulation).
In 2013, algorithmic regulation was coined by Tim O'Reilly, Founder and CEO of O'Reilly Media Inc.:
Sometimes the "rules" aren't really even rules. Gordon Bruce, the former CIO of the city of Honolulu, explained to me that when he entered government from the private sector and tried to make changes, he was told, "That's against the law." His reply was "OK. Show me the law." "Well, it isn't really a law. It's a regulation." "OK. Show me the regulation." "Well, it isn't really a regulation. It's a policy that was put in place by Mr. Somebody twenty years ago." "Great. We can change that!""
[...] Laws should specify goals, rights, outcomes, authorities, and limits. If specified broadly, those laws can stand the test of time. Regulations, which specify how to execute those laws in much more detail, should be regarded in much the same way that programmers regard their code and algorithms, that is, as a constantly updated toolset to achieve the outcomes specified in the laws. [...] It's time for government to enter the age of big data. Algorithmic regulation is an idea whose time has come.
Algorithmic regulation is supposed to be a system of governance where more exact data collected from citizens via their smart devices and computers are used for more efficiency in organizing human life as a collective. As Deloitte estimated in 2017, automation of US government work could save 96.7 million federal hours annually, with a potential savings of $3.3 billion; at the high end, this rises to 1.2 billion hours and potential annual savings of $41.1 billion. According to a study of Stanford University, 45% of the studied US federal agencies have experimented with AI and related machine learning (ML) tools up to 2020. A 2019 poll made by Center for the Governance of Change at IE University in Spain showed that 25% of citizens from selected European countries are somewhat or totally in favor of letting an artificial intelligence make important decisions about the running of their country. Following table shows detailed results:
A smart city is an urban area, where collected surveillance data is used to improve various operations in this area. Increase in computational power allows more automated decision making and replacement of public agencies by algorithmic governance.
|Agency Name||Number of Use Cases|
|Office of Justice Programs||12|
|Securities and Exchange Commission||10|
|National Aeronautics and Space Administration||9|
|Food and Drug Administration||8|
|United States Geological Survey||8|
|United States Postal Service||8|
|Social Security Administration||7|
|United States Patent and Trademark Office||6|
|Bureau of Labor Statistics||5|
|U.S. Customs and Border Protection||4|
53% of these applications were produced by in-house experts. Commercial providers of residual applications include Palantir Technologies. From 2012, NOPD started a collaboration with Palantir Technologies in the field of predictive policing.
In Estonia, artificial intelligence is used in its e-government to make it more automated and seamless. A virtual assistant will guide citizens through any interactions they have with the government. Automated and proactive services "push" services to citizens at key events of their lives (including births, bereavements, unemployment, ...). One example is the automated registering of babies when they are born. Estonia's X-Road system will also be rebuilt to include even more privacy control and accountability into the way the government uses citizen's data. 
Cryptocurrencies, Smart Contracts and Decentralized Autonomous Organization are mentioned as means to replace traditional ways of governance. Cryptocurrencies are currencies, which are enabled by algorithms without a governmental central bank.Smart contracts are self-executable contracts, whose objectives are the reduction of need in trusted governmental intermediators, arbitrations and enforcement costs. A decentralized autonomous organization is an organization represented by smart contracts that is transparent, controlled by shareholders and not influenced by a central government.
According to the statement of Beijing Internet Court, China is the first country to create an internet court or cyber court. Chinese AI judge is a virtual recreation of an actual female judge. She "will help the court's judges complete repetitive basic work, including litigation reception, thus enabling professional practitioners to focus better on their trial work".
In 2018, an activist named Michihito Matsuda ran for mayor in the Tama city area of Tokyo as a human proxy for an artificial intelligence program. While election posters and campaign material used the term 'robot', and displayed stock images of a feminine android, the 'AI mayor' was in fact a machine learning algorithm trained using Tama city datasets. The project was backed by high-profile executives Tetsuzo Matsumoto of Softbank and Norio Murakami of Google. Michihito Matsuda came third in the election, being defeated by Hiroyuki Abe. Organisers claimed that the 'AI mayor' was programmed to analyze citizen petitions put forward to the city council in a more 'fair and balanced' way than human politicians.
In 2019, AI-powered messenger chatbot SAM participated in the discussions on social media connected to an electoral race in New Zealand. The creator of SAM, Nick Gerritsen, believes SAM will be advanced enough to run as a candidate by late 2020, when New Zealand has its next general election.
Tim O'Reilly suggested that data sources and reputation systems combined in algorithmic regulation can outperform traditional regulations. For instance, once taxi-drivers are rated by passengers, the quality of their services will improve automatically and "drivers who provide poor service are eliminated". O'Reilly's suggestion is based on control-theoreric concept of feed-back loop -- improvements and disimprovements of reputation enforce desired behavior. The usage of feed-loops for the management of social systems is already been suggested in management cybernetics by Stafford Beer before.
The Chinese Social Credit System is closely related to China's mass surveillance systems such as the Skynet, which incorporates facial recognition system, big data analysis technology and AI. This system provides assessments of trustworthiness of individuals and businesses. Among behavior, which is considered as misconduct by the system, jaywalking and failing to correctly sort personal waste are cited. Behavior listed as positive factors of credit ratings includes donating blood, donating to charity, volunteering for community services, and so on. Chinese Social Credit System enables punishments of "untrustworthy" citizens like denying purchase of tickets and rewards for "trustworthy" citizen like less waiting time in hospitals and government agencies.
In February 2020, China launched a mobile app to deal with Coronavirus outbreak, called close-contact-detector. Users are asked to enter their name and ID number. The app is able to detect 'close contact' using surveillance data (i.e. using public transport records, including trains and flights) and therefore a potential risk of infection. Every user can also check the status of three other users. To make this inquiry users scan a Quick Response (QR) code on their smartphones using apps like Alipay or WeChat. The close contact detector can be accessed via popular mobile apps including Alipay. If a potential risk is detected, the app not only recommends self-quarantine, it also alerts local health officials.
Alipay also has the Alipay Health Code which is used to keep citizens safe. This system generates a QR code in one of three colors (green, yellow, or red) after users fill in a form on Alipay with personal details. A green code enables the holder to move around unrestricted. A yellow code requires the user to stay at home for seven days and red means a two-week quarantine. In some cities such as Hangzhou, it has become nearly impossible to get around without showing your Alipay code.
In Cannes, France, monitoring software has been used on footage shot by CCTV camera's, allowing to monitor their compliance to local social distancing and mask wearing during the COVID-19 pandemic. The system does not store identifying data, but rather allows to alert city authorities and police where breaches of the mask and mask wearing rules are spotted (allowing fining to be carried out where needed). The algorithms used by the monitoring software can be incorporated into existing surveillance systems in public spaces (hospitals, stations, airports, shopping centres, ...) 
Cellphone data is used to locate infected patients in South Korea, Taiwan, Singapore and other countries. In March 2020, the Israeli government enabled security agencies to track mobile phone data of people supposed to have coronavirus. The measure was taken to enforce quarantine and protect those who may come into contact with infected citizens. Also in March 2020, Deutsche Telekom shared private cellphone data with the federal government agency, Robert Koch Institute, in order to research and prevent the spread of the virus. Russia deployed facial recognition technology to detect quarantine breakers. Italian regional health commissioner Giulio Gallera said that "40% of people are continuing to move around anyway", as he has been informed by mobile phone operators. In USA, Europe and UK, Palantir Technologies is taken in charge to provide COVID-19 tracking services.
Tsunamis can be detected by Tsunami warning systems. They can make use of AI.Floodings can also be detected using AI systems.Locust breeding areas can be approximated using machine learning, which could help to stop locust swarms in an early phase.Wildfires can be predicted using AI systems.  Also, wildfire detection is possible by AI systems (i.e. through satellite data, aerial imagery, and personnel position). and they can also help in evacuation of people during wildfires.
Due to Covid-19 pandemic in spring 2020, in-person final exams were impossible for thousands of students. The public high school Westminster High imployed algorithms to assign grades. UK's Department for Education also employed a statistical calculus to assign final grades in A-levels, due to Covid-19 pandemic.
There are potential risks associated with the use of algorithms in government. Those include algorithms becoming susceptible to bias, a lack of transparency in how an algorithm may make decisions, and the accountability for any such decisions. There is also a serious concern that gaming by the regulated parties might occur, once more transparency is brought into the decision making by algorithmic governance, regulated parties might try to manipulate their outcome in own favor and even use adversarial machine learning. According to Harari, the conflict between democracy and dictatorship is seen as a conflict of two different data-processing systems -- AI and algorithms may swing the advantage toward the latter by processing enormous amounts of information centrally. Also, the contributors in the 2019's documentary iHuman express apprehension of "infinitely stable dictatorships" being created by governmental use of AI.
The Netherlands employed an algorithmic system SyRI (Systeem Risico Indicatie) to detect citizens perceived being high risk for committing welfare fraud, which quietly flagged thousands of people to investigators. This caused a public protest. The district court of Hague shut down SyRI referencing Article 8 of the European Convention on Human Rights (ECHR).
Zeynep Engin, Philip Treleaven, Algorithmic Government: Automating Public Services and Supporting Civil Servants in using Data Science Technologies, The Computer Journal, Volume 62, Issue 3, March 2019, Pages 448-460, https://doi.org/10.1093/comjnl/bxy082