Dianne Feinstein has displayed no great enthusiasm for intelligence agency whistleblowers: only last June, she said leaks by Edward Snowden amounted to an “act of treason”. Yet it was with no sense of irony that the chairwoman of the Senate intelligence committee, in an extraordinary address on the floor of the US Senate, revealed that documents at the heart of the collapse of her committee’s relationship with the Central Intelligence Agency might have been provided surreptitiously by someone who wanted her staffers to find them.

The documents are known as the “internal Panetta review”, after the former CIA director who presumably ordered them. How they came into the hands of staff members working for Senate select committee on intelligence is a story of intrigue and double-dealing worthy of the agency itself. The review was a sensitive, internal assessment of the CIA’s detention and interrogation program, which included techniques such as water-boarding that most experts say amounts to torture.

So furious was the CIA to have lost control of the set of documents it believed should never have become public, it is thought to have been behind the anonymous briefers who told newspapers that congressional staff had obtained them by somehow hacking into its networks – a feat that would challenge even the most determined international cyber-terrorist.

The review seems originally to have been intended for CIA eyes only, but according to Feinstein, it appeared in 2010 on the computer network established by the agency at a secret location in Virginia to facilitate an extensive investigation by her committee into post-9/11 interrogation techniques. It was just one in a remarkable series of events that culminated with a printed-out portion of the review being slipped out of the custody of the CIA to the US Capitol, where it now resides in a safe in a second-floor Senate building, as an expanding controversy explodes around it.

How the crisis began

The origins of the crisis in confidence between the CIA and the Senate intelligence committee can be traced back to December 2005, when about 100 videotapes recording the CIA’s torture of terrorist suspects were destroyed. Members of committee, kept in the dark about the CIA’s controversial interrogation and detention program, knew nothing of the destruction of video tapes until it was reported in the media, and were furious. After discussions with then CIA director Michael Hayden, the committee began an initial investigation. Shocked by its “chilling” findings, which went far beyond the CIA’s misleading account of its torture program, the committee agreed to initiate a far more expansive investigation, an endeavour that would take three years and culminate in a damning 6,300-page report, which has yet to be made public.

From the start, the CIA was suspicious about the inquiry, and refused to allow documents to be made available to the committee in the normal way. Instead, a highly unusual system was devised – which lies at the centre of the battle now being waged between the committee and the CIA. The agency proposed that the committee’s work would be conducted in a kind of of no-man’s land, overseen but not interfered with by the agency.

Around mid-2009, a secure office space was created somewhere in northern Virginia, away from CIA headquarters in Langley. This location, described by Feinstein as “a CIA-leased facility”, was staffed by CIA information technology personnel and guarded by the agency. Under the agreement, those IT staff – mostly contracted workers – were “not permitted” to share information with other CIA officials, Feinstein said. The full text of the CIA-Senate agreement has not been released, but according to Feinstein, the idea was that congressional staff would have access to CIA material, but conduct their work behind a kind of firewall, with their own “standalone computer system” and separate “network drive” that was “walled off” and “segregated from CIA networks”.

Although they were working independently from the CIA, the Senate aides were nonetheless dependent upon the agency for the material that would form the basis of their investigation. Relevant CIA documents arrived having been vetted, several times over, by CIA contractors, hired to ensure the aides were not accidentally provided with the wrong documents. What began as a trickle of CIA operational cables, internal memos and emails, quickly turned into a flood of information appearing on their computer drives.

In total, there were 6.2m pages of CIA documents loaded onto the computers accessed by the Senate staff. None of them were indexed, or provided in a way that would make them easy to comprehend. The agency did, however, provide the congressional staff with a search tool, allowing them to use search terms to find and locate relevant material. “It was a true ‘document dump’ that our committee staff had to go through and make sense of,” Feinstein said.

Vanishing documents

The challenge of making sense of this huge repository of evidence was made significantly harder when the Senate staff realised some of the documents they had been authorised to view were disappearing. Almost 1,000 documents went missing from the computers in the CIA-guarded facility in February and May 2010, according to Feinstein. She said when committee staff complained about the disappearance of documents, CIA personnel initially denied any documents had been removed, then blamed IT contractors, and finally claimed – falsely – that the White House had ordered the removal of the documents.

