The CIA was formed in 1945-1946, and its first few CIA Directors were generals recruited from other branches of the military, who reluctantly took the job, and it was a bit disorganized. They missed a lot of major events they were created to learn about and warn of in advance, such as the Russians creating their first atomic bomb (1949), North Korea invading South Korea (1950), and miscalculating whether or not China would enter the war on the side of North Korea.

Events that got many of the earlier directors fired and replaced. But then, these generals looked at this position as a distraction and impediment to their military careers, and only took the position because they were assigned to.

A restructuring of the CIA based on recommendations began in 1950, and under two new Directors the CIA began to definitively form, under Walter Bedell Smith (Oct 1950-Feb 1953) and then Allen Dulles (Feb 1953-Nov 1962). Dulles lost his job after the Cuban Missile Crisis, because of the failed Bay of Pigs invasion, and several unsuccessful assassination attempts on Fidel Castro under the code name "Operation Mongoose".

So it was under these three directors that the CIA took on a form resembling what we see in the Bond movies, and began carrying out global covert operations.

There was an article I read over 25 years ago where a former agent of the CIA argued that the CIA has embarassed every president since the CIA was formed. Because of the failures I listed above, and the lack of accountability of their black operations that have allowed them to do questionable things that were exposed, such as assassinations, espionage in both enemy and friendly nations, gun-running, drug trafficking, and other crimes, that ended up making headlines worldwide.