Retired officers writing books and articles have put the government in a spot many times. After a series of such embarrassments, the government is cracking down. Now officers of 12 agencies will need permission before writing on security issues and a violation could cost them their pension.