Washington and Kabul have agreed in principle to gradually transfer most Afghans in U.S. custody to the Afghan government .