The CIA is divided between the Directorate of Intelligence, which houses the analysts, and the Directorate of Operations, which houses the spies and the paramilitary forces. The spies are, in general, divided into two groups. There are those with official cover and those with non-official cover. Official cover means that the agent is working at the U.S. embassy in some country, acting as a cultural, agricultural or some other type of attache, and is protected by diplomatic immunity. They carry out a variety of espionage functions, limited by the fact that most foreign intelligence services know who the CIA agents at the embassy are and, frankly, assume that everyone at the embassy is an agent. They are therefore followed, their home phones are tapped, and their maids deliver scraps of paper to the host government. This obviously limits the utility of these agents. Being seen with one of them automatically blows the cover of any potential recruits.
Then there are those with non-official cover, the NOCs. These agents are the backbone of the American espionage system. A NOC does not have diplomatic cover. If captured, he has no protection. Indeed, as the saying goes, if something goes wrong, the CIA will deny it has ever heard of him. A NOC is under constant pressure when he is needed by the government and is on his own when things go wrong. That is understood going in by all NOCs.