Michael Cohen, the former personal attorney to President Donald Trump, asked a Manhattan federal judge late Monday night to order his immediate release from prison, claiming that he had been taken back into custody in retaliation for a planned book detailing his work as the president’s fixer.

In a petition for habeas corpus, Cohen’s attorneys said that officials with the federal Bureau of Prisons had conditioned his transition to home confinement on an “unconstitutional demand” that he not engage with “any kind of media” and stay off of social media platforms.