Too true with regard to the outings by the press and by rogue authors.
But the Carter administration was also responsible for the gutting of the Ops Directorate - a lot of very experienced agents were cashiered at that time, apparently due to the Carter Administration’s distaste for covert ops. It was a genuine tragedy for America.
A friend, who was a good covert was outed and then “retired” after he was outed during the Carter years.