The White House today said that the guarantee had been provided by the Iraqis in a diplomatic note to Washington.
The failure of Iraq's parliament to endorse a Status of Forces deal with Washington led to the complete exodus of all American troops from Iraq at the end of 2011.
Many of Obama's political opponents say their exit fostered a power vacuum which the Sunni group Islamic State of Iraq and the Levant (ISIL) has exploited in a rapid advance across the country.
"We can confirm that Iraq has provided acceptable assurances on the issue of protections for these personnel via the exchange of diplomatic note."
Obama last week announced the dispatch of up to 300 advisors to Iraq to assess the needs of the country's forces as they struggle to contain the advance of the Islamist fighters.
Earnest said the current situation differed from prevailing conditions at the end of 2011, making the less formal assurance of legal protections from Iraq more acceptable.
Earnest said the number of advisers contemplated for this mission was much smaller than the several thousand that had been contemplated for a post-Iraq force.
