FEW Brazilians get through a day without eating beans. They gobble up 3.4m tonnes a year, a ladle a day for each person. So when prices rise, as they did by a fifth recently after bad weather damaged the domestic harvest, they gripe. On June 24th the government suspended its 10% tariff on imports. Blairo Maggi, the agriculture minister, hopes that Chinese and Mexican farmers will fill the leguminous gap.

In a country prone to protectionist folly, Brazil’s market-minded response to the bean shortage is refreshing. It may portend a greater opening to trade. Though Brazil is the world’s ninth-largest economy, its trade is just 1.2% of the global total; in only five countries does trade account for a lower share of GDP. Brazil’s new centrist government sees exports as one way to pull the country out of its deep recession. Politicians and company bosses are starting to regard trade as a way to boost productivity, and thus growth, in the long run, too.

Of late, the government has tucked into liberalisation as if it were an appetising feijoada (bean-and-meat stew). In April Brazil signed an investment treaty with Peru that, if ratified, will allow firms from both countries to compete freely for government contracts. In June Brazil asked to join 23 members of the World Trade Organisation (WTO) in negotiating a pact on trade in services. The government is preparing legislation to raise the ceiling on foreign ownership of airlines from 20%. Mr Maggi talks of lifting a presidential decree from 2010 that bars foreign ownership of farms, which discourages foreign investors from lending to farmers. “All the taboos have gone,” says Ricardo Mendes of Prospectiva, a consultancy that specialises in trade policy.

Brazil has been a reluctant globaliser. Ever since the 1950s, when many poor-country governments championed domestic production as a substitute for imports, Brazilian industry has been shielded from foreign competition. The left-wing Workers’ Party (PT), which governed from 2003 until May this year, continued the cosseting. From 2000 to 2013 Brazil was a party to a tenth of all disputes filed at the WTO, usually as the plaintiff. During that period it erected more trade barriers—from tariffs to subsidies to local-content rules—than most other countries.

Attitudes started to shift in 2012 as the economy weakened, prompting firms to seek growth abroad. Dilma Rousseff, the PT president, began to liberalise trade after her re-election in 2014. The government has enacted two dozen pro-trade measures and just three restrictive ones since the start of 2015, according to the WTO.

Michel Temer, who became acting president in May after Ms Rousseff was forced to step aside while the Senate conducts an impeachment trial against her, is going further. Although his Party of the Brazilian Democratic Movement is close to competition-shy industry, he has a liberal streak. He plans to dismantle local-content rules in the oil-and-gas sector (which force companies to use substandard, and often more expensive, domestic technology). He replaced Ms Rousseff’s liberalising trade minister but kept the ministry’s technocrats to avoid disrupting negotiations.

Waxing and waning: Brazil's economic woes, in charts On June 24th Mr Temer renewed a bilateral automotive arrangement with Argentina for four years (rather than the usual one). For the first time the two countries, the main constituents of Mercosur, a South American trade group, have agreed in principle to free trade in cars and car parts from 2020. Brazil’s new trade minister, Marcos Pereira, wants to conclude an ambitious trade deal with Mexico by the end of 2016. Mr Temer took Apex, the export-promotion agency, away from Mr Pereira and gave it to the foreign minister, José Serra, an economist. It has a new mission, “inserting Brazil into global supply chains”, which implies greater openness to imports.

Curb your enthusiasm

Brazil opened partially in the early 1990s but later attempts to liberalise fizzled. The government of Fernando Henrique Cardoso signed ten bilateral investment treaties in the late 1990s and ratified none. A Free-Trade Area of the Americas, supported by Mr Cardoso, was blocked by his successor. Industries will not give up protection without a fight.

Another worry is that Brazil’s move towards openness comes at a time when its biggest trading partners are moving in the opposite direction. It is safe to say that the European Union’s first priority will not now be to conclude its trade deal with Mercosur. One presidential candidate in the United States is a raging protectionist; the other is ambivalent. This makes Brazil’s change of attitude all the more welcome. Brazilian businesses will not become competitive unless they compete, acknowledges Mr Maggi. It has taken Brazil a long time to learn that lesson.