Osama bin Laden’s death at the hands of U.S. special operations forces is a major success in our country’s war against al-Qaeda. As a result of the Central Intelligence Agency’s interrogation program and the intelligence gained from detainees held in Guantanamo Bay, Cuba, a major fraction of al-Qaeda’s senior leadership has been captured or killed since 2001.

This conclusion was inadvertently reinforced recently by WikiLeaks’ illegal disclosure of more than 700 classified Defense Department files on Guantanamo Bay detainees. Their publication has harmed our security and cemented the impression among allies that America is incapable of keeping secrets. But the material also provides compelling evidence of the effectiveness of Bush administration anti-terror policies after the Sept. 11, 2001, attacks.

The illegally released files, in addition to a host of declassified documents on U.S. detention policies posted at www.rumsfeld.com, record complex decisions and excruciating trade-offs that President Bush and national security officials had to make. They document the deadly techniques and intentions of hundreds of Guantanamo detainees who still desire to return to the fight, and the labors of analysts and interrogators who enabled us to stop additional attacks.

Gathering intelligence is a painstaking process. Some information comes in an immediately actionable form. More often, the significance of particular data, whether provided by senior or lower-ranking operatives, does not become apparent for months or years, as happened with the years-long effort to patch together information that led our forces to bin Laden.

The classified files from Guantanamo Bay, particularly those on senior operative Abu Faraj al-Libi, contain clues about al-Qaeda’s courier network and even mention Abbottabad. Had bin Laden closely followed WikiLeaks’ release of these documents April 25, it is unlikely he would have been there when U.S. Navy SEALs descended into his compound days later.

The primary documents are the best public evidence yet of our systematic efforts to ascertain detainees’ links to terrorism and to weigh the dangers of their potential release or repatriation. In a war in which our nation’s terrorist enemies hide among civilians and do not carry their arms openly, the question is not whether some unfortunate detention mistakes are made but whether there are appropriate protections to detect errors and correct them when discovered.

The WikiLeaks files reveal that those detainees who could not be held on sufficient evidence were released or transferred to other countries. Among those who were judged not likely to be threats, and released, a sizable number returned to the cause they had claimed to disavow, including a man who, post-Guantanamo, served as deputy leader of al-Qaeda’s branch in Yemen; a senior Taliban commander; a propagandist for al-Qaeda’s online magazine; and multiple suicide bombers.

The classified papers give texture to terrorist plots that heretofore have been unknown to the public. They document al-Qaeda’s flurry of activity in the months after Sept. 11 to try to launch another, more vicious attack. One al-Qaeda commander vowed to detonate a nuclear bomb in America if bin Laden was captured or killed. Khalid Sheik Mohammed promised a “nuclear hellstorm.” The documents confirm al-Qaeda’s nuclear aspirations and attempts to purchase uranium. They chronicle a series of plots involving chemical and biological agents: cyanide released through air-conditioning systems in public buildings; natural gas ignited in rented apartments; and a radiological “dirty” bomb detonated in an urban center.

The documents should also disprove some myths that have dogged Guantanamo and the reputations of those who honorably serve there. The classified record, for example, confirms that three detainees who died in 2006 were suicides — not, as some have irresponsibly alleged, victims of brutal interrogations. The documents chronicle the lengths to which military guards accommodated Muslim religious sensibilities: sounding a call to prayer five times a day, providing halal meals and touching Korans only with gloves — not flushing them down toilets, as was falsely alleged by one U.S. magazine. There was no policy of mistreatment, much less torture.

The release of this classified information has compromised intelligence sources and methods, risking lives. The documents indicate, for example, that some al-Qaeda members turned and revealed large quantities of information about their colleagues. The cooperation of one Yemeni informant — since released — who fingered dozens of fellow detainees as members of al-Qaeda is now public, making him vulnerable to retribution.

The material in these files should have been the stuff of tomorrow’s histories, not today’s headlines. I co-sponsored the Freedom of Information Act in 1966 and have long believed that the free flow of information is vital to our democracy, but the desire for transparency must be balanced with national security interests. Bush administration officials have much to gain from the release of this sort of record, but for our country’s benefit it must come in the proper time and through proper channels.

Julian Assange hoped that his latest gamble with the lives of intelligence professionals, military personnel and terrorist informants would embarrass the U.S. government and inhibit its ability to strike our enemies. But the WikiLeaks documents, coupled with what we know about how bin Laden’s hiding place was discovered, may be among the clearest vindications yet of the Bush administration’s policies in the struggle to protect America and the free world from more terrorist attacks. They may prove the strongest arguments for keeping open the invaluable asset that is Guantanamo Bay.

Donald H. Rumsfeld, the author of “Known and Unknown: A Memoir,” was secretary of defense from 1975 to 1977 and 2001 to 2006.