Rami Malek will produce and star as an undercover FBI agent in the Universal film “American Radical.”

Universal has optioned the rights to the memoir “American Radical” written by Kevin Maurer and Tamer Elnoury. He’s going to portray an operative who infiltrates a small, Al Qaeda-directed cell of terrorists.

Sam Esmail will direct. Esmail and Chad Hamilton will produce for Esmail Corp. and Anonymous Content, respectively. The three previously collaborated on USA’s “Mr. Robot.”

Executive vice president of production Mark Sourian and creative executive Lexi Barta will oversee the film for Universal.

The book’s full title is “American Radical: Inside the World of an Undercover Muslim FBI Agent.” Elnoury was a longtime undercover agent who joined the counter-terrorism unit after Sept. 11, 2001. In his book, he details his experience infiltrating and bringing down a terror cell that was based in United States.

“Mr. Robot” will return for a fourth season in 2019. Malek portrays a cybersecurity hacker who joins an underground anarchist group. He will next be seen next in “Papillon,” which Bleecker Street opens on Aug. 24, then as the late Freddie Mercury in “Bohemian Rhapsody,” which Fox debuts on Nov. 2.

Email is represented by CAA, Anonymous Content, and McKuin Frankel Whitehead; Malek is represented by WME, Brillstein Entertainment, and Sloane, Offer, Weber and Dern; and the memoir was represented by WME.