The BBC has threatened to take legal action against the Stig, Top Gear's anonymous driver, to prevent him from publishing an autobiography.

The Stig, the anonymous driver who hides his identity behind a helmet with a blackened visor, wants to write the book but the BBC is opposing the move because it would mean him being unmasked.

BBC lawyers insist he is contractually obliged to keep his identity under wraps.

The character, who has helped Top Gear become BBC2's biggest ratings hit, undertakes test drives and trains celebrities to race around a track for one of the programme's most popular segments, Star in a Reasonably Priced Car. The current "Stig" took up the role after Perry McCarthy, who played him originally, was exposed.

The BBC said the proposed autobiography breaches "agreed contractual and confidentiality obligations" relating to the programme.

Only a handful of BBC executives and Top Gear presenters Jeremy Clarkson, Richard Hammond and James May are said to know who he is.

Several racing drivers have been linked with the role, including former Formula One world champions Damon Hill and Michael Schumacher – who dressed up as the Stig for a Top Gear stunt last year.

• To contact the MediaGuardian news desk email editor@mediatheguardian.com or phone 020 3353 3857. For all other inquiries please call the main Guardian switchboard on 020 3353 2000.

• If you are writing a comment for publication, please mark clearly "for publication".