As long as Germany’s economy was recovering well from the 2008 global financial crisis, policymakers had a coherent rationale for fiscal austerity. Rejecting other eurozone countries’ constant urging that it undertake stimulus, Germany enshrined the national commitment to budget discipline in the 2009 “debt brake”, which limits the federal structural deficit to 0.35% of GDP, and in the subsequent schwarze null (“black zero”) policy of fully balancing the budget.

More German public spending, stimulus advocates argued, would reduce the country’s huge current account surplus and fuel demand that would help other eurozone members, especially in southern Europe. But with Germany experiencing low unemployment and relatively strong growth, policymakers in Berlin were understandably afraid such measures would cause the domestic economy to overheat.

Today, however, overheating is no longer the concern. German GDP growth turned negative in the second quarter, reflecting weakness in the trade-sensitive manufacturing sector. And if third-quarter growth also turns out to have been negative, the economy will officially be in recession.

Slower income growth will depress tax receipts and thus reduce Germany’s budget surplus. But authorities should certainly not take steps to preserve the surplus. On the contrary, the government should respond to any slowdown by increasing spending and/or cutting taxes. In particular, it should spend more on infrastructure maintenance and modernisation, and it could cut payroll taxes.

The legal constraints of the debt brake may limit the size of the stimulus, but they still leave some space. Moreover, the full black zero could be set aside in case of recession. Or it could be reinterpreted to allow for deficit spending that goes to investment, while still balancing current expenditure.

After all, investment in infrastructure does not constitute borrowing against the future in a true economic sense. And negative interest rates – the government can currently borrow for 10 years at a rate of -0.5% – strengthen the case for investing in public projects with positive returns. Such projects include roads, bridges and railroads, as well as soft infrastructure such as 5G mobile networks.

As John Maynard Keynes once said: “The boom, not the slump, is the right time for austerity at the Treasury.” If the German government allows the country’s philosophical tradition of ordoliberalism to stop it from running a fiscal deficit at a time of recession, its leaders will join the club of foolishly pro-cyclical politicians.

They would not lack for company. Historically, many developing countries that export commodities have pursued pro-cyclical fiscal policies during a commodity boom, before being forced to retrench when prices fell. Greece, meanwhile, ran big budget deficits during its growth years from 2003-08, and then had to cut back sharply in the decade after the euro crisis erupted in 2010. Republicans in the United States also have a pro-cyclical track record, undertaking fiscal stimulus when the economy is already expanding, as with Donald Trump’s 2017 tax cut, and rediscovering the need to fight deficits when recession hits (as in 1990 and 2009).

Other countries, however, have moved impressively towards more countercyclical fiscal policies since the turn of the millennium. Germany could follow the South Korean government’s new path. After 20 years of overall budget surpluses, authorities are substantially increasing spending to counter slower economic growth.

Fiscal policy should of course be guided by other goals, in addition to countercyclicality. One is a long-run path of sustainable debt. Recognising that some countries’ excessive austerity in the previous recession was a mistake does not require adopting the position that governments can run up debt without limit, as some observers now seem to believe.

After all, Germans’ much-maligned attitude toward debts and deficits deserves more sympathy than it gets. Ahead of the establishment of the euro in 1999, German citizens had been skeptical of the assurances provided to them in the form of the Maastricht fiscal criteria and the “no-bailout clause”. Their scepticism proved prescient. As Germans point out, the 2010 euro crisis would not have happened had Greece, after joining the euro, maintained the fiscal discipline called for under the stability and growth pact, and followed Germany’s lead in reforming labour markets and keeping unit labour costs in check.

On the other hand, avoiding a path that causes the debt-to-GDP ratio to explode (as in Greece) does not require avoiding deficits at all times. There is a lot of territory between those two extremes.

The composition of spending and taxes is also critical in fiscal policy. Governments can use both levers to address environmental goals, for example. In fact, some see Germany’s renewed commitment to reducing carbon dioxide emissions by 2030, in order to achieve the goals of the 2015 Paris climate agreement, as a battering ram against black zero. On 20 September, the German government announced €54bn (£48bn) of spending measures to cut emissions. In the US, such a package would be called a green new deal.

Spending on such priorities as energy and the environment can be useful. But getting serious about CO 2 emissions and other environmental goals does not have to mean larger budget deficits. Governments can strengthen the budget by eliminating fossil-fuel subsidies and raising taxes on emissions, or by auctioning limited emission permits. Or they can redistribute the resulting revenues to achieve other goals. The important point for climate policy is to increase the price of carbon. Doing so is orthogonal to an intelligent choice between fiscal expansion and fiscal austerity.

Governments should base that policy choice on the countercyclical criterion and the sustainability of public debt. The US has made some bad fiscal choices, in particular by cutting taxes for the rich at the peak of the business cycle. German policymakers should not make the symmetric mistake of preserving the country’s budget surplus as the economy risks sliding into recession.

• Jeffrey Frankel is a professor at Harvard University’s John F Kennedy School of Government. He served as a member of President Bill Clinton’s Council of Economic Advisers. © Project Syndicate