NIGERIAN pineapple for breakfast, Peruvian quinoa for lunch and Japanese sushi for dinner. Two centuries ago, when David Ricardo advocated specialisation and free trade, the notion that international exchange in goods and services could make such a cosmopolitan diet commonplace would have seemed fanciful.

Today another scenario may appear equally unlikely: a Norwegian government agency managing Algeria’s sovereign-wealth fund; German police overseeing security in the streets of Mumbai; and Dubai playing the role of the courthouse of the Middle East. Yet such outlandish possibilities are more than likely if a new development fulfils its promise. Ever more governments are trading with each other, from advising lawmakers to managing entire services. They are following businesses, which have long outsourced much of what they do. Is this the dawn of the government-to-government era?

Such “G2G” trade is not new, though the name may be. After the Ottoman empire defaulted on its debt in 1875 foreign lenders set up an “Ottoman Public Debt Administration”, its governing council packed with European government officials. At its peak it had 9,000 employees, more than the empire’s finance ministry. And the legacy of enforced G2G trade—colonialism, as it was known—is still visible even today. Britain’s Privy Council is the highest court of appeal for many Commonwealth countries. France provides a monetary-policy service to several west African nations by managing their currency, the CFA franc.

One reason G2G trade is growing is that it is a natural extension of the trend for governments to pinch policies from each other. “Policymaking now routinely occurs in comparative terms,” says Jamie Peck of the University of British Columbia, who refers to G2G advice as “fast policy”. Since the late 1990s Mexico’s pioneering policy to make cash benefits for poor families conditional on things like getting children vaccinated and sending them to school has been copied by almost 50 other countries.

When China realised in the run-up to the 2008 Beijing Olympics that it needed to improve its air-safety regulations, it could just have looked around for the best examples and come up with its own version. Instead it asked America’s Federal Aviation Administration (FAA) to write a new rule book and to train Chinese pilots. The FAA now has full-time offices in Beijing and Shanghai. Trinidad and Tobago, which decided in 2010 to computerise its register of motor vehicles, bought a system from the government of the Canadian province of Nova Scotia. Moldova, keen to beef up its regional development, has recently signed a twinning agreement with CIVI.POL Conseil, an arm of the French interior ministry, which involves borrowing French civil-service staff.

Budget cuts can provide another impetus for G2G trade. The Dutch army recently sold its Leopard II tanks and now sends tank crews to train with German forces. That way it will be able to reform its tank squadrons quickly if they are needed. Britain, with a ten-year gap between scrapping old aircraft-carriers and buying new ones, has sent pilots to train with the American marines on the F-35B, which will fly from both American and British carriers.

Dispute resolution is a particularly lively part of the G2G market. Britain will soon play host to an arbitration court for Saudi Arabian disputes, helping to allay investors’ concerns about the Gulf state’s legal system. A growing number of countries, most with a history of British common law, want to become the preferred jurisdiction in their region or for a particular type of case. In 2011 Dubai’s International Financial Centre threw open its courts to disputes from any country, provided the parties agreed to be bound by its decisions. Courts in the British Virgin Islands hear a good share of all disputes involving international joint ventures.

The most radical form of G2G is the delegation agreement: the government of one country providing a public service in another, which in effect cedes part of its sovereignty. In 2003 the government of the Solomon Islands, concerned at rising violence and falling tax revenues caused by corruption, asked the Australian-led Regional Assistance Mission to the Solomon Islands (RAMSI) to take over law enforcement. RAMSI brought in more than 2,000 soldiers and other personnel and succeeded in establishing the rule of law.

No one knows the size of the G2G market. Governments rarely publicise deals, not least because they fear looking weak. And there are formidable barriers to trade. The biggest is the “Westphalian” view of sovereignty, says Stephen Krasner of Stanford University: that states should run their own affairs without foreign interference. In 2004 Papua New Guinea’s parliament passed a RAMSI-like delegation agreement, but local elites opposed it and courts eventually declared it unconstitutional. Honduras attempted to create independent “charter cities”, a concept developed by Paul Romer of New York University (NYU), whose citizens would have had the right of appeal to the supreme court of Mauritius. But in 2012 this scheme, too, was deemed unconstitutional.

Critics fret about accountability and democratic legitimacy. The 2005 Paris Declaration on Aid Effectiveness, endorsed by governments and aid agencies, made much of the need for developing countries to design their own development strategies. And providers open themselves to reputational risk. British police, for instance, have trained Bahraini ones. A heavy-handed crackdown by local forces during the Arab spring reflected badly on their foreign teachers.

Local governments, however, both have greater incentives to trade and face fewer barriers. Rapid urbanisation creates urgent practical problems for cities: in 2009 the urban population in developing countries stood at 2.5 billion, a number expected to double by 2050. And, unlike countries, cities are not hobbled by issues of sovereignty, points out Benjamin Barber, of City University of New York in his book, “If Mayors Ruled the World”.

Though its first partnership with the Chinese government—on the building of an industrial park in the city of Suzhou in the 1990s—took time to bed in, Singapore’s government is marketing its urban know-how. Singbridge, a firm it controls, is involved in five urban-development projects in China. It is helping to build a “knowledge city” in Guangzhou, where it provides social services and plays a part in protecting intellectual-property laws. C40, a group of mega-cities keen to cut carbon emissions, acts as a venue for policy exchange. Whereas countries struggle to agree on steps to control climate change, C40’s members have no sovereignty to be infringed by their deals.

When San Francisco decided to install wireless control systems for its streetlights, it posted a “call for solutions” on Citymart, an online marketplace for municipal projects. In 2012 it found a Swiss firm, Paradox Engineering, which had built such systems for local cities. But though members often share ideas, says Sascha Haselmayer, Citymart’s founder, most still decide to implement their chosen policies themselves.

Weak government services are the main reason poor countries fail to catch up with rich ones, says Mr Romer. One response is for people in poorly run places to move to well governed ones. Better would be to bring efficient government services to them. In a recent paper with Brandon Fuller, also of NYU, Mr Romer argues that either response would bring more benefits than further lowering the barriers to trade in privately provided goods and services. Firms have long outsourced activities, even core ones, to others that do them better. It is time governments followed suit.