Spy shows on American television have shaped public perception, with the CIA and FBI influencing scripts behind the scenes.