Amid the tragedy of the pandemic, one marvel is hiding in plain sight. The development of a working vaccine against SARS-CoV-2 is happening at breakneck speed, a triumph of ingenuity and efficiency that has few precedents.

However, even if researchers and pharmaceutical companies succeed on the scientific front, policymakers will then have to pick up the baton. Unfortunately, if the poor management of the pandemic in Europe and the U.S. is any guidance, the potential for policy failure is enormous.

The race for a vaccine remains uncertain, as no company has yet completed a large-scale randomized controlled (“Phase 3”) trial to ensure safety and effectiveness. However, considering that the new coronavirus only began circulating among humans a year ago, the progress that has been achieved so far is astonishing.

Scientists from the U.K. to China to the U.S. have swiftly reoriented their existing research programs to focus on a SARS-CoV-2 vaccine. Tens of new vaccine candidates are currently being tested. Pharmaceutical companies have thrown their organizational and financial weight behind these efforts. Pfizer Inc. is hopeful it will be able to announce a working vaccine as early as November.

Governments deserve credit for supporting these advances through public subsidies. But that was always going to be the easy part. The real challenge now is managing expectations amid growing anxiety and impatience. Looking ahead, it will also be up to policymakers to ensure a vaccine is distributed in a timely and fair way, and that pseudoscientific theories do not prevent people from accepting inoculation.

Already, some politicians have failed to show the necessary restraint in their communication. Donald Trump has repeated several times that a vaccine would be ready before the U.S. presidential election. Giuseppe Conte, Italy’s prime minister, said in an interview last month that the first shots could be delivered in December. In both cases, scientists had to step in to rebuke these statements.

Rather than engaging in cheap electioneering, our political leaders should be focusing on an efficient vaccine rollout plan. There are two risks in particular that will require careful handling: In the short term, there will be enormous pressure from many individuals to obtain the initial doses, which will inevitably be scarce. After a few months, the challenge will be getting enough of the population to receive the immunization, so as to achieve “herd immunity.” The danger is that many will avoid vaccination as they fear it is not safe.

These two threats demand, first of all, that the development of vaccines is shielded from political pressure. It’s one thing to cut unnecessary bureaucracy, it’s another to gamble on safety — and scientists are best placed to distinguish between the two. Reports that some vaccine trials have been halted because of health concerns may have been disappointing, but they are a sign that companies are taking the process seriously. Politicians should not stand in their way. This is essential if we are to avoid catastrophic accidents after a rollout, which could cause both health issues and a dangerous backlash against immunization.

Governments will also have to do their part through a combination of impeccable logistics and skillful communication. Leaders must make decisions about who will get this shot first — for example health workers and those at greater risk of suffering from the worst consequences of the virus. There will need to be clear explanations for those who will be initially denied a shot, even as the pandemic continues to claim lives.

The production, storage and distribution of the vaccine must be seamless. This will likely require setting up vaccination centers with appropriate cooling facilities and training a sufficient number of staff to oversee the process. There will also need to be communication campaigns to promote the vaccine among the public.

Still, people must understand that even if the vaccine is ready, life will not get back to normal for some time. That means we will need to live with face masks and some restrictions for a while longer.

Some governments, for example in Germany, seem to have devoted time and energy to planning these crucial steps. As Guido Rasi, executive director of the European Medical Agency, said in an interview last week, all countries must similarly do so quickly.

Science is doing wonders in this pandemic. Politicians cannot let these efforts go to waste.

Bloomberg columnist Ferdinando Giugliano writes on European economics.