Faced with vanishing evidence, the committee staff tried to keep backups. Whenever they came across documents they thought were important, or likely to feature in their final report, they routinely printed off copies or saved duplicates to their computer. Still, the disappearance of documents was an alarming development, and the issue was brought up directly with the then-White House counsel. Seemingly, it was put to rest after the CIA apologised and promised to not access the committee’s network again or remove its documents. “And that, as far as I was concerned, put the incident aside,” Feinstein said.

The ‘internal Panetta review’

It was in the middle of 2010 that the committee’s staff said they made their most startling and significant discovery amid the millions of CIA documents. Staffers querying the CIA database found a tranche of documents, some marked “deliberative” or “privileged”, which together formed drafts of the so-called “internal Panetta review”. It was kind of a shadow report, produced by CIA officials, apparently for the agency’s then director, Leon Panetta. Anonymous sources quoted in media reports have suggested the staff members may have entered the CIA’s networks without authorisation and obtained the material illegally – an allegation Feinstein strongly denies. “To be clear, the committee staff did not ‘hack’ into CIA computers to obtain these documents, as has been suggested in the press,” she told the Senate, adding: “We don’t know whether the documents were provided intentionally by the CIA, unintentionally by the CIA, or intentionally by a whistleblower.”

Either way, the documents were an explosive find: here was the CIA’s own internal assessment of its controversial interrogation techniques used against terrorist detainees. According to Feinstein, the internal Panetta review was “written by CIA personnel to summarise and analyse the materials that had been provided to the committee for its review”. In other words, it was an assessment of the evidence being combed through by committee staff, and the conclusions that might be drawn, which included “acknowledgement of significant CIA wrongdoing”, Feinstein said. The CIA has not confirmed why the review was ordered, or by whom. It took place in 2009 and 2010 and may have been partly connected to what was then an ongoing criminal investigation into torture by a Justice Department official. In any case, the Senate staff printed copies and made electronic backups of the Panetta review, realising it was an important find.

Still, the full significance of the documents would not become apparent for another three years.

Discrepancies in the CIA response

The work of the Senate team of staffers continued until December 2012, when the intelligence committee approved their huge study. The 6,300-page report into the CIA was a huge achievement, achieved through years of painstaking work – Feinstein said it was the most detailed and comprehensive report in the history of the Senate. It has yet to be made public, although the Senate committee is pushing for the findings, conclusions and the executive summary to be declassified by the White House in the coming months. When finally released, the report is expected to give a scathing indictment of the CIA’s detention and interrogation of terror suspects; providing a glimpse of the report’s findings on Tuesday, Feinstein described the CIA’s program as “un-American” and “brutal”. However, the CIA rejects many of the committee’s findings, and made its intentions clear in an official response to the committee in June 2013.

That formal rebuttal from the CIA was a significant turning point. According to Feinstein, the CIA formally disputed “important parts” of the committee’s findings that are “clearly acknowledged” in the Panetta review. “How can the CIA’s official response to our study stand factually in conflict with its own internal review?” she asked. Crucially, this review, an essential tool in the impending battle against the CIA, was among the 1,000 documents that had been mysteriously “removed” from the committee’s computers.

It was only after realising the discrepancy between the CIA’s official response and the Panetta review that congressional aides moved to ensure they had their own copy in a safe place. Conscious that the CIA had destroyed videos of past interrogations and removed documents from their computers, they decided to take a printed portion of the Panetta review out of the CIA facility in northern Virginia, without clearing it with the CIA, as was required under the arrangement agreed for their investigation.

Important questions remain unanswered. Did the congressional staff decide themselves to take the document without the CIA knowing? Did they seek approval? Were senators, up to and including Feinstein, aware of the decision to take the document from the CIA facility in apparent breach of the agreement? Feinstein did not elaborate in her statement. Whatever happened, the document appears to have been sneaked out, without the CIA’s knowledge, some time between 27 June 2013 and 15 January 2014.

Feinstein said the document was removed to the Hart Senate Office Building to “preserve and protect” crucial evidence she implied might otherwise have been disappeared by the CIA. “No law prevents the relocation of a document in the committee’s possession from a CIA facility to secure committee offices on Capitol Hill,” she said, adding that the document was redacted, transported safely and secured with restricted access. Still, the senator’s critics point out that squirrelling secret information out of the custody of a powerful and distrusted intelligence agency is not entirely distinct from the theft, months before, by Snowden from an NSA base in Hawaii.

