Fox has tapped British comedian Nick Frost for its comedy pilot “Sober Companion,” Variety has learned.

Frost, whose work includes his partnerships with Simon Pegg and Edgar Wright on films like “Hot Fuzz” and “The World’s End,” will play Robert, an intelligent and driven attorney who also happens to be an addict. So drunk that he does a faceplant in court, Robert is assigned a sober companion for the next 90 days. He must either stay away from everything he deems to be fun — or lose his job and probably his liberty.

Justin Long will play Robert’s eponymous on-the-wagon escort. The cast also includes Pete Davidson and Ally Maki.

Jennie Snyder Urman, who is writing and exec producing with David S. Rosenthal, sold the project to Fox last summer as part of her overall deal with CBS Television Studios.

There is no word yet as to whether Frost, who penned the 2011 alien movie “Paul” with Pegg, would write any episodes if “Sober Companion” gets picked up to series, ala Greta Gerwig’s deal with CBS’s “How I Met Your Mother” spinoff.

Frost is repped by UTA and Hamilton/Hodell in the U.K., as well as Think Tank Management and Peikoff/Mahan.