Bird flu is deadly, but it generally does not spread easily from human to human. Now, scientists in Wisconsin and the Netherlands have created a strain of bird flu that can spread through the air — a virus that could kill millions if terrorists managed to create a batch and weaponize it. This raises a thorny question: Should medical journals be allowed to print the details of how the virus is made?

A government advisory board has urged two scientific journals to omit some of the specifics about the virus — the first time it has issued such a request. Supporters insist that the board’s request is a much-needed precaution that could save millions of lives. But critics say that the government is engaging in censorship and interfering with academic freedom.

It is a classic clash of liberty versus security. The question is such a difficult one because whichever course the government takes carries risks and costs. Which option — blocking publication or allowing it — is the lesser of two evils?

It is not hard to see why the government is seeking to keep details of the virus out of print. The H5N1 bird-flu virus rarely infects humans. But when it does cross the species barrier, the mortality rate can be as high as 60%. If terrorists were able to use the new research to make a contagious strain of the virus, the result could be a real-world version of the movie Contagion. That is: worldwide panic and mass deaths.

The government is trying to avoid this by urging scientific journals to describe the virus only in general terms and keep out the sort of details that could be used to replicate it. The National Science Advisory Board for Biosecurity, which was created after the deadly anthrax attacks of 2001, asked the journals Science and Nature to be selective when they published articles on the highly contagious strain of H5N1.

So what’s the problem? Critics say the government is engaging in censorship by telling the media what it should and should not write about. It sets a terrible precedent, they argue, for the government to set itself up as a national-security censor. The next time, they say, the government will try to prevent the publication of information that is far less dangerous than contagious bird flu.

Press-freedom watchdogs have a point: the government often trots out national security to try to intimidate the press into not doing its job. A few years back, the New York Times was about to expose the NSA spying program, in which the government was intercepting emails and phone calls without getting court orders. President George W. Bush called the paper’s top brass down to the White House and warned them that exposing the program would compromise national security. The Times went ahead and published — and we are all still here.

The skeptics raise another important concern: the long tradition of scientific openness. Research science works by having experiments reported publicly, so other scientists can test the findings — and build on them with their own research. This tradition breaks down when the government puts a shroud of secrecy on some research.

The editor of Science has suggested that his journal might agree to withhold the information the advisory board is worried about — provided that the government creates a system that would allow legitimate scientists to access the full results.

That sounds like the right answer. We should be wary of government attempts to stop the media from publishing information. But in extreme cases, it may be necessary — and weaponizable highly contagious bird flu could be just such a case.

What factors should we be looking for in considering whether the government should try to stop publication? First, the threat of harm should be real and it should be truly extraordinary. That is a test the contagious strain of H5N1 seems to meet. Second, it should be clear that the government has no ulterior motives — that it is acting to protect the nation, not to advance a political agenda.

That can be a tough thing to evaluate — governments that use national-security arguments for political goals are quick to deny that they are doing so. The best check on this sort of politicization is making sure that anyone who feels pressure from the government not to publish or speak is able to challenge the policy in court. Judges are in the best position to balance risks of serious harm against the infringement on speech — and to determine whether the government is crossing any First Amendment lines.

Those who oppose the Scientific Advisory Board’s decision are right that we must be wary whenever the government tries to suppress speech. As Supreme Court Justice Potter Stewart said, censorship is “the hallmark of an authoritarian regime.” But the board’s defenders are right that ultimately the government has a duty to protect the public from the most serious threats. They can cite Supreme Court Justice Robert Jackson, who noted that the Constitution is not a suicide pact.

Indeed academic freedom is crucial and inarguable but national security is the primary role of governments. So to prevent the disease from spreading fast, the results of the analysis should be kept totally secret and the journals and the authors, have to be very cooperative.