Former CIA Director Leon Panetta, in his new book, describes being summoned to a White House meeting and cussed out by President Obama’s chief of staff after he agreed to give the Senate intelligence committee access to documents chronicling the agency’s use of torture during the Bush administration.

“The president wants to know who the fuck authorized this release to the committees,” Rahm Emanuel, who served as Obama’s chief of staff and enforcer in 2009 and 2010, is quoted as saying while slamming the table for emphasis.

He describes being micromanaged and second-guessed by White House aides who seemed focused on political appearance over substance. White House pushback on the Senate torture inquiry, which came despite Obama’s pledge to run the most transparent administration ever, is in that way typical – as is Emanuel’s profane tirade. (Emanuel, as I’ve written before, saw even the most deeply moral and legal decisions in purely political terms.)

She requested access for her staff to every operational cable regarding the program, a database that had to be in the hundreds of thousands of documents. These were among the most sensitive documents the agency had. But Feinstein’s staff had the requisite clearances, and we had no basis to refuse her.

Still, I wanted to have some control over this material, so I proposed a deal: Instead of turning over the documents en masse to her staff, we would set up a secure reading room in Virginia. Her staff could come out to the secure facility and review documents one by one… I thought it was a sound compromise and a good deal for the agency, so I didn’t think to clear it with the White House. I soon found out they saw it differently.

Here’s what he said happened next:

I was summoned down to a meeting in the Situation Room, where I was told I would have to “explain” this deal to Rahm… It did not take long to get ugly.

“The president wants to know who the fuck authorized this release to the committees,” Rahm said, slamming his hand down on the table. “I have a president with his hair on fire, and I want to know what the fuck you did to fuck this up so bad!”

Panetta describes then-director of national intelligence Dennis Blair as coming to his rescue, asking Emanuel:

“If the president’s hair is on fire,” he retorted, “I want to know who the fuck set his hair on fire.”

Blair was fired in May 2010 and replaced by James Clapper, with sources citing as a main reason “the mutual distrust between the White House and members of Mr. Blair’s staff.” John Brennan, who was then Obama’s counter-terrorism adviser and is now CIA director, was one of the people Panetta implied had set the president’s hair on fire.

This new account from Panetta has particular relevance today, said Katherine Hawkins, national security fellow at pro-transparency group Open the Government.

“It seems that the White House’s and Director Brennan’s opposition to Senate Intelligence Committee oversight over the torture program began sooner than we knew,” she wrote in an email. “This explains why, over six months after the President promised to support release of the torture report, the White House and CIA are still insisting on unacceptable redactions. It also explains why there have been no consequences for Brennan’s role in the unlawful search of Senate computers.”

Panetta, who has experience in both the executive and legislative branches, wouldn’t explicitly say whose side he is on in the constitutional standoff between the CIA and the Senate, but the way he phrased it suggested his sympathy is not with Feinstein.

When trust breaks down, as it did in the spring of 2014 when Chairman Feinstein accused the CIA of spying on her staff conducting the review, it erodes the effectiveness of our intelligence operations and inhibits sound congressional oversight. The focus turns to finger-pointing and investigating past actions rather than to cooperating to protect the national security.

Earlier in the Obama presidency, Panetta had agreed with CIA officials who had a role in torture that the Justice Department memos declaring it legal should not be made public. Emanuel agreed with him, he now writes. Both were eventually overruled by Obama and the memos were released.

Panetta notes that his defense of the torturers won him cred from his staff.

[M]y defense of the CIA’s position helped make clear that I was willing to fight for my new colleagues. That went a long way toward establishing my leadership internally.

And Panetta writes that while torture did not directly lead to the death of Osama bin Laden, it may or may not have helped — an ambigous statement that even so is still not supported by the evidence.