The fallout

It was two months ago that the issue culminated in a confrontation between Feinstein and the current CIA director, John Brennan. Her committee, which only had a printed portion of the Panetta review in its possession, had formally requested the full report from the CIA. The agency refused to hand it over. According to Feinstein, Brennan informed her at a meeting on 15 January that, after concluding that the committee may have gained unauthorised access to the review, CIA personnel had conducted a “search” of the committee’s computers. The search revealed Senate aides had indeed accessed the confidential report, and Brennan said he planned further “forensic” investigation of the committee’s computers.

Feinstein and other senators on the committee were furious at what they argue was the CIA overstepping its constitutional powers by conducting an unauthorised, potentially criminal search of their staff computers. They perceived the CIA’s actions as nothing less than a potentially unlawful monitoring of their staff, gravely undermining the separation of powers that divides the legislative and executive branches of government. Feinstein has since written twice to Brennan, objecting to further CIA investigations, seeking an apology and demanding answers to 12 questions about how the agency came to inspect the computers. Days after the head-to-head meeting, the CIA’s inspector general, David Buckley, began his own investigation. According to Feinstein, Buckley then referred the matter to the Department of Justice.

By early March, the controversy was starting to emerge from the shadows. Senator Mark Udall, a veteran of combat against the intelligence community, had written an open letter to Obama, requesting his support and making clear the White House knew about the controversy. When Brennan appeared before an open hearing of the Senate intelligence committee, the CIA director’s comments were veiled and somewhat cryptic, but spoke to a seething resentment at the agency. “I am deeply dismayed that some members of the Senate have decided to make spurious allegations about CIA actions that are wholly unsupported by the facts,” Brennan said, intimating that the “legislative branch” may be the guilty party. On Tuesday, Brennan denied that the CIA was responsible for “hacking” into Senate staff computers, but did not specifically address whether the agency had gained unauthorised access to their machines.

In an intriguing twist, CIA officials might not be the only individuals facing criminal investigations. According to Feinstein, the acting general counsel of the CIA filed a crimes report to the Justice Department relating to actions by Senate intelligence committee members. Feinstein cast this move as an act of intimidation by the CIA, pointing out that the acting general counsel, who she did not name but is known to be Robert Eatinger, is heavily implicated in her committee’s report.

Before becoming general counsel of the CIA, Eatinger was “chief lawyer” of the very same counter-terrorism unit responsible for the agency’s interrogation and detention program and, Feinstein added, his name “is mentioned more than 1,600 times” in her committee’s report. The Democratic senator conceded she did not know the details of the allegations made by Eatinger against her staff. They could refer to the claims – denied by Feinstein – that her staff hacked into the agency’s computers to obtain the Panetta review. The allegations could also relate to the report’s removal from the CIA facility, a manoeuvre Feinstein has not denied, but argues was both lawful and justified to overcome an agency determined to escape the accountability.

What happens next?

Feinstein’s dramatic intervention on the floor of the US Senate has blown wide open a battle that had previously been simmering beneath the surface. The unseemly fight between the CIA and a Senate committee mandated to hold it to account will now be fought on several fronts, including in the media, where there has been a cascade of leaks from both sides. The CIA’s inspector general is conducting an inquiry into the agency’s allegedly unconstitutional searches of congressional staff computers, likely to take months to conclude. Meanwhile, the Department of Justice will be deliberating two competing sets of claims that allege criminal wrongdoing by both the CIA and Senate staff. The department’s decision about whether to lodge criminal charges in the affair – and, in which case, against whom – will be a crucial moment.

In the shorter term, attention is likely to fall on the White House, which has studiously avoided becoming embroiled, in public at least, in a controversy that harks back to the post 9/11 years of George W Bush. Obama ended the CIA detention program when he came into office and declared its interrogation technique amounted to torture. Now he will need to decide how much of the Senate’s excoriating report into the program should be made public – and when. That is as much a political choice as it is a legal one. Obama must pick between his hand-picked CIA director and the powerful chairwoman of the Senate intelligence committee whose support he needs to ensure the smooth passage of limited reforms he proposes to that other problematic clandestine organisation: the National Security Agency.