The writer, a former ambassador to Brazil and Afghanistan, resigned as senior adviser to secretary of state Mike Pompeo in 2019

It has been said that “only truth” will save democracy in the US. To that I would add another corrective, “and the rebuilding of our institutions”. Because, alongside everything else, Donald Trump seriously eroded the functionality of government during his presidency.

In fact, the expectation that this can be restored with the stroke of a pen on January 20, as if the past four years was only an unfortunate interregnum, is mistaken.

The outgoing administration made a number of changes that may be difficult for the incoming administration to reverse. Some of these moves were highly visible — such as former secretary of state Mike Pompeo’s measures on Taiwan, Iran and Cuba.

But some of the most egregious took place largely outside the public gaze, transforming military oversight and civil rights mechanisms, and “burrowing” Trump appointees into the US bureaucracy.

In one example, Mr Trump sought in an October executive order to erode the independence of federal institutions with the creation of “schedule F” civil servants, who can be moved into positions for which their statutory job protections are eliminated. This puts them at risk of being fired at will — and of then being replaced by political appointees. Essentially, it threw the notion of a non-politicised federal workforce out the window.

It will not be simple for the US to correct course. Mr Trump caused significant harm to the integrity, systems and structures of federal government. This risks becoming an enduring legacy unless we examine carefully how US institutions were undermined and how to prevent that happening again.

Blaming individuals is insufficient. A non-partisan commission is required, similar to the 1947 Hoover Commission — which explored the reorganisation of the executive branch to meet the challenges of the postwar period; or the 9/11 Commission — which laid the foundations for an overhaul of US intelligence, border, and law enforcement systems. Both commissions addressed core deficiencies, and came up with practical solutions that were adopted. Today, if a more focused effort is preferred, bipartisan congressional committees, working with the Government Accountability Office, could look at the most affected agencies and recommend what needs be done to restore them.

There is a lot of ground to cover, as almost every government agency was affected by Mr Trump’s presidency.

At the Environmental Protection Agency, more than 1,000 employees left or were forced out in the first 18 months of the Trump administration. The EPA then rolled back regulations by running roughshod over reviews and science.

At the Department of Justice, attorney-general William Barr went out of his way to protect the president and his inner circle from investigations, while assisting those into political opponents. Senior officials who raised questions resigned, such as the head of the election crimes branch, or were fired, such as the attorney for New York’s southern district.

At national security agencies, the office of the director of national intelligence was politicised to the point that the integrity of its findings was openly questioned. The inspector-generals of the state department, the Pentagon and the intelligence community, who watch out for fraud and abuse, were fired. The inter-agency coronavirus task force was often silent in the face of the president’s misrepresentation of the pandemic, while a lack of transparency at top-level meetings hampered the US response.

We can also add Mr Trump’s desire to sabotage the postal service before the election to hamper mail-in voting; the Department of Homeland Security’s measures to pressure local governments during the Black Lives Matter protests; the move to transfer the Department of Agriculture’s researchers away from Washington to influence their output; and the use of the Department of Education to limit transgender and sexual assault victims’ rights.

These institutional disruptions had real consequences. Foreign assistance was used to extort political favours. Environmental protections for communities were struck down. The electoral system was undermined. Deployment of the National Guard came late when Congress was assaulted. And 400,000 Americans had died from coronavirus by the time Mr Trump left office.

We cannot just move on and simply turn the page on this. The harm to our institutions is unlikely to be reversed solely by the installation of a political leader who respects the functions of government. There needs to be a thorough review and reckoning. Otherwise, how will the American people be certain that the rule of law, transparency, and science will not be sidestepped again?

The US needs to feel confident it has government institutions that can withstand any future president who may be inclined to follow in Mr Trump’s footsteps. It is hard to see how our democracy can survive intact otherwise.