President Obama praised CIA agents Monday during a speech at their Langley, Va. headquarters, calling them "indispensible" just days after releasing Bush administration memos outlining interrogation tactics practiced by the agency.

"I know the last few days have been difficult," Obama told CIA staff and agents. "I need to be clear: we will protect your identity and security as you vigorously pursue your missions."

"What makes the U.S. special and what makes you special is precisely the fact that we are willing to uphold our values and our ideals even when it's hard, not just when it's easy," the president said. "So yes, you've got harder jobs. And so do I. And that's okay. Because that's why we can take such extraordinary pride in being Americans."

The president called the CIA "an indispensible tool -- the tip of the spear" in thanking the agency for its intelligence support as his administration begins to reshape its foreign policy after almost 100 days in office.

Obama pledged to protect the identities of the agents and keep their intelligence and analysis confidential before drawing applause on a line about giving credit where it's due.

"You don't get credit when things go good, but you sure get some credit when things don't," Obama said to applause.