"How could I have been so stupid as to let them proceed?" President John Kennedy asked his advisers more than once following the CIA's infamous fiasco at the Bay of Pigs in April 1961. After being shrouded in secrecy for almost 37 years, the CIA's own internal answer to that question has now been declassified. The agency's top-secret, post-mortem on what went so wrong with the U.S.-sponsored invasion of Cuba is a case study of the costs of secrecy -- both to the public's understanding of the CIA's furtive past and to the ongoing debate over its future.

For years, "The Inspector General's Survey of the Cuban Operation" has been something of a Holy Grail for historians, students and those who participated in the still-controversial effort to overthrow Cuba's Fidel Castro. Written by the late Lyman Kirkpatrick, a 20-year veteran of the U.S. intelligence community, the 150-page report represented the agency's only investigation of the swift defeat of the CIA-organized brigade of 1,500 Cuban exiles at the Bahia de los Cochinos on the southern coast of Cuba. Two days of fighting resulted in the deaths of 114 rebels and the capture of 1,200 men by Castro's armed forces. In its aftermath, historian Theodore Draper dubbed the invasion a "perfect failure."

How did this happen? Who was responsible? In their memoirs, Kennedy administration loyalists such as historian Arthur Schlesinger Jr. held CIA officials accountable for misleading the president about the prospects for success and ignoring his oft-stated position that the United States would not openly use force against Cuba. For their part, CIA officials fingered Kennedy, first privately and later publicly, for restricting airstrikes against Castro's tiny air force. As retired CIA officer and convicted Watergate burglar Howard Hunt put it in his 1973 memoir of the Bay of Pigs operation, "The Kennedy administration yielded Castro all the excuse he needed to gain a tighter grip on the island. . . . then moved shamefacedly into the shadows and hoped the Cuban issue would simply melt away." All the while, the CIA refused to declassify even a single word of the inspector general's report.

The debate about what went wrong at the Bay of Pigs was never merely an academic question. The debacle marked the first time that a CIA operation was exposed to the klieg lights of national scandal. Today, this history is relevant to the ongoing debate about U.S. policy toward Cuba, as well as current discussions about CIA covert operations to overthrow Iraqi leader Saddam Hussein.

It is not hard to understand why the agency buried this report as soon as it was completed in November 1961 -- and kept it secret until now. While it contains little that could be considered sensitive to U.S. national security, it is still the most brutally frank example of self-criticism that has ever surfaced from inside the agency. The report details the agency's "bad planning," "poor" staffing, faulty intelligence, "fragmentation of authority," mistreatment of the exile forces, and "failure to advise the President that success had become dubious."

Among Kirkpatrick's key conclusions: - The operation was expanded to make up for the agency's incompetence. Originally conceived as a "clandestine build-up of guerrilla forces" inside Cuba that would cost $4 million, the project ballooned into an overt paramilitary assault costing $46 million, in part because the CIA repeatedly bungled air drops to internal resistance leaders "with results that were mostly ludicrous or tragic or both." - The operation was predicated on the belief, held by CIA Deputy Director of Plans Richard Bissell, that "the invasion would, like a deus ex machina, produce a shock" inside Cuba and "trigger an uprising" against Castro. Yet, according to the inspector general, "the Agency had no intelligence evidence that Cubans in significant numbers could or would join the invaders or that there was any kind of an effective and cohesive resistance movement under anybody's control, let alone the Agency's, that could have furnished internal leadership for an uprising in support of the invasion." - CIA handlers treated the Cuban exile political leaders "like puppets" and some agents treated the exile forces "like dirt" engendering animosity and lack of cooperation. The CIA was "not likely to win many people away from Communism if the Americans treat other nationals with condescension or contempt." - What was supposed to be a covert operation became a major overt military project "beyond Agency responsibility as well as Agency capability." Due to "multiple security leaks," invasion planning became known to the Cubans and widely reported in the U.S. press. "Plausible denial," Kirkpatrick concluded, "was a pathetic illusion." - Yet, even as Kennedy insisted that the operation remain covert and curtailed the airstrikes to preserve deniability of the U.S. role, CIA officials misled the White House into believing that success was still likely. "At some point in this degenerative cycle," according to the report, senior CIA officials "should have gone to the President and said frankly: Here are the facts. The operation should be halted.' "

Cancellation, Kirkpatrick concluded, would have been a major embarrassment for the United States; the embittered exile forces would have spread the word of the lack of U.S. resolve. But aborting the operation would have averted failure, "which brought even more embarrassment, carried death and misery to hundreds. . . and seriously damaged U.S. prestige."

The Bay of Pigs constituted the United States's worst foreign policy blunder of the early 1960s. Internal accountability for the fiasco mandated a clear critique, not a whitewash. Yet, Kirkpatrick noted a "tendency in the Agency to gloss over CIA inadequacies and to attempt to fix all of the blame for the failure of the invasion upon other elements of the Government, rather than to recognize the Agency's weaknesses."

That "tendency" was reflected by the reaction within the CIA when Kirkpatrick submitted his findings to CIA Director John A. McCone and other top officials in November 1961. High-ranking officials rejected their own inspector general's report as a "malicious" attack on individual officials and a threat to the very future of the agency. Bissell, assisted by his deputy, Tracy Barnes, drafted a lengthy rebuttal to the "black picture" painted by Kirkpatrick. Bissell's response, titled "An Analysis of the Cuban Operation," was officially attached to the inspector general's report. It blamed failure on "political compromises" on the operation ordered by Kennedy.

