A U.S. court has sentenced a former CIA contractor to more than eight years in prison for assaulting an Afghan prisoner who later died .