PARIS—French prosecutors are investigating if the recent stabbing of two prison guards by an inmate was an act of terror, a spokeswoman for prosecutors said Tuesday, heightening scrutiny of France’s recent efforts to segregate prisoners deemed radical.

A 24-year-old man investigators identified as Bilal T. assaulted two prison guards with a makeshift knife on Sunday, severely wounding one of them, according to authorities.

Prosecutors...