The U.S. is dismantling the prison system it established in 2003 in Iraq, to hold terrorism suspects. A new treaty with Iraq calls for all Iraqis held by the U.S. military to be released, or turned over to the Iraqis. Back in 2005, the U.S. prisons held 12,000 Iraqis, but that went up with the number of terrorist attacks in 2006-7, to 26,000. It has since gone down to 12,000. Of that number, the U.S. considers 5,000 of the prisoners to be hard core terrorists or criminals (mostly the former, but many of the hard core bad guys split their time between being gangsters and terrorists.
In addition to the prison system, the U.S. built a database of criminals and terrorists in Iraq. This includes people who help out, or are affiliated by blood or former employment. This data is considered military intelligence, and is only shared with the Iraqis when necessary. The database also includes many people who are now working for the Iraqi security forces. Some can be trusted, some, maybe not so much. The U.S. fears that when they turn their 5,000 hard core prisoners over to the Iraqis, some will be able to bribe, or intimidate, their way to freedom. How Iraq eventually deals with these thugs will tell a lot of how well the Iraqis will do in governing themselves.
Another problem is the traditionally harsh conditions of Iraqi prisons, and the brutal treatment by guards. The U.S. prisons are luxurious by these standards, and it's unclear if the Iraqis will continue to maintain these standards.