The chief of Peru 's prisons has resigned after newspaper allegations that he betrayed the identities of two undercover agents working for the U.S. Drug Enforcement Administration .