(Decades later, in his posthumously published 1996 memoir, "Reflections of a Cold Warrior," Bissell conceded that Kirkpatrick's "critical comments were, or may have been, valid." Their validity, he wrote, "didn't make them any more welcome to me.")

In early 1962, McCone ordered the inspector general to provide him with the distribution list of all 20 copies of the report; most of them were retrieved and burned. The remaining copies were locked away in a safe in the director's office. "In unfriendly hands," one top CIA official wrote in a memo to colleagues, the report "could become a weapon unjustifiably {used} to attack the entire mission, organization, and functioning of the Agency."

In the name of protecting the institutional future of covert operations, the Bay of Pigs report simply vanished into the thin air of secrecy. Its findings, including a key recommendation that the CIA refrain from all large-scale paramilitary operations in the future, were never considered. No dissemination or discussion of the report took place within the CIA, the executive branch or Congress -- let alone in public.

Had the report fallen into "unfriendly hands" -- that is, shared with the American people -- the ensuing history of covert warfare might have been very different. The Bay of Pigs was but the first in a succession of scandals involving CIA efforts to unseat undesirable governments. From attempts to assassinate foreign leaders in the mid-1960s to the mining of Nicaragua's harbors in 1984 to recent operations in Iraq where the agency supported exiles who were executed after unsuccessful attempts to overthrow Saddam Hussein, the CIA repeatedly made itself the focus of international condemnation and national controversy.

Abuse of secrecy contributed to the recurrence of covert action scandals. By deep-sixing the inspector general's report and refusing to declassify it until now, the CIA deprived itself, the Congress and the public of critical information on a historical issue with contemporary resonance.

To be sure, George Tenet's CIA deserves credit for finally declassifying this controversial document. Hopefully, its release portends a new attitude toward disclosure and a much needed committment to accelerate the "openness" campaign launched by director Robert Gates in 1992, in which he ordered declassification of documents on covert operations of the past. Yet the CIA has moved to exempt some 100 million pages of documents in its massive secret archives from President Clinton's 1995 executive order that all national security documents more than 25 years old be declassified. The agency's traditional pathology of secrecy will be difficult to overcome.

"A wise man once said, An error doesn't become a mistake until you refuse to correct it,' " President Kennedy told the press after the Bay of Pigs invasion failed. There were, he said, "sobering lessons for us all to learn."

By holding history hostage to the dictates of secrecy, the CIA effectively refused to address its mistakes and denied the American people the ability to learn those lessons as well. Peter Kornbluh is a senior analyst at the National Security Archive, a public interest documentation center. He is editor of the forthcoming book, "Bay of Pigs Declassified: The Secret CIA Report" (New Press). CAPTION: Damage Control

Here are excerpts from the CIA's top-secret "Inspector General's Survey of the Cuban Operation," examining what happened at the Bay of Pigs in April 1961, along with a rebuttal, written by Richard Bissell, the agency's deputy director of plans and architect of the failed invasion. Both documents were declassified last month as the result of a Freedom of Information Act effort by the National Security Archive. KIRKPATRICK'S CONCLUSIONS AND RECOMMENDATIONS

1. The Central Intelligence Agency, after starting to build up the resistance and guerrilla forces inside Cuba, drastically converted the project into what rapidly became an overt military operation. The Agency failed to recognize that when the project advanced beyond the stage of plausible denial it was going beyond the area of Agency responsibility as well as Agency capability.

2. The Agency became so wrapped up in the military operation that it failed to appraise the chances of success realistically. Furthermore, it failed to keep the national policymakers adequately and realistically informed of the conditions considered essential for success. . . .

There were some good things in this project. Much of the support provided was outstanding . . . . A number of individuals did superior jobs. . . . But this was not enough.

It is assumed that the Agency, because of its experience in this Cuban operation, will never again engage in an operation that is essentially an overt military effort. But before it takes on another major covert political operation it will have to improve its organization and management drastically. BISSELL'S REBUTTAL

Inherent in this situation was a clear conflict between two goals, a conflict of the sort familiar in recent American history. One objective was that . . . . the Castro regime should be overthrown. The other was that the political and moral posture of the United States before the world at large should not be impaired. The basic method of resolving this conflict . . . . was . . . . attempting to carry out actions against Castro in such a manner that the official responsibility of the U.S. Government could be disclaimed.

If complete deniability had been consistent with maximum effectiveness, there would theoretically have remained no conflict of goals but in fact this could not be (and never is) the case. . . .

It is a fact of life that the use of force by the U.S. . . . . in an effort to influence the course of events in another country is deeply unpopular with an important body of opinion. Most of the damage to the political posture of the U.S. . . . . occurs when the action is identified . . . . with the U.S. Once this point of identification has been passed, it will almost invariably be true that ultimate failure not only means loss of the original objective but further exaggeration of the political damage. Ultimate success, on the other hand, is the only way partially to retrieve and offset the political damage. It is, therefore, only the part of wisdom to reassess an undertaking of this sort when identification of the U.S. Government with it has begun to occur or appears imminent and to determine at that time either to insure success or to abandon it. CAPTION: Former CIA inspector general Lyman Kirkpatrick, left, waits to testify before a commission about the agency's alleged domestic spying. (1975 photo) CAPTION: Former CIA deputy director Richard Bissell blamed the failure of the Bay of Pigs invasion on "political compromises." (1975 photo) CAPTION: The men of Brigade 2506 -- some of those who were sent to invade the Bay of Pigs in April 1961 -- are taken prisoner.