CBS TV Studios is in final negotiations to bring 'A Higher Loyalty' to the small screen with Billy Ray and Alex Kurtzman attached.

James Comey's memoir A Higher Loyalty is on its way to television.

CBS Television Studios has landed TV rights to the New York Times best-selling book, with writer Billy Ray (Captain Phillips) attached to pen the script and Alex Kurtzman (Star Trek: Discovery) and Shane Salerno on board to executive produce. CBS TV Studios declined comment.

Kurtzman's studio-based Secret Hideout banner and Salerno's The Story Factory are attached to exec produce the miniseries, which landed at the studio with a sizable series commitment penalty. An outlet has not yet been determined, though it could air on the studio's affiliated outlets of CBS All Access, Showtime or even broadcaster CBS. Then again, the studio — which has been making a concerted push on streaming — could opt to sell it elsewhere. A Higher Loyalty landed at CBS TV Studios in a competitive situation with multiple outlets pursuing the book from Comey, whom President Donald Trump fired as FBI director in May 2017. (Comey was appointed as the seventh head of the FBI by President Barack Obama in 2013.)

A Higher Loyalty takes its title from the loyalty Comey claims Trump demanded during the Michael Flynn investigation.

Ray, who earned a best picture Oscar nomination for Captain Phillips, also penned the journalism movie Shattered Glass and Breach, with the latter having filmed inside the FBI's headquarters.

Kurtzman, whose Secret Hideout inked a sizable new overall deal with CBS TV Studios in June, recently earned a series pickup at CBS All Access for a Patrick Stewart-led Star Trek series. Secret Hideout's Heather Kadin will also exec produce A Higher Loyalty.

CAA and The Story Factory and Comey's D.C. lit agents Javelin brokered the deal.

Deadline was the first to report the news.