Sen. Dianne Feinstein (D-Calif.) spoke on the Senate floor for almost 40 minutes about a controversy between the Senate Intelligence Committee and the CIA. Here are the highlights. (Sarah Parnass/The Washington Post)

After the CIA provided a massive cache of documents in 2009 to Senate staffers investigating the agency’s detention and interrogation program, the agency realized it might have a problem.

Within those documents, agency employees feared, were details that could lead to the exposure of CIA sources, former U.S intelligence officials said. Among them were top assets who had been recruited while being held at a secret CIA facility on Guantanamo Bay called “Penny Lane,” according to one of the officials.

So great was the concern that the sources’ identity would be disclosed that the CIA withdrew some of the documents from a special facility that had been set up for members of the Senate Select Committee on Intelligence.

The episode was an early indication of just how sensitive relations were between the CIA and the Senate staffers tasked with investigating one of the agency’s most controversial programs since the attacks of Sept. 11, 2001. The problems only intensified in January after the CIA notified the panel that it had again searched Senate computers in the belief that staffers had obtained documents beyond the scope of their investigation and that it had launched a security review to determine what had happened.

Sen. Dianne Feinstein (D-Calif.), the committee’s chairwoman, has denied that her staff members did anything wrong, saying they were entitled to the documents that were part of the CIA dump. The agency has referred the matter to the Justice Department.

In a speech Tuesday on the Senate floor, Feinstein said the CIA removed approximately 870 documents in early 2010 and an additional 50 several months later. Feinstein said she didn’t know why the documents were removed but added that they were taken without the knowledge of committee staffers.

It’s not clear whether the CIA documents that could have exposed sources were part of these batches. It was also unclear how an agency that prides itself on keeping secrets could have possibly supplied such information by mistake.

One former official, who like others spoke on the condition of anonymity given the sensitivity of the subject, said the effort to protect the agency’s sources began in 2009.

Two employees of the CIA’s Counterterrorism Center and a lawyer were assigned to scrub the documents for sensitive sources, including the asset who agreed to work for the CIA after his capture and transfer to Guantanamo, the official said.

The assets went through a recruitment program at Guantanamo that began in early 2003 and ended several years later. Some of those who took part in the program have provided key information to the CIA, helping the agency kill a number of top terrorists.

Although technically not part of the CIA’s rendition, interrogation and detention program, Penny Lane was overseen by the Counterterrorism Center. The spies are among the center’s most valuable assets.

As part of the investigation into the CIA’s interrogation program, the agency gave the Senate access to more than 6 million documents. The investigation has cost roughly $50 million.

The feud between the CIA and the Senate panel has threatened to derail the relationship between the agency and Feinstein, one of the CIA’s staunch defenders on Capitol Hill.

Some of her ire has been directed at Robert Eatinger, the CIA’s acting general counsel, who made the criminal referral to the Justice Department.

Eatinger was also deeply involved in legal issues surrounding the interrogation program and is mentioned by name at least 1,600 times in the committee’s report, according to Feinstein.

On Thursday, in a nearly unanimous vote, the Senate confirmed Caroline Diane Krass as CIA general counsel, replacing Eatinger.

Krass’s nomination had been held up in part by lawmakers angered by the dispute between the CIA and the Intelligence Committee.

During her confirmation hearing in December, Sen. Mark Udall (D-Colo.) pushed for a statement from President Obama indicating support for declassifying the committee’s 6,300-page interrogation report. Obama did so Wednesday, apparently clearing the way for Thursday’s vote to confirm Krass.