WASHINGTON - Gina Haspel, Donald Trump’s nominee to lead the CIA, vowed Wednesday that the spy agency will not engage in torture of detainees under her watch, even if ordered by the president.

Facing opposition over her role at a secret CIA prison in Thailand in 2002 where Al-Qaeda detainees were waterboarded, Haspel made clear she would not support such activity in the future if she is confirmed as CIA director.

“Having served in that tumultuous time, I can offer you my personal commitment, clearly and without reservation, that under my leadership CIA will not restart such a detention and interrogation program,” she told the Senate Intelligence Committee.

“In retrospect it is clear... that CIA was not prepared to conduct a detention and interrogation program.” But Haspel refused to condemn the 2002-2005 program, during which scores of Al-Qaeda suspects were captured, whisked to “black sites” at secret locations around the world, and subjected to brutal interrogations that for some included repeated waterboarding.

Pressed on why she did not object at the time, Haspel said she and colleagues were following orders. She also said the program as a whole produced “valuable information” that helped disrupt more plots after the September 11, 2011 attacks, though would not say whether that was a result of waterboarding and other severe techniques.

“Like all of us who were in the counter terrorism center and working at CIA and those years after 9/11, we all believed in our work. “We had been charged with making sure the country wasn’t attacked again, and we had been informed that the techniques in CIA’s program were legal and authorized by the highest legal authority in the country and also the president.”

“I think we did extraordinary work. To me the tragedy is that the controversy surrounding the interrogation program... has cast a shadow over what has been a major contribution to protecting this country.

Haspel said that the CIA is now bound by the Defense Department’s Army Field Manual, which specifically forbids torture like waterboarding.

“I support the higher moral standard that this country has decided to hold itself to. I would never, ever take CIA back to an interrogation program,” Haspel told the panel.

“I support the law. I would not support a change in the law,” she said.

Democrats worry that Trump and top aides are not opposed to the use of outlawed techniques in interrogations, and Trump has appeared to extol Haspel’s record in the program.

Pressed over whether she would resume an interrogation program, and allow torture, if ordered by Trump, she said she would not.

“My moral compass is strong. I would not allow CIA to undertake activity that I thought was immoral, even if it was technically legal. I would absolutely not permit it.”

“America is looked at all over the world as an example to everyone else in the world, and we have to uphold that. And CIA is included in that,” she added.

In her first appearance ever before the broader public, Haspel, 61, was greeted by protestors in the Senate chamber branding her a torturer and demanding senators reject her.

In her testimony, she bared some details about a 33 year career at the spy agency, almost all of it spent in clandestine operations.

After growing up around the world as the daughter of a member of the US airforce, she was drawn to the CIA by the excitement it offered, and picked up the techniques of being an undercover operative very quickly after she joined in 1985.

“I excelled in finding and acquiring secret information that I obtained in brush passes, dead drops, or in meetings in dusty back allies of third world capitals,” she said.

“I recall my first foreign agent meeting was on a dark, moonless night with an agent I’d never met before. When I picked him up, he passed me the intelligence and I passed him extra money for the men he led.”

“It was the beginning of an adventure I had only dreamed of.”

While a number of Democratic senators said they would still not support her as CIA director, is appeared that she had enough support to be approved by the panel and then the entire Senate in votes expected over the next two weeks.

She said she was proud of having broken through barriers to women rising in the agency’s ranks, and defended her qualifications to be the United States’ top spy.

“I don’t need time to learn the business of what CIA does. I know CIA like the back of my hand. I know them, I know the threats we face, and I know what we need to be successful in our mission.”