This piece originally appeared at the Guardian .

It had the air of Hollywood. On the night of 10 March 2004, James Comey, the nominee to lead the FBI for the next ten years , rushed to the hospital bedside of his terribly ill boss, Attorney General John Ashcroft.

There, he eventually confronted White House Chief of Staff Andrew Card and White House Counsel Alberto Gonzales, who were trying to get the pancreatitis-stricken Ashcroft to renew a still secret and illegal surveillance program on Americans' electronic communications. Neither Ashcroft nor Comey, then acting attorney general because of Ashcroft's condition, would reauthorize the program. When Gonzales authorized the program to go forward without a Justice Department certification, Comey threatened to resign, along with his staff and FBI Director Robert Mueller.

The threats worked: President Bush blinked, and Comey won modifications to the secret surveillance program that he felt brought it into compliance with the law. This event, now the stuff of DC legend, has solidified Comey's reputation as a "civil liberties superhero", in the words of CNN's Jake Tapper , and may be one of the reasons President Obama nominated him Friday to be the next director of the FBI.

There's one very big problem with describing Comey as some sort of civil libertarian: some facts suggest otherwise. While Comey deserves credit for stopping an illegal spying program in dramatic fashion, he also approved or defended some of the worst abuses of the Bush administration during his time as deputy attorney general. Those included torture , warrantless wiretapping, and indefinite detention.

On 30 December 2004, a memo addressed to James Comey was issued that superseded the infamous memo that defined torture as pain "equivalent in intensity to the pain accompanying serious physical injury, such as organ failure". The memo to Comey seemed to renounce torture but did nothing of the sort. The key sentence in the opinion is tucked away in footnote 8. It concludes that the new Comey memo did not change the authorizations of interrogation tactics in any earlier memos.

In short, the memo Comey that approved gave a thumbs-up on waterboarding , wall slams, and other forms of torture – all violations of domestic and international law.

Then, there's warrantless wiretapping . Many media reports describe that Comey's defiant stand at Ashcroft's bedside was in opposition to the warrantless wiretapping of Americans international communications. But we simply do not know exactly what Comey opposed, or why or what reforms he believed brought the secret program within the rule of law. We do, however, know that Comey was read into the program in January 2004.

While, to his credit, he immediately began raising concerns , the program was still in existence when the New York Times exposed it in December 2005 . This was a year and a half after Comey's hospital showdown with Gonzales and Card. In fact, the warrantless wiretapping program was supported by a May 2004 legal opinion (pdf) produced by the Justice Department's Office of Legal Counsel and signed off by Comey, which replaced the 2001 legal opinion Comey had problems with .

This, of course, raises the question: just what illegal surveillance program did Comey oppose so much he would resign over it? Last weekend, the Washington Post provided a new theory: the Marina program , which collects internet metadata. Now, the Senate has an opportunity to end the theorizing and find out what exactly Comey objected to. It's a line of questioning that senators should focus doggedly on, in light of the recent revelations in the Post and the Guardian.

The final stain on Comey's record was his full-throated defense of the indefinite military detention of an American citizen arrested on American soil. In a June 2004 press conference, Comey told of Jose Padilla, an alleged al-Qaida member accused of plotting to detonate a dirty bomb as well as blow up apartment buildings in an American city. By working for al-Qaida, Padilla, Comey argued , could be deprived of a lawyer and indefinitely detained as an enemy combatant on a military brig off the South Carolina coast for the purpose of extracting intelligence out of him.

It turned out that Padilla was never charged with the list of crimes and criminal associations pinned on him by Comey that day. When Padilla was finally convicted – in a federal court – in August 2007, it wasn't for plotting dirty bomb attacks or blowing up apartment buildings. Rather, he was convicted of material support of terrorism overseas. During his indefinite military detention, Padilla was tortured .

Everyone has a backstory, and the confirmation process should ensure the American public hears all relevant background information, both good and bad, when Comey appears before the Senate. Senators should insist that Comey explain his role during the Bush era and repudiate policies he endorsed on torture, indefinite detention, and illegal surveillance.

The new FBI director will be around for the next decade. We need one who will respect the constitution and the rule of law; not one who will use discredited and illegal activities in the name of justice and safety.