Vedran Šego's answer more or less covers the specific example in the question, although I feel it's worth adding:
Since Kara is working for Decima who are aware of The Machine it's likely that they will have advised/assisted her in taking extra countermeasures so as not to be spotted
For the more general question
Does the Machine only give the SSN of people not related to terrorism or fighting against it? All CIA agents are supposed to fight terrorism, so they are relevant players.
The machine divides people/threats between those that affect national security (deemed "Relevant") and those that don't ("Irrelevant") and it is the "Irrelevant" numbers that get sent to Finch and at the time of Matsya Nyaya
the "Relevant" numbers are being sent to the ISA personnel operating under the auspices of the "Northern Lights" project.
The only times The Machine sends "Relevant" numbers to Finch & Co. is generally when something breaks down in the arrangement with the govt. e.g:
When "Northern Lights" is shutdown in the wake of the Vigilance leaks The Machine redirects the "Relevant" numbers to "Tertiary Operations" a.k.a Root
and
When Samaritan decides not to act on the threat to POTUS in Synecdoche The Machine sends the designation for Marine One to Reese to get Team Machine to step in (and Reese's number to the Harper-Durban-Pierce team in order to provide the primary team with an exit)
There's also evidence that the Machine can exercise a certain amount of discretion when it comes to the protocols as well since it could also be argued that
Shaw was a "Relevant" number in the season two episode Relevance, she was after all potentially a threat to national security and was certainly a threat to the "Northern Lights" program itself. The Machine however chose to send her number to Finch for them to save (and to recruit her for Team Machine as is essentially confirmed by the Machine in return 0; when she is talking to Shaw)
and where The Machine has realised that the government/ISA themselves are causing the "Relevant" threat such as:
In the season 3 episode 4C the ISA have sent a team to kill Owen Matthews